Skip to content

fix(capture): sample computed shadows on ordinary boxes - #3686

Merged
jrusso1020 merged 1 commit into
mainfrom
fix/capture-computed-shadows-1883
Sep 5, 2026
Merged

fix(capture): sample computed shadows on ordinary boxes#3686
jrusso1020 merged 1 commit into
mainfrom
fix/capture-computed-shadows-1883

Conversation

@jrusso1020

Copy link
Copy Markdown
Collaborator

Capture misses box shadows on ordinary or utility-class containers because it samples only named cards, buttons, and similar selectors. Add a bounded computed-style sample of structural boxes while preserving existing semantic samples, including small buttons and late-page headers. Deduplicate overlapping samples; apply tiny/full-page exclusions only to newly sampled boxes.

Successor to #1883 by @xuanruli; original authorship preserved. The separate toolkit in #2005 was closed and re-homed, while this extractor remains part of the active capture command.

Validation: 196 capture tests pass, including three new regressions; CLI typecheck, formatting/lint, and commit hooks pass. Chrome 152 reproduces the missed shadows before the fix and verifies coverage, deduplication, hidden/tiny/full-page exclusions, and preservation of late semantic samples afterward. A 10,000-div fixture adds only 1,600 computed-style reads (800 new candidates). No Chrome dependency added to CI tests.

@miguel-heygen miguel-heygen left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

The sampler extension is bounded and preserves the old priority surface: semantic elements are retained independently at packages/cli/src/capture/designStyleExtractor.ts:377, structural candidates are capped and deduplicated at packages/cli/src/capture/designStyleExtractor.ts:384, and tiny/full-page exclusions apply only to the new candidates at packages/cli/src/capture/designStyleExtractor.ts:391.

The regressions at packages/cli/src/capture/designStyleExtractor.shadows.test.ts:32 cover ordinary/utility boxes, overlap counts, dense-prefix behavior, and the hidden/tiny/full-page boundaries. Contributor authorship is intact. I also verified the merge tree with #3685 is clean and contains both suites. Live checks currently have no failures; remaining jobs should gate merge normally.

Verdict: APPROVE
Reasoning: The change broadens shadow discovery without dropping existing semantic samples or making the scan unbounded, and the boundary cases are directly pinned.

— Magi (Home)

@jrusso1020
jrusso1020 merged commit 9ed5002 into main Sep 5, 2026
49 checks passed
@jrusso1020
jrusso1020 deleted the fix/capture-computed-shadows-1883 branch September 5, 2026 00:28
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.

3 participants