Repository navigation
Studio: read the scaled lengths and colours the UI contracts were written against - #11505
Conversation
…inst Repo tests (CPU, studio) is red on main: 12 tests across test_desktop_reliability_frontend_contract.py and test_update_release_notes.py. Bisected to two UI PRs that each merged with this lane already failing: 42fc28f (before both) 228 passed, 0 failed 3bc5eb5 (#11459) 2 failed 10c380e (#11458) 12 failed Both PRs are right, and neither changes what renders. #11458 made spacing follow the UI font size by wrapping fixed lengths as calc(X * var(--ui-space-scale, 1)), where the scale is calc(--ui-font-scale / 0.9375) and --ui-font-scale defaults to 0.9375, so the scale is 1 and every length is what it was. #11459 did the same for colour, respelling foreground/10 as a color-mix scaled by --contrast-edge-gain and white/[0.06] as an rgb() scaled by --contrast-wash-gain, both defaulting to 1. So only the spelling moved, and these contracts are written against the values. They now read through _at_default_scale, which resolves calc(X * var(--s, 1)) to X, a color-mix of a token at N% with transparent to token/N, and an rgb() white at alpha A to white/[A]. Those are the same values written out, so a contract keeps asking what it asked before. Two assertions needed more than the reader. The titlebar slot became max(7rem, calc(7rem * var(--ui-space-scale, 1))), a floor so it never shrinks under the three 30px buttons, and prettier wrapped the ternary over three lines, so that one matches across whitespace and against the 7rem rather than one exact expression. The notes surface reads the white and the 0.06 rather than the shorthand. Worth recording for the sidebar guard: #11458 scaled the pin's own offset and padding as well as --spacing, so both sides of that geometry scale together and the arithmetic in spacing units stays exact at every scale, not just the default. Verified: 228 passed across the two files, which is what main had before #11459. Sabotage checks through the new spellings, so the reader cannot be hiding a real change: moving the pin's right offset from 1.875rem to 3.5rem fails the coarse-pointer guard, and moving the image footer border from 10% to 40% fails the image page contract.
Codex Review SummaryThis 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 |
|
@codex security review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 3ed62a3284
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
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".
| # 0.06 white at the default gain of 1, so read the white and the amount rather than one | ||
| # spelling. A darker inset, or a different amount, still fails. | ||
| assert re.search( | ||
| r"dark:bg-(?:white/\[0\.06\]|\[rgb\(255_255_255_/_calc\(0\.06\*var\(--contrast-wash-gain)", |
There was a problem hiding this comment.
Match the complete scaled alpha expression
When the scaled color expression acquires any suffix after the variable name, this regex still passes because it stops at --contrast-wash-gain; for example, both a misspelled variable such as --contrast-wash-gain-broken and calc(0.06*var(--contrast-wash-gain,1)+0.5) satisfy the assertion even though they no longer render the promised 0.06 white lift. Match through the fallback, closing parentheses, and class bracket so changes to the actual alpha remain detectable.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Correct, fixed. The match ended at the variable name, so --contrast-wash-gain-broken and trailing arithmetic such as +0.5 both satisfied an assertion about a 0.06 white lift that no longer renders. It now matches through the fallback and both closing brackets.
Checked the way round that matters: with the variable renamed to --contrast-wash-gain-broken the test now fails, where it passed before.
| # three lines. Both are the same 7rem at the default scale. A slot that stopped being | ||
| # 7rem-based, or stopped keying off this branch, still fails. | ||
| assert re.search( | ||
| r'showSidebarSurface && !pinned\s*\?\s*"[^"]*7rem[^"]*"\s*:\s*sidebarWidth', |
There was a problem hiding this comment.
Bound the titlebar width match to exactly 7rem
When the titlebar width changes to another value containing the substring 7rem, such as 17rem or 0.7rem, this assertion still passes. Those values change the navigation slot geometry and violate the stated 7rem floor contract, so the numeric token needs boundaries or should be parsed rather than searched as an unrestricted substring.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Correct, fixed. 7rem was searched as an unbounded substring, so 17rem and 0.7rem satisfied a contract about a 7rem floor. The numeric token now has boundaries on both sides.
Verified with your own example: changing the slot to max(17rem, calc(17rem * var(--ui-space-scale, 1))) now fails this test, where it passed before.
Both of these are the same shape as the defect this PR exists to fix, a reader accepting less than it claims, so thanks for catching them in the fix itself.
Both matches stopped short of what they claimed. The alpha regex ended at --contrast-wash-gain, so a misspelled variable such as --contrast-wash-gain-broken, or trailing arithmetic like +0.5, satisfied an assertion about a 0.06 white lift that no longer renders. It now matches through the fallback and both closing brackets. The titlebar match looked for 7rem as an unbounded substring, so 17rem and 0.7rem passed a contract about a 7rem floor. The numeric token now has boundaries on both sides. Verified: 228 passed still, and each case the review named now fails where it passed before - 17rem fails the titlebar contract, --contrast-wash-gain-broken fails the notes surface.
The one frontend source in this file still read raw. It passes either way today, but a scaled length landing in it would be invisible to the contract for the same reason every other read goes through _ui_source.
|
@codex review |
1 similar comment
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: bab9932780
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
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".
| # three lines. Both are the same 7rem at the default scale. A slot that stopped being | ||
| # 7rem-based, or stopped keying off this branch, still fails. | ||
| assert re.search( | ||
| r'showSidebarSurface && !pinned\s*\?\s*"[^"]*(?<![\d.])7rem(?![\w.])[^"]*"\s*:\s*sidebarWidth', |
There was a problem hiding this comment.
Match both terms of the titlebar width
The new boundaries still accept a changed scaled operand because the regex only needs one standalone 7rem anywhere in the string. Fresh evidence beyond the prior comment is that max(7rem, calc(17rem * var(--ui-space-scale, 1))) is normalized by _ui_source to max(7rem, 17rem) and satisfies this assertion, although the default navigation slot now renders at 17rem rather than the promised 7rem. Match the complete max() structure or otherwise verify that both the floor and scaled base are 7rem.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Correct, and a sharper version of the same hole than my last fix closed. Boundaries on the number only stopped 17rem being read as 7rem; they did nothing about the match being satisfied by one term. max(7rem, calc(17rem * var(--ui-space-scale, 1))) normalises to max(7rem, 17rem), matches on the floor, and renders a 17rem slot.
The whole value is pinned now: either a bare 7rem or a max of 7rem with itself, and nothing else.
Verified both ways round, since one term passing is exactly what went wrong: 17rem in the scaled operand fails, and 17rem in the floor fails too.
Boundaries on the number were still not enough. The regex only needed one standalone 7rem somewhere in the value, so max(7rem, calc(17rem * var(--ui-space-scale, 1))) normalises to max(7rem, 17rem), satisfies the match on its first term, and renders a 17rem slot while the contract says 7rem. The whole value is pinned now: either a bare 7rem or a max of 7rem with itself, and nothing else. Verified both ways round, since one term passing is exactly what went wrong: 17rem in the scaled operand fails, and 17rem in the floor fails. 37 passed.
|
@codex review |
|
@codex security review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: ffd0e04eb0
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
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".
| # lengths, so resolve the wrapper back to the length it scales. A real change to the length | ||
| # still fails, which is the whole point of reading the value rather than the spelling. | ||
| _SCALE_WRAPPED = re.compile( | ||
| r"calc\(\s*(-?[\d.]+(?:px|rem|em|%)?)\s*\*\s*var\(\s*--[\w-]+\s*,\s*1\s*\)\s*\)" |
There was a problem hiding this comment.
Restrict normalization to the intended scale variable
When a covered length is accidentally changed to use another custom property—or a typo such as --ui-spcae-scale—this pattern still collapses it to the original literal, so contracts such as the image/audio pt-[60px] checks continue to pass even though those panes no longer resize with a non-default interface font size. The existing frontend atDefaultUiScale helper restricts this transformation to --ui-space-scale; this normalizer should likewise recognize only the specific spacing or contrast variable appropriate to the value rather than every --* variable.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Correct, and it is the same defect shape as the one this PR fixes: a reader accepting more than it claims. Lengths now resolve only through --ui-space-scale / --ui-font-scale, and colour amounts only through --contrast-wash-gain / --contrast-edge-gain. That is the full set of scales in the frontend that default to 1.
Verified with your own case: respelling the audio pane's two pt-[calc(60px*var(--ui-space-scale,1))] sites as --ui-spcae-scale now fails the contract, as does hanging the same length off --contrast-wash-gain. A genuine 60px -> 80px change still fails, and the clean tree is 37 passed. Fixed in e9ce079.
Reading `var(--anything, 1)` collapsed a length hung off an unrelated property, or off a typo like `--ui-spcae-scale`, back to the literal the contract asks about, so a pane that had stopped following the interface font size still satisfied its guard. Lengths now resolve only through --ui-space-scale / --ui-font-scale and colour amounts only through --contrast-wash-gain / --contrast-edge-gain.
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: e9ce0794c4
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
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".
| # hung off an unrelated property - or off a typo like `--ui-spcae-scale`, which resolves to | ||
| # nothing and takes the fallback - normalise back to the literal this file asks about, so a | ||
| # pane that no longer follows the interface font size would still satisfy its contract. | ||
| _LENGTH_SCALES = r"--ui-space-scale|--ui-font-scale" |
There was a problem hiding this comment.
Normalize spacing only with the spacing scale
Fresh evidence beyond the prior scale-variable comment is that --ui-font-scale is initialized to 0.9375 in index.css, not 1 as this helper assumes. Replacing the Images header's calc(48px * var(--ui-space-scale, 1)) with calc(48px * var(--ui-font-scale, 1)) therefore renders it at 45px by default, but both header geometry contracts still pass because this alternation normalizes either expression to 48px. Keep spatial contracts tied to --ui-space-scale, or resolve each variable using its actual default value.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Confirmed and fixed. index.css:316 declares --ui-font-scale: 0.9375 and derives --ui-space-scale: calc(var(--ui-font-scale, 1) / 0.9375), so the spacing scale is 1 by default and the font scale is not. Normalizing a font-scaled length back to its literal was claiming a size the pane does not render. Lengths now resolve through --ui-space-scale alone.
Verified with your case: moving the Images header's calc(48px * var(--ui-space-scale, 1)) onto --ui-font-scale now fails test_images_header_tracks_preview_and_preserves_titlebar_controls and test_media_page_headers_out_stack_the_mac_drag_region. A plain 48px to 56px change still fails, and the clean tree is 37 passed.
| _COLOUR_GAINS = r"--contrast-wash-gain|--contrast-edge-gain" | ||
| _SCALED_LENGTH = re.compile( | ||
| rf"calc\(\s*(-?[\d.]+(?:px|rem|em))\s*\*\s*var\(\s*(?:{_LENGTH_SCALES})\s*,\s*1\s*\)\s*\)" | ||
| ) | ||
| _SCALED_AMOUNT = re.compile( | ||
| rf"calc\(\s*([\d.]+%?)\s*\*\s*var\(\s*(?:{_COLOUR_GAINS})\s*,\s*1\s*\)\s*\)" |
There was a problem hiding this comment.
Preserve edge versus wash gain semantics
When a border is accidentally changed from --contrast-edge-gain to --contrast-wash-gain, this shared alternation still strips the gain and lets the border-foreground/10 contract pass. This is observable for any non-default contrast setting because appearance-custom-store.ts computes the edge and wash gains with different spans; for example, making that substitution on the Images footer leaves test_image_page_structural_panes_share_the_container_breakpoint green while the border now responds like a surface wash. Normalize each color form only with its intended gain.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Agreed, and the two gains are not interchangeable: appearance-custom-store.ts gives the edge and the wash different spans, so off default a border scaled by the wash renders a colour its contract does not name. A gain is now resolved only where it matches the role of the colour it scales, read from the nearest preceding role marker: surfaces (bg-, background-color:) take the wash, borders, rings and outlines take the edge. A mismatched pair is left spelled out, so the contract asking for border-foreground/10 no longer sees one.
Verified with your case: swapping the Images footer's calc(10% * var(--contrast-edge-gain, 1)) to the wash gain now fails test_image_page_structural_panes_share_the_container_breakpoint.
| r"dark:bg-(?:white/\[0\.06\]" | ||
| r"|\[rgb\(255_255_255_/_calc\(0\.06\*var\(--contrast-wash-gain,\s*1\)\)\)\])", |
There was a problem hiding this comment.
Bound the notes match at the end of the class
Fresh evidence beyond the earlier alpha-expression comment is that the updated regex still accepts suffixes after the closing bracket: both dark:bg-[rgb(...)]-broken and dark:bg-[rgb(...)]/50 match. The former produces no intended background utility, while an opacity modifier can change the rendered lift, so this contract can remain green after the promised 0.06 class is no longer present; require a class-token boundary after either alternative.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Right, the class has to end where the match does. Added a (?![\w/\[-]) boundary after either alternative.
Verified both of your suffixes against update-notes-layout.ts: dark:bg-[rgb(...)]-broken, which names no utility at all, and dark:bg-[rgb(...)]/50, which is a different lift, each now fail the contract, and the clean file is 191 passed.
--ui-font-scale is 0.9375, not 1, so a length respelled onto it renders smaller than the literal a contract asks about; only --ui-space-scale, derived as the ratio of the two, is identity by default. The contrast gains are identity at rest but not interchangeable: the appearance store gives the edge and the wash different spans, so a border scaled by the wash renders a colour its contract does not name off default. Surfaces now resolve under the wash, borders and rings under the edge. The release notes lift also has to end where the class ends: a trailing -broken names no utility and a /50 is a different lift, and a match that stopped at the closing bracket accepted both.
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 25792a7a1f
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
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".
|
|
||
| def _at_default_scale(source: str) -> str: | ||
| """*source* with every scale-wrapped length and gain-wrapped colour read back as itself.""" | ||
| resolved = _SCALED_LENGTH.sub(r"\1", source) |
There was a problem hiding this comment.
Exclude fixed window chrome from scale normalization
When a non-scaling chrome value is accidentally wrapped in --ui-space-scale, this global substitution hides the change from every test using _ui_source. For example, changing the mirrored --studio-custom-titlebar-height in DesktopChromeVarsEffect to calc(34px * var(--ui-space-scale, 1)) is rewritten back to 34px, so test_fixed_sheets_start_below_the_custom_titlebar still passes even though the actual titlebar remains fixed at 34px and portalled sheets become incorrectly offset at non-default UI sizes. Normalize only values whose contracts permit scaling, or read fixed window-chrome assertions from the raw source.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Good catch, and the distinction is real: the custom titlebar is 34px because the Tauri window decoration is 34px, and DesktopChromeVarsEffect only mirrors that number onto <html> so portalled sheets can sit below it. No interface font size moves it. That mirror is now read exactly as written, through a _window_chrome_source helper that says why, rather than through the scale normaliser.
Verified: respelling usesCustomTitlebar ? "34px" : null as calc(34px * var(--ui-space-scale, 1)) now fails test_fixed_sheets_start_below_the_custom_titlebar, as does a plain 34px to 40px change, and the clean tree is 37 passed.
| assert re.search( | ||
| r"dark:bg-(?:white/\[0\.06\]" | ||
| r"|\[rgb\(255_255_255_/_calc\(0\.06\*var\(--contrast-wash-gain,\s*1\)\)\)\])" | ||
| r"(?![\w/\[-])", |
There was a problem hiding this comment.
Require the notes utility token to end after the match
Fresh evidence beyond the prior suffix fix is that a colon is still accepted after the closing bracket: dark:bg-[rgb(...)]:broken satisfies this regex because : is absent from the negative lookahead, but Tailwind then treats the whole colon-delimited string as a different/invalid candidate rather than the promised dark background utility. Require a true class-token boundary such as whitespace or a quote instead of excluding only selected suffix characters.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Agreed, excluding selected characters was the wrong shape for that check. The match now has to end at a real class boundary, (?=[\s"'\]|$)`, rather than at everything I happened to think of.
Verified all three suffixes against update-notes-layout.ts: -broken, /50 and your :broken each fail the contract now, and the clean file is 191 passed.
The custom titlebar is 34px because the Tauri decoration is 34px, and nothing about the interface font size moves it. Reading that mirror through the scale normaliser accepted a scaled spelling as 34px while the real titlebar stayed put and the portalled sheets slid off it, so the chrome is now read exactly as written. The notes lift excluded selected suffix characters rather than requiring the class to end: a colon still passed, and Tailwind reads the whole colon-delimited string as a different candidate. It now has to end at whitespace, a quote or the end of the string.
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 395d210e17
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
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".
|
|
||
| def _at_default_scale(source: str) -> str: | ||
| """*source* with every scale-wrapped length and gain-wrapped colour read back as itself.""" | ||
| resolved = _SCALED_LENGTH.sub(r"\1", source) |
There was a problem hiding this comment.
Require spatial values to retain the spacing scale
When a scaled dimension regresses to its old literal form, this normalization makes the intended and broken forms indistinguishable to downstream assertions. For example, replacing the Images header's h-[calc(48px*var(--ui-space-scale,1))] with h-[48px] still leaves test_images_header_tracks_preview_and_preserves_titlebar_controls passing, although the header no longer follows a non-default interface font size. Require spatial contracts to verify the --ui-space-scale wrapper before comparing the normalized value.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Correct, and it is not fixable inside the reader: at the default scale a bare h-[48px] and the scaled spelling are the same 48px, which is exactly what the geometry contracts ask for, so no amount of care in the normaliser lets them tell the two apart.
I did not put a wrapper check in front of each spatial assertion, because a bare length is often right: w-[408px], rounded-[10px] and the var(--studio-*-inset, 1.5rem) fallbacks in these same files are all deliberately unscaled, so a blanket rule would be wrong. The scaling is stated directly instead, over the header bands these contracts measure, in test_the_header_band_these_contracts_measure_still_follows_the_ui_scale: the navbar's two and one each on the images, audio, video and chat pages, with a bare h-[48px] rejected outright.
Verified with your case: unwrapping the Images header band now fails that test, and the clean tree is 38 passed.
| resolved = _MIXED_TOKEN.sub( | ||
| lambda m: f"{m.group(1)}/{m.group(2)[:-2] if m.group(2).endswith('.0') else m.group(2)}", | ||
| resolved, |
There was a problem hiding this comment.
Require colors to retain their contrast gain
When a color loses its gain expression but keeps the same default percentage, _MIXED_TOKEN still rewrites it to the expected shorthand. Replacing the Images footer with border-[color-mix(in_oklab,var(--foreground)_10%,transparent)] leaves test_image_page_structural_panes_share_the_container_breakpoint passing, even though the border no longer responds to the contrast setting. Only collapse a mixed token after confirming its amount came from the appropriate --contrast-*-gain expression.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Agreed. A colour that keeps the amount but drops the gain renders the same thing at the default setting and nothing like it anywhere else, so the two are not interchangeable. _MIXED_TOKEN and the white-lift reader now match the gain-bearing spelling directly, and still only under the gain the colour's role is entitled to, so a gainless color-mix is left as written.
Verified with your case: replacing the Images footer border with border-[color-mix(in_oklab,var(--foreground)_10%,transparent)] now fails test_image_page_structural_panes_share_the_container_breakpoint.
A colour that keeps its amount but drops the gain renders the same thing at the default setting and nothing like it anywhere else, so only the gain-bearing spelling is now read back as the shorthand. A bare color-mix at 10% no longer satisfies a border-foreground/10 contract. Lengths cannot be told apart the same way: a band that has gone back to a bare h-[48px] reads as 48px, which is what the geometry contracts ask for. The scaling is stated directly instead, over the header bands those contracts measure, so unwrapping one fails here rather than passing everywhere.
A colon is not a word character, so the previous boundary let hover:h-[calc(48px*...)] answer for the fixed band, and a height that applies only under the pointer is not the band these contracts measure. Each row now carries its own variant and has to start where a class can start. The colour side had the same blind spot with no guard at all: a literal border-foreground/10 satisfies the contract that names it while no longer responding to the contrast setting, because that is exactly what the reader answers for the gain-scaled spelling. The gain is now stated directly, as the lengths are.
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: e82db1baee
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
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".
| # 7rem-based, or stopped keying off this branch, still fails. | ||
| assert re.search( | ||
| r"showSidebarSurface && !pinned\s*\?\s*" | ||
| r'"(?:7rem|max\(\s*7rem\s*,\s*7rem\s*\))"' |
There was a problem hiding this comment.
Require the titlebar slot to remain scaled
Fresh evidence after the earlier titlebar matcher fixes is that this alternative explicitly accepts a regression back to bare "7rem". At larger interface-font settings the navigation buttons' padding and gaps scale, while a bare slot remains 7rem and can overlap the drag region; replacing the current max(...) expression with "7rem" still leaves all 230 tests in these files green. Check the raw expression for the required --ui-space-scale term rather than treating the legacy literal as equivalent.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Correct, and treating the legacy literal as equivalent was my error rather than a matcher slip: the buttons' own padding and gaps still scale, so a bare 7rem slot is overrun at a larger setting and the drag region starts inside the navigation. That is a different guarantee, not a different spelling of the same one. The assertion reads the titlebar raw now and pins both terms of the max().
Verified: replacing the expression with "7rem" now fails test_expanded_titlebar_button_and_corner_match_sidebar_edge, and the clean tree is 40 passed.
| sidebar_source = APP_SIDEBAR.read_text(encoding = "utf-8") | ||
| css_source = INDEX_CSS.read_text(encoding = "utf-8") | ||
| sidebar_source = _ui_source(APP_SIDEBAR) | ||
| css_source = _ui_source(INDEX_CSS) |
There was a problem hiding this comment.
Preserve scale wrappers in the sidebar geometry check
Fresh evidence after adding the scaled-length table is that the sidebar action geometry is not included in that guard: reading INDEX_CSS through _ui_source makes right: calc(1.875rem * var(--ui-space-scale, 1)) and padding-right: calc(0.125rem * ...) indistinguishable from bare rem values. I replaced both declarations with bare values and all 230 tests still passed; at the minimum interface-font setting the Tailwind gutter shrinks with --spacing while these action dimensions remain fixed, invalidating the reach calculation and potentially placing the pin over the title. Read these declarations raw or explicitly require their scale wrappers before normalizing them.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Agreed, and the stylesheet needed the same statement the class tokens got. The pin's offset and padding are compared against a Tailwind gutter that follows --spacing, so unwrapping either one drifts from the gutter at every setting but the default, while the reach arithmetic that decides whether the pin can overlap the title carries on against a number the UI no longer renders.
Both declarations are now pinned raw in test_the_sidebar_action_geometry_still_follows_the_ui_scale, with the bare spelling rejected. Verified with your own substitution: right: 1.875rem and padding-right: 0.125rem each fail, and the clean tree is 40 passed.
The titlebar assertion accepted a bare 7rem as equal to the scaled max(), and it is not the same guarantee: the navigation buttons' padding and gaps still scale, so a fixed slot is overrun at a larger setting and the drag region starts inside the navigation. It is read raw now, with both terms pinned. index.css needed the same statement. The pin's offset and padding are compared against a Tailwind gutter that follows --spacing, so unwrapping either one drifts from the gutter at every setting but the default, while the reach arithmetic that decides whether the pin can overlap the title carries on against a number the UI no longer renders.
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: b7b24d0b4b
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
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".
| _CLASS_STARTS | ||
| + re.escape(f"{variant}{utility}-[calc({length}*var(--ui-space-scale,1))]"), | ||
| source, |
There was a problem hiding this comment.
Require scaled utilities to end at a token boundary
When a scaled utility acquires a suffix, this count still accepts it because the regex stops at the closing bracket. For example, changing both Navbar heights to h-[calc(48px*var(--ui-space-scale,1))]:broken leaves all 40 contracts in this file green: normalization still exposes the h-[48px] substrings used downstream, while Tailwind treats the colon-delimited token as a different/invalid candidate and the titlebar bands lose their fixed height. Require a class-token boundary after the scaled utility, as well as before it.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Right, I anchored the start and left the end open, which is the same mistake the notes class had one round earlier. Both pins now require the class to end where the match does, the lengths and the colours alike.
Verified with your case: suffixing both navbar bands as h-[calc(48px*var(--ui-space-scale,1))]:broken now fails test_the_lengths_these_contracts_measure_still_follow_the_ui_scale, and the same suffix on the Images footer border fails the colour pin. The clean tree is 40 passed.
A trailing :broken is not a suffix on the utility, it is a different candidate: Tailwind emits nothing for it and the band loses its fixed height, while the normalised source still shows the length this file asks about and every contract downstream stays green. Both pins now require the class to end where the match does.
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 55bc64a61a
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
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".
| source = CHAT_PAGE.read_text(encoding = "utf-8") | ||
| provider = APP_PROVIDER.read_text(encoding = "utf-8") | ||
| source = _ui_source(CHAT_PAGE) | ||
| provider = _ui_source(APP_PROVIDER) |
There was a problem hiding this comment.
Preserve scale wrappers in platform chat geometry
Fresh evidence beyond the added pane and sidebar guards is that the platform chat-header variables are still normalized before this arithmetic check: replacing MAC_NATIVE_CHROME_STYLE's scaled --studio-chat-header-height with bare "44px" leaves all 40 tests in this file green, because _ui_source also reduces the still-scaled padding and control height to 9px and 33px. At a UI scale above 1, those two values grow while the header remains fixed, so their sum can exceed 44px and clip the shared titlebar row. Read these provider values raw or explicitly guard all four platform chat-geometry variables for the required scale wrapper.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Confirmed, and there is a second hole behind that one worth naming: these variables are written out once per platform chrome, and the existing frontend guard in ui-font-size-scales-spacing.test.ts matches only the first declaration of each name, so it reads one chrome and answers for both. The new guard checks every declaration of all three.
Verified across both blocks: --studio-chat-header-height back to a bare "44px" on the mac chrome fails, the same on the other chrome's "48px" fails, and --studio-chat-control-height back to "33px" fails. The clean tree is 41 passed.
The header height, its padding and the control height are written out once per platform chrome, and the contracts that do arithmetic on them read the provider normalised. A height back on a bare 44px reads as 44px, which is what the arithmetic wants, while the padding and control beside it still scale: above the default they grow and it does not, their sum passes the header, and the shared titlebar row is clipped. Checked over every declaration rather than the first match, since the existing frontend guard stops at one and so answers for one platform while reading another.
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 8538f189dc
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
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".
| # | ||
| # The variant is part of the claim, so each row carries its own. `h-[...]` and | ||
| # `hover:h-[...]` are different guarantees, and the second one is not a fixed band at all. | ||
| _LENGTHS_THAT_MUST_KEEP_THE_SCALE = ( |
There was a problem hiding this comment.
Pin the scaled sidebar-row geometry
Fresh evidence after the pane-offset guards is that this table still omits the dimensions asserted by test_chat_sidebar_rows_are_compact_without_vertical_padding: replacing the live row's h-[calc(30px*var(--ui-space-scale,1))] with bare h-[30px] leaves all 41 tests in this file green because _ui_source makes both spellings identical. At a larger interface-font setting the row then stays fixed while its text grows, risking clipping; add raw-source guards for the sidebar row height and the other normalized row dimensions (gap-[8.5px] and pl-[39px]) that this contract measures.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Correct, and these are the clearest case of the lot: a row height, a gap and an indent that are hand-set one-off lengths, which is precisely the spacing that used to stay put while the labels grew. Added all three to the table, with their counts, so unwrapping any one of them fails.
Verified each in turn: h-[30px], gap-[8.5px] and pl-[39px] each fail test_the_lengths_these_contracts_measure_still_follow_the_ui_scale, and the clean tree is 41 passed.
The row height, the pinned gap and the project indent are hand-set one-off lengths, which is exactly the spacing that used to stay put while the labels grew. Normalised they read the same either way, so the compact row contract could not see one being unwrapped and the row would clip its own text at a larger setting.
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 6a207f7f06
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
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".
| (IMAGES_PAGE, "", "h", "48px", 1), | ||
| (AUDIO_PAGE, "", "h", "48px", 1), | ||
| (VIDEO_PAGE, "", "h", "48px", 1), |
There was a problem hiding this comment.
Pin the scaled 34px media control heights
Fresh evidence after the new length table is that the normalized 34px media controls remain unguarded: replacing the Images header's !h-[calc(34px*var(--ui-space-scale,1))] with bare !h-[34px] leaves all 232 contracts in these files green because _ui_source makes both spellings identical. At a non-default interface font size, that pill control then stays fixed while its text and surrounding 48px header grow; add the Images and Audio 34px control heights to the raw-source scale guard.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Agreed. The band around these pills scales and so does their own text, so a control left fixed is the one thing in the row that does not move, and it crowds out its label.
Pinned on the images, audio and video pages in all three spellings those pages use, since each is a separate token: plain h-, !h- and [&>button]:h-. Verified each one: unwrapping the bang control, the plain control, the button-variant control, and the video page's pair each fail test_the_lengths_these_contracts_measure_still_follow_the_ui_scale, and the clean tree is 41 passed.
The band around these pills scales and so does their own text, so a control left fixed is the one thing in that row that does not move and it crowds out its label. The pages write the height three ways, plain, with a bang and through a button variant, and each needed its own row.
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 8d17755d92
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
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".
| stated = re.findall(rf'"{re.escape(name)}":\s*"([^"]+)"', source) | ||
| assert stated, f"{name} is gone from the provider" |
There was a problem hiding this comment.
Check chat geometry within each platform style block
Fresh evidence after the prior first-declaration fix is that this still searches the provider globally rather than requiring every chrome block to contain each variable: removing all three declarations from CUSTOM_CHROME_STYLE leaves the full 41-test file green because the matching declarations in MAC_NATIVE_CHROME_STYLE satisfy stated. In that scenario custom-titlebar users fall back to the root geometry instead of receiving the platform-specific 9px padding and related sizing, so group the declarations by style block and assert each applicable block contains all three scaled values.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Correct, and the distinction matters because the chromes are alternatives: one of them stating a declaration says nothing about the other. The guard now pulls each *_CHROME_STYLE block out of the provider and asks that block for all three variables, rather than searching the file.
Verified with your case: removing all three from CUSTOM_CHROME_STYLE now fails, and so does unwrapping only that block's --studio-chat-header-padding-top while the mac block keeps its scaled copy. The clean tree is 41 passed.
The chromes are alternatives, so one of them stating a declaration says nothing about the other. Dropping all three from the custom chrome left its users on the root geometry rather than the padding and control height that row is laid out against, while the mac block's copies answered for it in a global search. The variables are now read out of each block.
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 415745a30f
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
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".
| single 34 in the codebase, so read it from there rather than repeating it here. | ||
| """ | ||
| source = INTERFACE_SCALE_RUNTIME.read_text(encoding = "utf-8") | ||
| source = _ui_source(INTERFACE_SCALE_RUNTIME) |
There was a problem hiding this comment.
Read native titlebar constants without UI normalization
Fresh evidence beyond the fixed-sheet guard is that _scale_constants() still normalizes the runtime file: replacing NATIVE_MAC_TITLEBAR_HEIGHT_VAR with calc(34px * var(--ui-space-scale, 1)) leaves all 41 desktop contracts green because this call collapses it to 34px. On macOS that constant must instead retain --studio-native-titlebar-height, whose value is divided by webview zoom; otherwise the CSS titlebar geometry scales while the native chrome does not. Read this fixed-chrome source raw, as the provider mirror now is.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Correct, and it belongs with the window chrome rather than with the scaled geometry: the mac titlebar is 34px because the OS decoration is, and interface-scale-runtime.ts divides it by the webview zoom rather than scaling it with the interface font. _scale_constants reads that file through _window_chrome_source now, the same helper the provider mirror uses.
Verified with your substitution: respelling NATIVE_MAC_TITLEBAR_HEIGHT_VAR as calc(34px * var(--ui-space-scale, 1)) now fails test_tauri_collapse_removes_the_icon_rail_but_web_keeps_it, and the clean tree is 41 passed.
| titlebar = TITLEBAR.read_text(encoding = "utf-8") | ||
| chat_page = CHAT_PAGE.read_text(encoding = "utf-8") | ||
| titlebar = _ui_source(TITLEBAR) | ||
| chat_page = _ui_source(CHAT_PAGE) |
There was a problem hiding this comment.
Pin the scaled collapsed-chat control size
When the collapsed desktop New Chat control is changed from !size-[calc(30px*var(--ui-space-scale,1))] to bare !size-[30px], all 41 contracts still pass because _ui_source(CHAT_PAGE) makes both spellings satisfy the assertion below. At a non-default interface-font size this button remains fixed while the surrounding chat header and controls grow, so add this !size utility to the raw-source scale guard rather than checking only its normalized value.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Agreed. That header grows with the setting, so a control left fixed shrinks against its own row. Pinned both spellings the chat page uses, the collapsed New Chat button's !size- and the three plain size- controls.
Verified each: unwrapping the collapsed button to !size-[30px] fails, and unwrapping one of the plain controls to size-[30px] fails. The clean tree is 41 passed.
…ontrols The mac titlebar is 34px because the OS decoration is, and the runtime divides it by the webview zoom rather than scaling it with the interface font. Read normalised, a constant respelled onto the spacing scale collapsed back to 34px and every chrome contract agreed with itself while the CSS moved off the native chrome it sits against. The chat page's 30px round controls, the collapsed New Chat button among them, sit in a header that grows with the setting, so one left fixed shrinks against its own row. Both spellings pinned.
|
@codex review |
|
Codex Review: Didn't find any major issues. Already looking forward to the next diff. 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". |
…tten against (unslothai#11505) * Read the scaled lengths and colours the UI contracts were written against Repo tests (CPU, studio) is red on main: 12 tests across test_desktop_reliability_frontend_contract.py and test_update_release_notes.py. Bisected to two UI PRs that each merged with this lane already failing: 42fc28f (before both) 228 passed, 0 failed 3bc5eb5 (unslothai#11459) 2 failed 10c380e (unslothai#11458) 12 failed Both PRs are right, and neither changes what renders. unslothai#11458 made spacing follow the UI font size by wrapping fixed lengths as calc(X * var(--ui-space-scale, 1)), where the scale is calc(--ui-font-scale / 0.9375) and --ui-font-scale defaults to 0.9375, so the scale is 1 and every length is what it was. unslothai#11459 did the same for colour, respelling foreground/10 as a color-mix scaled by --contrast-edge-gain and white/[0.06] as an rgb() scaled by --contrast-wash-gain, both defaulting to 1. So only the spelling moved, and these contracts are written against the values. They now read through _at_default_scale, which resolves calc(X * var(--s, 1)) to X, a color-mix of a token at N% with transparent to token/N, and an rgb() white at alpha A to white/[A]. Those are the same values written out, so a contract keeps asking what it asked before. Two assertions needed more than the reader. The titlebar slot became max(7rem, calc(7rem * var(--ui-space-scale, 1))), a floor so it never shrinks under the three 30px buttons, and prettier wrapped the ternary over three lines, so that one matches across whitespace and against the 7rem rather than one exact expression. The notes surface reads the white and the 0.06 rather than the shorthand. Worth recording for the sidebar guard: unslothai#11458 scaled the pin's own offset and padding as well as --spacing, so both sides of that geometry scale together and the arithmetic in spacing units stays exact at every scale, not just the default. Verified: 228 passed across the two files, which is what main had before unslothai#11459. Sabotage checks through the new spellings, so the reader cannot be hiding a real change: moving the pin's right offset from 1.875rem to 3.5rem fails the coarse-pointer guard, and moving the image footer border from 10% to 40% fails the image page contract. * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Close the two holes in the new readers Both matches stopped short of what they claimed. The alpha regex ended at --contrast-wash-gain, so a misspelled variable such as --contrast-wash-gain-broken, or trailing arithmetic like +0.5, satisfied an assertion about a 0.06 white lift that no longer renders. It now matches through the fallback and both closing brackets. The titlebar match looked for 7rem as an unbounded substring, so 17rem and 0.7rem passed a contract about a 7rem floor. The numeric token now has boundaries on both sides. Verified: 228 passed still, and each case the review named now fails where it passed before - 17rem fails the titlebar contract, --contrast-wash-gain-broken fails the notes surface. * Read the clipboard payload at the default scale too The one frontend source in this file still read raw. It passes either way today, but a scaled length landing in it would be invisible to the contract for the same reason every other read goes through _ui_source. * Pin both terms of the titlebar max, not one 7rem anywhere in it Boundaries on the number were still not enough. The regex only needed one standalone 7rem somewhere in the value, so max(7rem, calc(17rem * var(--ui-space-scale, 1))) normalises to max(7rem, 17rem), satisfies the match on its first term, and renders a 17rem slot while the contract says 7rem. The whole value is pinned now: either a bare 7rem or a max of 7rem with itself, and nothing else. Verified both ways round, since one term passing is exactly what went wrong: 17rem in the scaled operand fails, and 17rem in the floor fails. 37 passed. * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Normalize only the four scales, over the values they are defined for Reading `var(--anything, 1)` collapsed a length hung off an unrelated property, or off a typo like `--ui-spcae-scale`, back to the literal the contract asks about, so a pane that had stopped following the interface font size still satisfied its guard. Lengths now resolve only through --ui-space-scale / --ui-font-scale and colour amounts only through --contrast-wash-gain / --contrast-edge-gain. * Read the spacing scale only, and each gain only for its own role --ui-font-scale is 0.9375, not 1, so a length respelled onto it renders smaller than the literal a contract asks about; only --ui-space-scale, derived as the ratio of the two, is identity by default. The contrast gains are identity at rest but not interchangeable: the appearance store gives the edge and the wash different spans, so a border scaled by the wash renders a colour its contract does not name off default. Surfaces now resolve under the wash, borders and rings under the edge. The release notes lift also has to end where the class ends: a trailing -broken names no utility and a /50 is a different lift, and a match that stopped at the closing bracket accepted both. * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Read window chrome raw, and end the notes class at a real boundary The custom titlebar is 34px because the Tauri decoration is 34px, and nothing about the interface font size moves it. Reading that mirror through the scale normaliser accepted a scaled spelling as 34px while the real titlebar stayed put and the portalled sheets slid off it, so the chrome is now read exactly as written. The notes lift excluded selected suffix characters rather than requiring the class to end: a colon still passed, and Tailwind reads the whole colon-delimited string as a different candidate. It now has to end at whitespace, a quote or the end of the string. * Require the gain and state the scaling the geometry contracts assume A colour that keeps its amount but drops the gain renders the same thing at the default setting and nothing like it anywhere else, so only the gain-bearing spelling is now read back as the shorthand. A bare color-mix at 10% no longer satisfies a border-foreground/10 contract. Lengths cannot be told apart the same way: a band that has gone back to a bare h-[48px] reads as 48px, which is what the geometry contracts ask for. The scaling is stated directly instead, over the header bands those contracts measure, so unwrapping one fails here rather than passing everywhere. * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Anchor the notes class at both ends and pin the rest of the scaled offsets A hover: in front of the notes lift paints it only under the pointer, and the match happily started in the middle of that class. It now has to start at a class boundary as well as end at one. The scaling pin covered the header band only, so the pane offsets those same contracts measure could still be unwrapped unseen: the images and audio 60px preview insets and the training rail's 42px. The table is now keyed on the utility and the length, and every row rejects the bare spelling. * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Count whole utilities, not substrings of them h is a substring of min-h, so a band respelled as min-h-[calc(48px*...)] kept the count and the normalised reads alike, while the band it names is no longer fixed and can grow past the titlebar geometry these contracts measure. Both halves of the pin now require a class-token boundary in front of the utility. * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Carry each row's variant, and pin the gain the colour contracts read A colon is not a word character, so the previous boundary let hover:h-[calc(48px*...)] answer for the fixed band, and a height that applies only under the pointer is not the band these contracts measure. Each row now carries its own variant and has to start where a class can start. The colour side had the same blind spot with no guard at all: a literal border-foreground/10 satisfies the contract that names it while no longer responding to the contrast setting, because that is exactly what the reader answers for the gain-scaled spelling. The gain is now stated directly, as the lengths are. * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Pin the titlebar slot and the pin's own geometry to the scale The titlebar assertion accepted a bare 7rem as equal to the scaled max(), and it is not the same guarantee: the navigation buttons' padding and gaps still scale, so a fixed slot is overrun at a larger setting and the drag region starts inside the navigation. It is read raw now, with both terms pinned. index.css needed the same statement. The pin's offset and padding are compared against a Tailwind gutter that follows --spacing, so unwrapping either one drifts from the gutter at every setting but the default, while the reach arithmetic that decides whether the pin can overlap the title carries on against a number the UI no longer renders. * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * End the pinned utilities at a class boundary as well as start them there A trailing :broken is not a suffix on the utility, it is a different candidate: Tailwind emits nothing for it and the band loses its fixed height, while the normalised source still shows the length this file asks about and every contract downstream stays green. Both pins now require the class to end where the match does. * Guard every platform's chat header geometry, not the first one stated The header height, its padding and the control height are written out once per platform chrome, and the contracts that do arithmetic on them read the provider normalised. A height back on a bare 44px reads as 44px, which is what the arithmetic wants, while the padding and control beside it still scale: above the default they grow and it does not, their sum passes the header, and the shared titlebar row is clipped. Checked over every declaration rather than the first match, since the existing frontend guard stops at one and so answers for one platform while reading another. * Pin the sidebar row geometry the compact-row contract measures The row height, the pinned gap and the project indent are hand-set one-off lengths, which is exactly the spacing that used to stay put while the labels grew. Normalised they read the same either way, so the compact row contract could not see one being unwrapped and the row would clip its own text at a larger setting. * Pin the 34px media controls, in all three spellings the pages use The band around these pills scales and so does their own text, so a control left fixed is the one thing in that row that does not move and it crowds out its label. The pages write the height three ways, plain, with a bang and through a button variant, and each needed its own row. * Ask each chrome for its own chat geometry, not the file as a whole The chromes are alternatives, so one of them stating a declaration says nothing about the other. Dropping all three from the custom chrome left its users on the root geometry rather than the padding and control height that row is laid out against, while the mac block's copies answered for it in a global search. The variables are now read out of each block. * Read the native chrome constants raw, and pin the chat page's round controls The mac titlebar is 34px because the OS decoration is, and the runtime divides it by the webview zoom rather than scaling it with the interface font. Read normalised, a constant respelled onto the spacing scale collapsed back to 34px and every chrome contract agreed with itself while the CSS moved off the native chrome it sits against. The chat page's 30px round controls, the collapsed New Chat button among them, sit in a header that grows with the setting, so one left fixed shrinks against its own row. Both spellings pinned. --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
What
Repo tests (CPU, studio)is red on main: 12 tests acrosstest_desktop_reliability_frontend_contract.pyandtest_update_release_notes.py.Bisected to two UI PRs that each merged with this lane already failing:
42fc28f8d(before both)3bc5eb53d(#11459)10c380e92(#11458)Both PRs are right
Neither changes what renders.
calc(X * var(--ui-space-scale, 1)). The scale iscalc(var(--ui-font-scale, 1) / 0.9375)and--ui-font-scaledefaults to0.9375, so the scale is 1 and every length is exactly what it was.foreground/10became acolor-mixscaled by--contrast-edge-gain, andwhite/[0.06]anrgb()scaled by--contrast-wash-gain, both defaulting to 1.Only the spelling moved, and these contracts are written against the values.
The change
The contracts now read their sources through
_at_default_scale, which resolves:calc(X * var(--scale, 1))toXcolor-mixof a token atN%with transparent totoken/Nrgb()white at alphaAtowhite/[A]Those are the same values written out, so each contract keeps asking exactly what it asked before.
Two assertions needed more than the reader:
max(7rem, calc(7rem * var(--ui-space-scale, 1))), a floor so it never shrinks under the three 30px buttons, and prettier wrapped the ternary over three lines. That one now matches across whitespace and against the7rem, not one exact expression.0.06rather than the shorthand.Worth recording for the sidebar guard: #11458 scaled the pin's own offset and padding as well as
--spacing, so both sides of that geometry scale together and the arithmetic in spacing units stays exact at every scale, not only the default.Test-only. No product file is touched.
Verification
1.875remto3.5remfails the coarse-pointer guard;10%to40%fails the image page contract.