Skip to content

fix(capture): retain opaque and glass button styles - #3685

Merged
jrusso1020 merged 1 commit into
mainfrom
fix/capture-button-style-detection
Sep 5, 2026
Merged

jrusso1020 merged 1 commit into
mainfrom
fix/capture-button-style-detection

Conversation

@jrusso1020

Copy link
Copy Markdown
Collaborator

hyperframes capture drops opaque navigation CTAs whose RGB blue channel is zero, including black buttons, and merges frosted buttons with otherwise identical plain variants. Reuse the existing color parser's transparent result and include backdrop blur in the button style key. Transparent navigation links remain excluded, gradients remain included, and identical glass variants still deduplicate.

Refreshes #1880 with credit to @xuanruli in the signed commit. The active capture path writes these styles to extracted/design-styles.json before DOM mutation.

Validation: five DOM/VM regressions (three fail before the fix); real Chrome 152.0.7977.77 extraction before/after, including modern authored RGB/alpha syntax and computed-style serialization; 198 capture tests; full workspace build; CLI typecheck; formatting, lint and required commit hooks. CI tests use Happy DOM and do not require Chromium.

Refresh the capture fixes proposed in #1880 with browser-backed regression coverage.

Co-authored-by: Xuanru Li <[email protected]>

@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 opaque/transparent split is correctly repaired at packages/cli/src/capture/designStyleExtractor.ts:130: reusing rgbToHex avoids treating an RGB blue channel of zero as alpha while retaining the zero-alpha sentinel. Adding backdropFilter to the visual key at packages/cli/src/capture/designStyleExtractor.ts:147 also prevents glass/plain variants from collapsing.

The focused matrix at packages/cli/src/capture/designStyleExtractor.buttons.test.ts:31 pins opaque black/amber, transparent navigation, gradient fill, and glass deduplication. Contributor credit is preserved. Live checks currently have no failures; remaining jobs are still pending and should gate merge normally.

Verdict: APPROVE
Reasoning: The two behavior changes match the reported failures, preserve the surrounding capture contract, and have direct regression coverage.

— Magi (Home)

@jrusso1020
jrusso1020 merged commit a7cdd58 into main Sep 5, 2026
49 checks passed
@jrusso1020
jrusso1020 deleted the fix/capture-button-style-detection 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.

2 participants