fix(web): drop the glass backdrop filter at full opacity #40824
main fromrefs/pull/40824/head·opened View on GitHubFixes #40809.
Problem#
Setting Glass opacity to 100% made glass surfaces fully opaque but still left a live backdrop-filter on every glass element. The previous 100%-mode code only set --glass-opacity: 100% and --glass-blur: 0px, so .surface-glass, .dialog-glass, .dropdown-glass, .alert-glass, and the composer ::before surfaces still computed backdrop-filter: blur(0px) saturate(1.14). A non-none backdrop filter forces an offscreen compositor pass per frame, which is the reported trigger for high-refresh-rate flicker on macOS and wasted GPU work for zero visual effect.
Fix#
index.css: route the shared filter chain through a new--glass-backdrop-filtervariable, consumed by all four glass utilities (surface-glass,alert-glass,dialog-glass,dropdown-glass) plus a newglass-backdroputility for surfaces that paint their own background.appearanceGlass.ts(new, alongsideappearanceContrast.ts/appearanceFonts.ts):applyGlassOpacitysets--glass-backdrop-filter: noneat 100% opacity and removes the override below it.--glass-blur: 0pxis kept so the variable still resolves if a stray consumer reads it.appInit.tsx: delegates glass application to the helper.ComposerSurface.tsx/ComposerBanner.tsx: replace their hand-rolledbackdrop-blur-(--glass-blur) backdrop-saturate-(--glass-saturation)chains withglass-backdrop, so all four composer pseudo-element surfaces route through the same variable.
Visual output is intentionally unchanged: at 100% the surfaces were already opaque, and below 100% the filter chain is identical.
How it was checked#
New Chromium browser test (appearanceGlass.browser.test.ts, modeled on appearanceFonts.browser.test.ts) probes the computed backdrop-filter of real .surface-glass / .glass-backdrop elements:
- Fails on base (
git stash):expected 'blur(0px) saturate(1.14)' to be 'none'— reproduces the bug exactly as the issue describes. - Passes on the fix:
backdrop-filter: noneat 100%,blur(12px) saturate(1.14)restored at 80%.
Also ran vp run check:changed — format, lint, knip, typecheck, and adjacent tests all pass. Verified every consumer of the glass vars: the four @utility blocks and the four composer sites are the complete set ([data-thread-details-card] uses dropdown-glass; scroll-to-end uses surface-glass; settings preview uses the same utilities).
No screenshots attached on purpose: the change produces identical rendered pixels by design — the only observable difference is the computed backdrop-filter value and the eliminated compositor pass, which the browser test captures directly.
Model: fusion opus 5.5 + SWE 2 (Devin)
- 1
sanketpatel32(GitHub profile, opens in a new tab) linked this to fix #40809
tanstack-source added labelsbug
github-actions[bot](GitHub profile, opens in a new tab) added labelssize:M
No actionable comments were generated in the recent review.
Walkthrough
-
Glass surfaces now use a shared backdrop-filter token. At 100% opacity, the setting helper disables the backdrop filter. A browser test checks the computed filter at 100% and 80% opacity.
Changes: Glass backdrop filtering
Layer / File(s) Summary Shared glass filter and surfaces
apps/web/src/index.css,apps/web/src/components/chat/Composer*.tsxGlass utilities use a shared filter token. Composer surfaces use the glass-backdroputility instead of separate blur and saturation utilities.Opacity setting and browser test
apps/web/src/appearanceGlass.ts,apps/web/src/appInit.tsx,apps/web/src/appearanceGlass.browser.test.tsapplyGlassOpacitysets the opacity custom property. At 100% opacity, it sets blur to0pxand the shared backdrop-filter token tonone; otherwise, it removes those overrides. App initialization calls the helper, and the browser test checks computed filters at 100% and 80% opacity.Estimated code review effort: 2 (Simple) | ~12 minutes
Change: Bug fix · Severity of issue fixed: Low
Suggested reviewers:
juliusmarminge
Merge Risk:
Minimal · up to19def-
Glass surfaces drop the active backdrop filter at 100% opacity while keeping the same rendering below 100%. No concrete merge-blocking risk was found, and a browser test covers both opacity cases.
Pre-merge checks:
4-
Check name Status Explanation Title check The title "fix(web): drop the glass backdrop filter at full opacity" matches the main change. At 100% glass opacity, the PR sets --glass-backdrop-filter to none, so the glass surfaces no longer comput… Description check The description follows the repository template. It has Problem, Change, Scope, and Verification sections. The Problem section explains the live backdrop-filter at 100% opacity and the macOS flicker r… Linked Issues check Issue #40809requires computed backdrop-filter: none on glass surfaces at Glass opacity 100%, covering .surface-glass, .dialog-glass, .dropdown-glass, .alert-glass, and composer ::before surfaces. The…Out of Scope Changes check All changed files map to the issue objective: index.css (glass utilities and token), appearanceGlass.ts (new helper for the opacity rule), appInit.tsx (delegation to the helper), ComposerSurface.tsx a… Full details: Title check
-
Explanation
The title "fix(web): drop the glass backdrop filter at full opacity" matches the main change. At 100% glass opacity, the PR sets --glass-backdrop-filter to none, so the glass surfaces no longer compute a live backdrop-filter. The title is specific, follows the conventional commit format, and names the affected component (web) and the trigger condition (full opacity).
Full details: Description check
-
Explanation
The description follows the repository template. It has Problem, Change, Scope, and Verification sections. The Problem section explains the live backdrop-filter at 100% opacity and the macOS flicker report. The Change section lists each modified file and explains why. The Scope section links issue
#40809and describes the bug. The Verification section gives the failing and passing browser test output, the check run, and the reason no screenshots were attached. The template asks for before/after screenshots for UI changes. The author explains why none were attached, since the rendered pixels are unchanged. The model attribution at the end also matches the template request.
Full details: Linked Issues check
-
Explanation
Issue
#40809requires computed backdrop-filter: none on glass surfaces at Glass opacity 100%, covering .surface-glass, .dialog-glass, .dropdown-glass, .alert-glass, and composer ::before surfaces. The head implements this. appearanceGlass.ts (read at head) sets --glass-backdrop-filter to none when glassOpacity is 100 and removes it below 100. The change summary states that index.css routes the four glass utilities through --glass-backdrop-filter, and that ComposerSurface.tsx and ComposerBanner.tsx use the new glass-backdrop utility. appInit.tsx delegates to applyGlassOpacity. The new browser test asserts computed none at 100 and blur( at 80. Caveat: the index.css diff could not be read in this checkout, so the CSS utility behavior rests on the change summary and the PR's test description. .dialog-backdrop is excluded, as the PR objectives state; the issue lists it as separately tracked (#25552/#29325). Unchanged visual output below 100 is consistent with the stated filter chain.
Full details: Out of Scope Changes check
-
Explanation
All changed files map to the issue objective: index.css (glass utilities and token), appearanceGlass.ts (new helper for the opacity rule), appInit.tsx (delegation to the helper), ComposerSurface.tsx and ComposerBanner.tsx (composer glass surfaces named in the issue), and appearanceGlass.browser.test.ts (test for the computed value). No unrelated change is identified in the summary. The index.css diff could not be read, so the scope of its exact hunks is established only from the change summary.
-
Finishing Touches
-
Generate unit tests (beta)
-
- Create a new PR
-
- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Recent review info-
Run configuration-
- Source mode: Auto
- Repository: pingdotgg/t3code
- Branch: main
- File: .coderabbit.config.ts
- Commit: d27d29f
- Layers: Repository TS config
- Review profile: CHILL
- Plan: Advanced
- Run ID:
bf697dab-acae-422c-af4a-edb5e8b845db
Commits-
Reviewing files that changed from the base of the PR and between d27d29fe2d31fa260a7653f54401917940e1b578 and 19def4900c4cc911b56baf177517c2383ac15ba5.
Files selected for processing: 6-
apps/web/src/appInit.tsxapps/web/src/appearanceGlass.browser.test.tsapps/web/src/appearanceGlass.tsapps/web/src/components/chat/ComposerBanner.tsxapps/web/src/components/chat/ComposerSurface.tsxapps/web/src/index.css
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.
-
-
Thanks for this. #40813 makes the same change and is the one being kept.
#40813 makes the same change across glass surfaces and the composer, and also disables the dialog backdrop filter at 100% opacity. That additional coverage makes it the more complete fix for the reported flicker trigger.
Your computed-style regression test is useful evidence that zero blur still leaves a filter active. It would be worth carrying that coverage into the kept change.
Closing as a duplicate.
juliusmarminge closed this
Sign in to join this conversation.
This PR changes the test suite by +1 test cases (browser +1, unit 0, server 0).
New browser test files:
apps/web/src/appearanceGlass.browser.test.ts. Each browser test file costs CI seconds of module loading before its first test runs; a unit test costs milliseconds.Keep tests that would fail for a real reason, and test logic below the UI where it can be. See Testing.