Repository navigation
Studio: blur the glass Settings dialog on its own layer so scrolling it stays cheap - #16942
Merged
Merged
Conversation
… cheap With Glass menus on, the dialog surface carried its own backdrop-filter, and Chromium re-ran that 24px blur for every frame the dialog's content scrolled. Scrolling Settings cost about 5.3 s of browser CPU per 40 wheel steps against 3.1 s with no dialog blur at all. The blur now sits on a ::before layer under the dialog (isolated, will-change: transform), whose backdrop does not change while only the content above it moves: 3.1 s, the same as dropping the blur, with the look unchanged to the eye (Settings screenshot: 3k pixels differ by more than 8 levels out of 2M). Applies on every engine; WebKit's no-blur glass already drops this layer's blur too.
Member
Author
|
@codex review |
Codex Review Summary: ❌ FailedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
…ox; layer only Settings
… on the direct blur
imaderaya
pushed a commit
to pub-forks/unsloth
that referenced
this pull request
Nov 7, 2026
…unslothai#16978) Follow-up to unslothai#16931. The long-chat gate carried allowances for costs main had when it landed. unslothai#16938 (the `:has()` rewrite), unslothai#16942 and unslothai#16957 removed most of those costs, so this lowers the allowances to today's readings so they cannot creep back. ## Changes - `tests/studio/has_subject_allowlist.txt`: regenerated. 57 selectors are still allowed, 61 are gone. Lint on main: 197 `:has()` rules, 57 non-subject, 0 new, 0 stale. - `tests/studio/_area_matrix.py`: - All 9 per-area element-count ceilings are removed, so those areas get the normal 2x growth check. unslothai#16938 fixed every one of them; none restyles the whole thread on open any more. - Glass ceilings lowered to about 1.2-1.3x the highest reading on current main. - A recheck page that fails to load or measure now keeps the first verdict instead of crashing the gate with a traceback. A recheck can only lower a reading, so this never hides a failure. ## Count ceilings removed (elements restyled at 200 turns) | Area | Old ceiling | Now | 200 vs 40 turns | |---|---|---|---| | model_picker | 44000 | 459 | 0.99x | | chat_options | 17000 | 2091 | 1.45x | | browser_pane | 45000 | 1259 | up to 2.55x | | account_menu | 30000 | 346 | 1.0x | | organize_chats | 30000 | 226 | 1.0x | | chat_row_menu | 32000 | 1817 | 1.55x | | sidebar_sections | 45000 | 163 | up to 1.18x | | sidebar_toggle | 30000 | 365 | 1.06x | | run_settings | 45000 | 1214 | 2.13x | browser_pane and run_settings grow a little faster than 2x but stay under the 3000-element floor (about 4 elements per turn, not a whole-thread restyle). ## Glass ceilings (ratio vs the default look) Highest reading over 3 runs pinned to 4 CPUs and 7 runs on a loaded 36-core host. | Mode | Old | Highest | New | |---|---|---|---| | frosted, other areas | 10 | 5.79 | 7 | | blurred, other areas | 10 | 5.50 | 7 | | liquid, other areas | 10 | 5.65 | 7 | | liquid-3d, other areas | 12 | 5.41 | 7 | | frosted, Settings scroll | 28 | 9.69 | 12 | | blurred, Settings scroll | 28 | 12.18 | 15 | | liquid, Settings scroll | 28 | 10.08 | 13 | | liquid-3d, Settings scroll | 28 | 9.60 | 12 | ## Testing - Full gate on main: PASS 4 times (270-310 s). - Still fails when it should: - a planted subject-after-`:has()` rule is reported by name ("57 allowlisted, 1 new"); - a synthetic Glass material with a 40px backdrop blur fails 8 cells at 4.0-15.7x, with no real mode failing. - `test_area_matrix.py`, `test_has_lint.py`, `test_css_culprit.py`: 58 passed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
With Glass on, scrolling inside the Settings dialog is expensive in Chromium (the engine behind the Windows app's WebView2): the dialog's own
backdrop-filteris re-run for every frame its content scrolls. The long-chat gate measured Glass Settings scrolling at 10 to 22x the CPU of the solid window.Fix
The glass Settings dialog no longer carries the
backdrop-filteritself. A::beforelayer underneath it (position: absolute; inset: 0; z-index: -1, insideisolation: isolateon the dialog) carries the same blur. While the panes above it scroll, the layer's backdrop is left alone. This is the pattern glass dialogs with sticky content already use (:has(.sticky, [data-glass-float])::before).It applies only to Settings (
[data-settings-dialog]), whose shell isoverflow-hiddenand never scrolls. Dialogs that scroll their own box (the sharedDialogContentdefault isoverflow-y-auto, for example Connections) keep the direct blur: an absolute layer there would scroll away with the content and leave the lower part unblurred. It also does not apply on WebKit (data-glass-layers, macOS and Linux apps), where the layer costs about 9% more scroll CPU; WebKit keeps the direct blur exactly as on main. The layer has nowill-change, which added nothing measurable. Solid, Transparent and Glass menus off are untouched.Results
Browser CPU for 40 wheel steps scrolling Settings, Glass Liquid 3D, same build base, 3 reps each:
About 39% less CPU while scrolling Settings in Chromium, close to having no blur on the page at all (2,990 ms). The trade-off: opening the Style dropdown inside Settings is about 30 ms slower with the layer, with or without
will-change, and the p90 scroll frame rose to 67 ms in one of two runs (headless software compositing). Scrolling Settings is the frequent, sustained cost; the dropdown open is a single short one. WebKit is unchanged (the rule does not apply there; in WebKit the layer would cost 5 to 6% more scroll CPU). Glass off is unchanged in both engines.Tests
studio/frontend/tests/glass-dialog-blur-layer.test.ts: other dialogs keep the direct blur; Settings drops it and isolates; its::beforelayer sits atz-index: -1, covers the dialog, ignores pointers and carries the blur; the Settings shell staysoverflow-hidden.node scripts/typecheck.mjs --testsis clean.