Repository navigation
Studio: set scrollbar-color in rgb so Reduce motion stops restarting a transition on every element - #17413
Merged
Conversation
…a transition on every element
Member
Author
|
@codex review |
Codex Review Summary: ✅ CompletedThis 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. |
|
Codex Review: Didn't find any major issues. Chef's kiss. Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
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.
Summary
Since #17377 turned Reduce motion on by default, the area matrix in
Frontend build + bundle sanityfails on main: in every Glass material, opening the API monitor restyles 3,400 to 4,900 elements against about 110 in the default appearance (limit 10x). Bisectingec6d1606..c3af42a6with only that cell measured lands on #17377 (123 elements before it, 13,754 after).#17377 itself is fine, it only flips a default. It exposed a cost that every user who had turned Reduce motion on was already paying:
transition-duration: 0.01mson every element (html.force-reduced-motion *). Elements with no transition of their own keep the initialtransition-property: all, so every property change on them now runs a transition.* { scrollbar-color: oklch(0.5 0 0 / 0.54) transparent }puts an oklch colour on every element. Chromium reads it back asoklab(...)once a transition has run on it, so the next restyle of that element sees a different value and starts anotherscrollbar-colortransition, which restyles it again.A Chrome trace of one API monitor open and close in Liquid Glass shows 10,635
scrollbar-colortransitions started, and nearly every restyle reason isAnimation. Any restyle of a long thread triggers the same loop, not just the monitor.Change
scrollbar-colorinindex.cssandhub.cssis now written as the equivalentrgb()(for exampleoklch(0.5 0 0 / 0.54)becomesrgb(99 99 99 / 0.54)). These are achromatic greys, so the conversion is exact to the nearest 8-bit step and nothing changes on screen. Legacy colours round-trip unchanged, so no spurious transition starts.studio/frontend/tests/scrollbar-color-legacy-rgb.test.tschecks everyscrollbar-colorundersrc/is rgb, hex or a keyword, and rejects oklch,var()andcolor-mix(). Run against main'sindex.css, it fails and lists the oklch values.Measured
Production long-thread build, Chromium, same harness as the area matrix (
_area_matrix.Page.sweep), elements restyled per area:CPU for typing in liquid-3d at 200 turns goes from 2.9 s to 0.6 s.
Not fixed here
With Reduce motion on, the API monitor cell is still above the 10x limit in Glass (about 4,000 elements against 110). That remainder does not come from CSS: with this change it stays at 3,400 even when every reduced-motion transition is forced to
0s, and it drops to 117 when Reduce motion is set to Off. It comes from the JS side of Reduce motion and needs its own change.Testing
node --test tests/scrollbar-color-legacy-rgb.test.ts tests/dialog-scrollbar-corners.test.tspass. The new test fails on main'sindex.css.scrollbar-color:#6363638a transparentand so on).