Skip to content

fix(cli): honor overflow opt-out for clipped text#2240

Open
miguel-heygen wants to merge 1 commit into
mainfrom
fix/clipped-text-overflow-optout
Open

fix(cli): honor overflow opt-out for clipped text#2240
miguel-heygen wants to merge 1 commit into
mainfrom
fix/clipped-text-overflow-optout

Conversation

@miguel-heygen

Copy link
Copy Markdown
Collaborator

What

  • make clipped_text honor data-layout-allow-overflow
  • add regression coverage for text containers with intentionally bleeding decorative children

Why

A scene containing its own text plus a 50px bleeding/Ken Burns background child inflated the scene's scrollWidth. Even with data-layout-allow-overflow, the layout audit emitted clipped_text errors because that specific diagnostic skipped the shared overflow opt-out used by container and canvas overflow checks. Snapshots and a tolerance sweep confirmed the text itself was not clipped.

How

Return early from clippedTextIssue() when the element or an ancestor carries data-layout-allow-overflow, matching the existing behavior of the other overflow diagnostics.

Test plan

  • added a failing regression fixture with an overflow-hidden text container, 100px decorative bleed, and data-layout-allow-overflow
  • verified the test failed before the fix and now passes
  • bun run --filter @hyperframes/cli test -- --run src/commands/layout-audit.browser.test.ts (31 passed)
  • bunx oxlint packages/cli/src/commands/layout-audit.browser.js packages/cli/src/commands/layout-audit.browser.test.ts
  • bun run --filter @hyperframes/cli typecheck
  • pre-commit lint, format, fallow, and typecheck hooks passed

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.

1 participant