Skip to content

fix(check): clip overlap geometry to visible fragments - #3698

Merged
miga-heygen merged 1 commit into
mainfrom
magi/fix-overflow-clipped-overlap
Sep 8, 2026
Merged

miga-heygen merged 1 commit into
mainfrom
magi/fix-overflow-clipped-overlap

Conversation

@miguel-heygen

Copy link
Copy Markdown
Collaborator

What

content_overlap no longer reports text that an overflow ancestor fully hides. Partially clipped text is measured by its painted area, so genuine visible collisions still cross the overlap threshold.

Why

DOM Range rectangles remain geometrically present outside an overflow clip. Comparing those raw rectangles produced false-positive overlap warnings for translated or otherwise clipped text.

How

Text fragments are intersected with each overflow ancestor in viewport coordinates before overlap analysis. Clipping is axis-aware for hidden, clip, auto, and scroll, while data-layout-allow-overlap remains a local opt-out.

Test plan

  • Unit tests added/updated

  • Manual testing performed

  • Documentation updated (not applicable)

  • bunx vitest run src/commands/layout-audit.browser.test.ts --reporter=dot (89 tests passed)

  • node --check packages/cli/src/commands/layout-audit.browser.js

  • bunx oxlint packages/cli/src/commands/layout-audit.browser.js packages/cli/src/commands/layout-audit.browser.test.ts

  • bunx oxfmt --check packages/cli/src/commands/layout-audit.browser.js packages/cli/src/commands/layout-audit.browser.test.ts

  • git diff --check

The package-wide typecheck is unavailable in this reused checkout because optional AWS, GCP, and producer dependencies are absent and existing cross-package type drift is present. It did not report errors in the changed browser audit or regression test.

@miga-heygen miga-heygen 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.

Overflow-clipped text rects for overlap detection. Clean extraction of unionRects and clipsOverflowValue helpers with per-axis clipping. Tests cover all overflow modes. — Miga

@miga-heygen
miga-heygen enabled auto-merge (squash) September 8, 2026 18:09
@miga-heygen
miga-heygen merged commit 776c291 into main Sep 8, 2026
49 checks passed
@miga-heygen
miga-heygen deleted the magi/fix-overflow-clipped-overlap branch September 8, 2026 18:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants