Repository navigation
Studio: scale spacing with the UI font size - #11458
Conversation
UI font size only moved text. Padding, gaps and row heights stayed put, so a 20px label sat in a row padded for 12px and the sidebar in particular read as cramped. Add --ui-space-scale, normalised at the 15px default, and drive Tailwind's --spacing step from it so every p-*, m-*, gap-*, space-* and size-* utility follows the preference. The hand-authored padding in index.css and hub.css, the arbitrary p-[..]/gap-[..] utilities in components, control heights, and the chat header/control chrome go through the same multiplier. OS geometry stays pinned: traffic light insets, desktop title bar height, hairline borders.
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. |
Review catches, all cases where a scaled value had an unscaled twin: - Token activity grid: the gap is measured by CELL_GAP/COLUMN_WIDTH in JS and the cells are a fixed 11px, so pin the gap back. Scaled, it overran the fitter and clipped the newest columns. - Nested code blocks and the narrow welcome box: scale the width and max-width compensation along with the negative margin it cancels. - Custom titlebar: the band is fixed OS chrome, so the sidebar trigger stays 34px there and only scales in the header that scales with it. - On-device variant rows and the dropdown menu: scale the width offsets that cancel their scaled mx-2 and 3px centring.
|
Good catches, all three were real. Every one is the same defect: a value I scaled whose paired value stayed fixed. Fixed in Token activity grid. The cells are a fixed Nested code blocks. Custom titlebar trigger. The band is a fixed 34px of OS chrome, so the trigger stays 34px there and only scales in the 48px header that scales with it. Two more of the same shape that were not flagged:
The narrow welcome box got the same treatment as the code block. Verified the emitted CSS rather than assuming Tailwind kept the operators intact. |
|
@codex review |
Conflict in projects-page.tsx only: #11443 rewrote that section and dropped pr-5 from the chat list. Kept its layout, kept the scaled pl-[76px].
Three lengths live in JS or in reserved chrome, so --ui-space-scale never reached them: the catalog virtualizer's row slot, the Hub carousel's card slot, and the titlebar's reserved width for its navigation cluster. At the 20px setting a catalog row measures 76px in a 57px slot, a model card 134px in a 128px slot, and the titlebar cluster 147px in a 112px slot, where the drag region then covers the forward button. Each slot now takes the same scale as the content it holds, via useUiSpaceScale for the JS ones.
|
Fixed the three slot findings. Each one is a length that lives outside CSS, so
The pinned grid in the Hub lists lays the same rows out by hand, so it takes the scale as well rather than drifting from the virtualized ones. New tests pin all of it. |
|
@codex review |
The slider's fill ended at a hardcoded 16px thumb, but the thumb is size-4 and follows the UI font size: at 20px it is 21.3px, so the fill missed the thumb centre by up to 2.7px near an endpoint. It now measures the thumb, which also covers .panel-slider resizing it. The Hub skeleton list divided the pane by a fixed 56px row while the row scales: 41.6px at 12px and 69.3px at 20px. A 600px pane drew 11 rows either way, against 14 and 8 that fit.
The carousel's gap-4 and pt-2 scale with the UI font size, like the cards they space, but the arrow stepped by a fixed 16px and centred itself on a fixed 8px top padding. Measured, the gap is 12.8 / 16 / 21.3px and the padding 6.4 / 8 / 10.7px at the 12 / 15 / 20px settings, so at 20px each arrow click landed 5.3px short of the next card.
|
Three more, all verified against the rendered geometry.
Also merged main. The one conflict was in |
|
@codex review |
The editor box pins the input to its own height, so the scaled min-height never applied: a row that needs 51.3px at the 20px setting was held in a fixed 40px box and the placeholder clipped, while at 12px the empty composer carried 9px of dead height. All three 40px clamps and the JS floor now take the scale, measuring 32 / 40 / 53.3px against rows that need 30.8 / 38.5 / 51.3px.
|
Right, and the clamp that matters is the editor box, not the input. Measured, one row needs 30.8px at the 12px setting, 38.5px at 15px and 51.3px at 20px. The box was a fixed 40px at all three, so the 20px placeholder was clipped by 11px and the 12px empty composer carried 9px of dead height. All three 40px clamps now take the scale, along with the JS floor in |
|
@codex review |
The window chrome band stays 34px at every UI size and clips nothing, so scaling these controls pushed them out of it: at the 20px setting the navigation buttons measured 40px, hanging 3px over the page and taking clicks there, and the window buttons 34.7px. Both are pinned again. The padding and gaps around them still scale, so the reserved slot stays scaled: the cluster measures 116.7px in a 149.3px slot, where the old fixed 112px would not hold it.
|
Right, and the window buttons had the same problem. Measured in a 34px band at the 20px setting, the navigation buttons rendered at 40px, 3px over each edge, and the band clips nothing while the buttons are pointer-events-auto, so that lower strip sat on the page and took its clicks. The window controls came out at 34.7px. Both are pinned to their authored sizes again, like the mobile trigger already was in the custom titlebar. The padding and gaps around them still scale, which is why the reserved slot stays scaled: the cluster measures 116.7px at the 20px setting, so the old fixed 7rem would have left the drag region on top of the last button. With the controls fixed, the right-hand inset goes back to a flat 112px, against an 88.7px cluster. |
|
@codex review |
|
Good catch on the artifact panel. The shell carries mb-8, which scales with the UI size, while the inline style kept marginTop: 90px and height: calc(100% - 122px). The 122 is 90 + 32, so once the 32 grew the equation stopped balancing. Both offsets now go through the same scale: marginTop: calc(90px * var(--ui-space-scale, 1) + var(--studio-chat-notice-height, 0px)) Measured against an 800px pane: 12px setting 72 + 702.4 + 25.6 = 800, 15px 90 + 678 + 32 = 800, 20px 120 + 637.33 + 42.67 = 800. Before the fix the 20px case came to 810.67, the 10.7px of clipping you described. The top clearance also stays in step with --studio-chat-header-height, which is calc(48px * var(--ui-space-scale, 1)). New test in tests/ui-font-size-scales-spacing.test.ts pins both offsets, the mb-8, and the 90 + 32 = 122 identity. It fails if either offset goes back to a bare pixel value. @codex review |
|
Right on both counts. The 90px is measured from the top of the chat content box, and on the custom titlebar that box starts with the fixed 34px --studio-content-top-inset, so multiplying the whole 90 moved a band that is window chrome. The inset now comes out before the scaling and goes back in after: marginTop: calc(var(--studio-content-top-inset, 0px) + (90px - var(--studio-content-top-inset, 0px)) * var(--ui-space-scale, 1) + var(--studio-chat-notice-height, 0px)) Measured with the header in place, at the 12/15/20px settings, gap being panel top minus header bottom:
Every one is the default gap times the scale, and at the 15px default all three land on 90 exactly, so nothing shipped moves. Total footprint against an 800px pane is 800 in all nine cases. The test now pins the composed form rather than the flat multiply. @codex review |
|
Agreed, that one was mine to undo. em is against the element's own font size, which already moves with the preference, so the multiplier applied it twice. Measured on the span these sit in, text-ui-10, at the 12/15/20px settings: font size 7.5 / 9.375 / 12.5px, so a plain 0.1em is 0.75 / 0.9375 / 1.25px on its own. With the multiplier it came out 0.6 / 0.9375 / 1.667px, the drift you describe at the top of the range. Both spans are back to mx-[-0.1em] and ml-[0.14em], the only change to that file now reverted. Swept the rest of the branch for the same shape and these two were the only em lengths carrying the scale. rem is a different case and stays: the root font size stays 16px at every setting, measured at all three, so rem lengths need the multiplier to move at all. The suite gained a sweep for a scaled em anywhere in src, which reports the file if one comes back. @codex review |
|
Fixed, though the reasoning needs one correction: the scroller's observed box does change, in height. The cards carry an explicit width and height, so the scroller's content box grows vertically as well as horizontally. Measured in a browser with a ResizeObserver on the same structure: changing both child dimensions fires the observer once (scrollWidth 1320 to 1728), changing width alone fires it zero times (scrollWidth 1320 to 1074). Every UI size step moves both, 204x128 at the default and 163x102 to 272x171 across 12px to 20px, so the observer does fire and the arrows are correct at all nine settings today. That is a coincidence of the card's aspect, not a guarantee, and the dependency is real either way, so the arrow effect now lists it: }, [updateArrows, items, itemWidth, itemHeight, gapPx]); Pinned in tests/ui-font-size-scales-spacing.test.ts, verified to fail with the old dep list. @codex review |
|
Correct, and reproduced. Measured clientHeight of the real field markup at the 12/15/20px settings:
So at 20px an untouched field is 46 against the fixed 44 and every category, subcategory and tool-profile field renders as the squircle. 46 rather than 48 because clientHeight is the padding box, inside the 1px border. The cutoff now takes the same scale as the box it measures: setIsWrapped(element.clientHeight > 44 * uiSpaceScale); with uiSpaceScale in the effect deps so a size change re-runs it. Cutoffs become 35.2 / 44 / 58.67, which classify all three states correctly at all three settings, and 44 at the default is what shipped. Swept the tree for the same shape, a fixed pixel count compared against a measured box. This was the only one. The rest are scroll-distance slop (near-bottom 24/40, prefetch 400, 1px epsilons), which are proximity margins rather than one-line geometry. Guard added to tests/ui-font-size-scales-spacing.test.ts, verified to fail with the bare 44. @codex review |
|
Codex Review: Didn't find any major issues. Breezy! 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". |
Resolves against the contrast slider work in #11459 and the UI spacing scale in #11458. The slider moved surfaces, hovers and lines onto --*-base tokens that a contrast mix derives from, so the new dark values are authored as -base and the slider reaches all of them. The washes on hub.css controls and the picker chips keep upstream's calc(N% * var(--contrast-wash-gain)) form with our percentages. Took upstream's version for the Hub card hover and hero panel: both were hardcoded before, and making them contrast aware solves that better than pointing them at a token, which is all our side did there. Kept ours for the model picker tier consolidation, the composer pills and the settings dialog close button, with upstream's --ui-space-scale sizing and wash syntax folded in.
…ze (unslothai#11510) * Let the update card floor itself instead of guessing its height At the 20px interface size the update card clipped its own Copy command button away on short viewports, and sliced Remind me later in half on wider ones. The card's floor was written out as min-h-[calc(109px+80px*var(--ui-font-scale,1))], which came to 209px at that setting while the content needed about 301px, so the action row overflowed and the surface's overflow-hidden cut it. The constant was calibrated when only type scaled. unslothai#11458 made spacing follow the interface font size too, so the same content is now taller than the formula predicts and re-tuning the number only moves the size at which it fails again. The surface declared min-h-0 and overflow-hidden, and each of those sets its automatic minimum size to zero, which is why a floor had to be written by hand in the first place. Dropping both lets the surface floor itself at header + notes + actions. The notes panel already carries min-h-0, flex-1 and its own clipping, so it remains the only part that yields, which is what the card intends. The layout probe only failed when a control was clipped to nothing, so the 921x534 case, where the two buttons were cut from 47.7px to 41.8px, passed all along. It now compares each control against its unclipped box, which takes the check from 2 failures to 7 on the current card and to none with this change. * State the browser card's floor as its content, in the contracts too The contracts named the mechanism, so they failed on the fix rather than on the defect: one required min-h-0 and overflow-hidden on the surface, another required a written-out min-h floor, and a third required that floor to be gated on the notes panel. Each now states what it is for. The no-scroll claim is asserted as the absence of a scrolling overflow rather than the presence of overflow-hidden, since those are different claims and reading one as the other is what tied the contract to the old spelling. The floor claim is asserted as the surface declaring neither of the two things that zero a flex item's automatic minimum size. The desktop card is unchanged and keeps its written floor, so its rows keep the assertions they had. Verified in both directions: putting either min-h-0 or overflow-hidden back on the browser surface fails three node contracts and two Python ones, and a clean tree passes 20 node contracts and 190 Python ones. * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
* Studio: scale spacing with the UI font size UI font size only moved text. Padding, gaps and row heights stayed put, so a 20px label sat in a row padded for 12px and the sidebar in particular read as cramped. Add --ui-space-scale, normalised at the 15px default, and drive Tailwind's --spacing step from it so every p-*, m-*, gap-*, space-* and size-* utility follows the preference. The hand-authored padding in index.css and hub.css, the arbitrary p-[..]/gap-[..] utilities in components, control heights, and the chat header/control chrome go through the same multiplier. OS geometry stays pinned: traffic light insets, desktop title bar height, hairline borders. * Studio: fix spacing pairs the scale broke Review catches, all cases where a scaled value had an unscaled twin: - Token activity grid: the gap is measured by CELL_GAP/COLUMN_WIDTH in JS and the cells are a fixed 11px, so pin the gap back. Scaled, it overran the fitter and clipped the newest columns. - Nested code blocks and the narrow welcome box: scale the width and max-width compensation along with the negative margin it cancels. - Custom titlebar: the band is fixed OS chrome, so the sidebar trigger stays 34px there and only scales in the header that scales with it. - On-device variant rows and the dropdown menu: scale the width offsets that cancel their scaled mx-2 and 3px centring. * Studio: scale the fixed slots that hold scaled rows Three lengths live in JS or in reserved chrome, so --ui-space-scale never reached them: the catalog virtualizer's row slot, the Hub carousel's card slot, and the titlebar's reserved width for its navigation cluster. At the 20px setting a catalog row measures 76px in a 57px slot, a model card 134px in a 128px slot, and the titlebar cluster 147px in a 112px slot, where the drag region then covers the forward button. Each slot now takes the same scale as the content it holds, via useUiSpaceScale for the JS ones. * Studio: measure the slider thumb and the skeleton row The slider's fill ended at a hardcoded 16px thumb, but the thumb is size-4 and follows the UI font size: at 20px it is 21.3px, so the fill missed the thumb centre by up to 2.7px near an endpoint. It now measures the thumb, which also covers .panel-slider resizing it. The Hub skeleton list divided the pane by a fixed 56px row while the row scales: 41.6px at 12px and 69.3px at 20px. A 600px pane drew 11 rows either way, against 14 and 8 that fit. * Studio: scale the Hub carousel stride with its rendered gap The carousel's gap-4 and pt-2 scale with the UI font size, like the cards they space, but the arrow stepped by a fixed 16px and centred itself on a fixed 8px top padding. Measured, the gap is 12.8 / 16 / 21.3px and the padding 6.4 / 8 / 10.7px at the 12 / 15 / 20px settings, so at 20px each arrow click landed 5.3px short of the next card. * Studio: scale the composer's one-row clamp The editor box pins the input to its own height, so the scaled min-height never applied: a row that needs 51.3px at the 20px setting was held in a fixed 40px box and the placeholder clipped, while at 12px the empty composer carried 9px of dead height. All three 40px clamps and the JS floor now take the scale, measuring 32 / 40 / 53.3px against rows that need 30.8 / 38.5 / 51.3px. * Studio: keep the titlebar controls inside the fixed band The window chrome band stays 34px at every UI size and clips nothing, so scaling these controls pushed them out of it: at the 20px setting the navigation buttons measured 40px, hanging 3px over the page and taking clicks there, and the window buttons 34.7px. Both are pinned again. The padding and gaps around them still scale, so the reserved slot stays scaled: the cluster measures 116.7px in a 149.3px slot, where the old fixed 112px would not hold it. * Studio: move toasts below the scaled page header The chat, images and video header is 48px times the scale, but the toast offset stayed at 52px, so at the 20px setting a notification opened 12px inside a 64px header and covered its controls. The header offset takes the scale, clearing 64px by 5px, while the titlebar band it is added to stays fixed. * Studio: give the pinned grid the same gutter as the rows below it VirtualRows scales its lane gutter with the UI font size; the pinned block above it kept a literal 12px, so at the 20px setting the pinned cards sat on a 12px gutter and the rows underneath on 16px, stepping the card widths where the two meet. Both now read one exported constant and scale it the same way. * Studio: cap the overlays that now scale with the UI --spacing drives w-* as well, so a w-72 popover measures 384px at the 20px setting and a w-80 one 427px, past a 375px phone with nothing to stop them. The popover, menu and select surfaces cap at the viewport less 32px, the cap the menu's own sub-surface already used, and the comment on --spacing says widths are in scope. * Studio: keep the spacing comment from ending itself Writing the utility names with a slash put a comment terminator inside the prose, so the rest of the sentence and the --spacing declaration under it were read as one malformed declaration and postcss refused the file. The comment names the utilities in words instead, and a test reads the stylesheet with its comments stripped to catch the next one. * Studio: stop the titlebar slot shrinking under its own buttons The three navigation buttons are fixed at 30px, but the slot reserved for them still scaled both ways: at the 12px setting it fell to 89.6px while the cluster, with its scaled padding and gaps, measures 106px, so the drag region behind it covered part of the forward button. The slot takes the larger of 7rem and the scaled value, which is 112px at 12px and 149.3px at 20px against clusters of 106px and 116.7px. * Studio: hold the titlebar spacer at the button width it replaces On the mobile custom-titlebar path the navbar draws its own 34px trigger and the titlebar leaves a placeholder in its place. That placeholder still scaled while the buttons beside it are fixed, so at the 12px setting it gave back 6px: the trigger ends at 43.6px and the back button began at 38.4px, under a navbar that paints above the titlebar. The spacer is the same fixed 30px as the button it stands in for, which puts the back button at 44.4px. * Studio: scale the artifact panel's vertical offsets with the UI size * Studio: keep the fixed titlebar band out of the artifact panel's scaled offset * Studio: leave the size kerning in em, it already follows the text * Studio: recompute the carousel arrows when the card size changes * Studio: scale the chip field's wrap cutoff with the field --------- Co-authored-by: shimmyshimmer <[email protected]>
…ze (unslothai#11510) * Let the update card floor itself instead of guessing its height At the 20px interface size the update card clipped its own Copy command button away on short viewports, and sliced Remind me later in half on wider ones. The card's floor was written out as min-h-[calc(109px+80px*var(--ui-font-scale,1))], which came to 209px at that setting while the content needed about 301px, so the action row overflowed and the surface's overflow-hidden cut it. The constant was calibrated when only type scaled. unslothai#11458 made spacing follow the interface font size too, so the same content is now taller than the formula predicts and re-tuning the number only moves the size at which it fails again. The surface declared min-h-0 and overflow-hidden, and each of those sets its automatic minimum size to zero, which is why a floor had to be written by hand in the first place. Dropping both lets the surface floor itself at header + notes + actions. The notes panel already carries min-h-0, flex-1 and its own clipping, so it remains the only part that yields, which is what the card intends. The layout probe only failed when a control was clipped to nothing, so the 921x534 case, where the two buttons were cut from 47.7px to 41.8px, passed all along. It now compares each control against its unclipped box, which takes the check from 2 failures to 7 on the current card and to none with this change. * State the browser card's floor as its content, in the contracts too The contracts named the mechanism, so they failed on the fix rather than on the defect: one required min-h-0 and overflow-hidden on the surface, another required a written-out min-h floor, and a third required that floor to be gated on the notes panel. Each now states what it is for. The no-scroll claim is asserted as the absence of a scrolling overflow rather than the presence of overflow-hidden, since those are different claims and reading one as the other is what tied the contract to the old spelling. The floor claim is asserted as the surface declaring neither of the two things that zero a flex item's automatic minimum size. The desktop card is unchanged and keeps its written floor, so its rows keep the assertions they had. Verified in both directions: putting either min-h-0 or overflow-hidden back on the browser surface fails three node contracts and two Python ones, and a clean tree passes 20 node contracts and 190 Python ones. * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
…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
Settings > Appearance > UI font size (12px to 20px) only ever moved text. Padding, gaps, margins and row heights stayed at their authored values, so at 20px a label sat in a row padded for 12px text. The sidebar showed it worst, since its rows are laid out with one-off px values (
gap-[8.5px],pl-[39px],pt-[21px]) that nothing scaled.How
One multiplier,
--ui-space-scale, normalised against the 15px product default so the shipped look is unchanged and only a deliberate change to the preference moves it (12px -> 0.8, 20px -> 1.333).--spacing: calc(0.25rem * var(--ui-space-scale, 1)), so everyp-*,m-*,gap-*,space-*andsize-*utility in the app follows the preference at once.padding/margin/gaprules inindex.cssandhub.css, including the ones inside@apply, now multiply by it.gap-[8.5px],pl-[39px], and so on) carry the scale explicitly.--studio-chat-header-height,--studio-chat-control-height, header padding. These now have web defaults inindex.css, since the web shell sets no chrome vars.--spacing, were re-derived.Deliberately pinned, since they belong to the OS window rather than the UI: macOS traffic light insets, desktop title bar height, hairline borders. Icon glyphs keep their existing dampened growth curve.
Measured
Real class strings, measured in the browser at each setting:
At 20px the old build also truncated dropdown labels ("Inter Variable (De...") because control widths were pinned while the text grew. That now fits.
Tests
tscclean,vite buildclean, full suite passes (8192).18 shape tests encoded geometry as literal class strings. Added
atDefaultUiScale()to the test kit so they read the authored base: every length in those comparisons moves by the same factor, so an alignment that holds at the default holds at every font size. Newui-font-size-scales-spacing.test.tspins the policy, including that no bare px padding is left in the sidebar.