Skip to content

fix(title): don't show tooltip for imperceptible sub-pixel clip (#DS-4292)#1684

Merged
lskramarov merged 1 commit into
mainfrom
fix/DS-4292
Jul 2, 2026
Merged

fix(title): don't show tooltip for imperceptible sub-pixel clip (#DS-4292)#1684
lskramarov merged 1 commit into
mainfrom
fix/DS-4292

Conversation

@lskramarov

Copy link
Copy Markdown
Contributor

No description provided.

@lskramarov lskramarov requested review from NikGurev and artembelik July 1, 2026 14:03
@lskramarov lskramarov self-assigned this Jul 1, 2026
@lskramarov lskramarov added the bug Something isn't working label Jul 1, 2026
@github-actions

github-actions Bot commented Jul 1, 2026

Copy link
Copy Markdown

Visit the preview URL for this PR (updated for commit c8f3c15):

https://koobiq-next--prs-1684-irped160.web.app

(expires Mon, 06 Jul 2026 14:08:17 GMT)

🔥 via Firebase Hosting GitHub Action 🌎

Sign: c9e37e518febda70d0317d07e8ceb35ac43c534c

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adjusts KbqTitleDirective overflow detection to avoid showing a tooltip when the text is only clipped by an imperceptible sub-pixel amount (for the default text-overflow: clip case), while still treating sub-pixel overflow as truncation when an ellipsis is actually rendered.

Changes:

  • Added an SSR-friendly KBQ_WINDOW injection to read computed styles for text-overflow.
  • Refactored the “fractional pixel” overflow path to use a dedicated isWidthOverflown helper that rounds widths when no ellipsis is present.
  • Added Jest coverage for sub-pixel clip vs ellipsis behavior across both “text-only” and “container + child element” measurement scenarios.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
packages/components/title/title.directive.ts Uses text-overflow (via KBQ_WINDOW.getComputedStyle) to decide whether sub-pixel width differences should count as visible truncation.
packages/components/title/title.directive.spec.ts Adds unit tests validating the new sub-pixel overflow behavior for clip vs ellipsis, including container-vs-child ellipsis placement.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@lskramarov lskramarov merged commit 89f3a8b into main Jul 2, 2026
10 checks passed
@lskramarov lskramarov deleted the fix/DS-4292 branch July 2, 2026 13:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants