Skip to content

Studio: make the contrast slider reach surfaces and controls - #11459

Merged
shimmyshimmer merged 20 commits into
mainfrom
studio-contrast-reaches-surfaces-and-controls
Sep 22, 2026
Merged

shimmyshimmer merged 20 commits into
mainfrom
studio-contrast-reaches-surfaces-and-controls

Conversation

@shimmyshimmer

Copy link
Copy Markdown
Member

What

Settings > Appearance > Contrast only remapped three things: --border, --sidebar-border and muted text. Cards, menus, secondary buttons, hover fills and every control fill ignored it, so moving the slider looked like it did almost nothing.

How

The palettes now author their surfaces and lines as --*-base, and two rules own the tokens the app reads: an identity at :root, and a html[data-contrast-adjust] block that mixes each toward --contrast-target (the foreground above 50, the background below it). One place to retune every card, popover, secondary button, hover fill, input pill, hairline and control outline, in all three palettes.

Four curves, because one number for all of them is wrong:

group at 100 at 0
fills: card, popover, secondary, muted, accent, hovers, input pills +8% toward fg 70% into the page
lines: border, sidebar-border +45% 80% faded
control outlines and switch tracks +45% 55% faded
secondary text +40% 40% faded

Asymmetric on purpose. A card mixed far toward the foreground reads as a block rather than a surface, while the bottom of the range should flatten. Neither floor reaches the page colour: a dropdown still has to be findable over what it covers at 0, which I checked with a menu open. Control outlines stop short of the hairlines for the same reason, otherwise an unchecked switch disappears in light mode.

About 160 controls (Settings, Hub, pickers) do not use tokens at all, they are hand-written dark:bg-white/[0.06] and border-white/15 washes. Those now carry their authored alpha times --contrast-wash-gain or --contrast-edge-gain, so they fade and strengthen in step. Opaque scrims (bg-black/85, image hover overlays) are left alone, they cover content rather than being chrome.

Also in here:

  • The Images and Video panels override the border tokens in scope, so they redo the derivation rather than stopping the slider at their edge.
  • reload-snapshot.js carries all seven variables, so a reload does not repaint at stock contrast.
  • The setting's description changed from "Strength of borders and secondary text" to "How far buttons, boxes and lines stand out from the background", in all 12 locales.

Checked

Dark and light, at 0, 50 and 100. At 100 the pills, segmented controls and dividers lift clearly off the page; at 0 they dissolve into it while text stays legible; at 50 the derived tokens resolve to the exact authored literals (#212121, #303030), so the default is unchanged. Driven through the real slider and applyCustomizationToDocument, not just the CSS.

tsc clean, vite build clean, i18n parity passes, full suite passes (8194). New contrast-slider.test.ts covers the ownership, the identity at the default, the curves and the snapshot list. Three existing assertions were updated where they read a renamed token or a converted wash.

The contrast slider only remapped --border, --sidebar-border and muted
text, so cards, menus, buttons and control fills ignored it and the
setting looked like it did nothing.

The palettes now author their surfaces and lines as --*-base and two
rules own the public tokens: an identity at :root, and a
html[data-contrast-adjust] block that mixes each toward the foreground
above 50 or the background below it. Fills, hairlines, control outlines
and secondary text each get their own curve.

Controls that wash the page with translucent white or black instead of
taking a token now carry their authored alpha times a gain, so they move
in step. Opaque scrims keep their own alpha.
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 21, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-09-22T03:11:36.856955Z c074b08 Manual request
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

chatgpt-codex-connector[bot]

This comment was marked as resolved.

Drop the description line and match the run settings controls: the value
moves into a panel field beside the label, and the track becomes a
full-width panel-slider under the row, step 1 so it drags smoothly.

SettingsRow gains a `below` slot for full-width content on its own line.
@shimmyshimmer

Copy link
Copy Markdown
Member Author

Pushed a follow-up to the row itself:

  • Dropped the description line, so the row is just the label.
  • The value moved into a panel-field beside the label and the track became a full-width panel-slider under the row, the same control the run settings use. Step is now 1, so it drags smoothly instead of jumping in fives, and the value can be typed.
  • SettingsRow gained a below slot for full-width content on its own line. No other row passes it, so nothing else moves.

The now-unused contrast.description string is removed from all 12 locales, parity still passes.

chatgpt-codex-connector[bot]

This comment was marked as resolved.

The resting fill was derived while its hover twin kept its authored
value, so at high contrast the two crossed: in light mode the resting
surface went darker than the fixed hover, and the hover read lighter.
Derive both from the same curve.
@shimmyshimmer

Copy link
Copy Markdown
Member Author

Correct, and it was visible on every settings dropdown. Fixed in 5c246cc: --panel-input-surface-hover is authored as a base and derived on the same surface curve as its resting twin.

Measured the pair as sRGB over the page colour, at 0 / 50 / 100, hover minus resting in relative luminance:

0 50 100
light -2 -6 -5
dark +2 +9 +9

So hover stays darker than resting in light and lighter in dark at every setting, and both collapse toward the page at 0. Before the fix the light 100 case was resting 226 against a fixed hover of 239, a +13 inversion.

One related case I looked at and left alone: --nav-surface-hover is on the curve while --sidebar under it is not, so at 0 in dark the hover lands about 3/255 darker than the row it sits on. Mixing each surface toward its own backdrop rather than the page would be the general fix, but at that end of the range both are within a couple of units of black and it is not worth the extra target token. Happy to take it if you disagree.

@shimmyshimmer

Copy link
Copy Markdown
Member Author

@codex review

chatgpt-codex-connector[bot]

This comment was marked as resolved.

Conflict in projects-page.tsx only: #11443 restructured the row, so
take its version and re-apply the wash conversion to it. Its new row
assertion moves to the converted class.
chatgpt-codex-connector[bot]

This comment was marked as resolved.

The full-width track under the row read as a section, not a row. Put the
run settings slider and its field back on the row itself, beside the
label, so the contrast row lines up with the controls above it.
chatgpt-codex-connector[bot]

This comment was marked as resolved.

Unsloth added 2 commits September 21, 2026 07:24
Three controls sat outside the slider's reach. .panel-slider repaints the
track, fill and thumb with !important, so the parameter sliders in chat,
model config, RAG, Images and Video never moved; the track alpha now takes
the wash gain and --panel-slider-fg follows the text curve.

The profile picture button and the dictation stop button scaled only their
resting fill, so above about 80 the hover read fainter than the resting
state. Both hover alphas now take the same gain.
The dataset dropzone scaled only its resting border, so hovering or
dragging jumped to a fixed 30% or 40% outline: at contrast 0 that is an
eightfold step out of the setting, and at 100 the hover lands on top of
the resting state. The dark colour swatch ring was fixed the same way
while its light twin already scaled.
@shimmyshimmer

Copy link
Copy Markdown
Member Author

Fixed the four remaining findings. All of them were the same shape: a resting value on the curve next to a fixed twin.

  • Panel sliders: .panel-slider repaints the track, fill and thumb with !important, so the gain-aware colours in the component never applied. The parameter sliders in chat, model config, RAG, Images and Video all use that class. The track alpha now carries the wash gain, and --panel-slider-fg is authored as -base by the palettes and mixed on the text curve. Measured in dark mode the track goes 0.008 / 0.024 / 0.043 at contrast 0 / 50 / 100, and the fill lightness goes 0.53 / 0.74 / 0.84 against a 0.24 page. Light mode moves the other way, 0.81 / 0.68 / 0.52 against white.
  • Profile picture button and dictation stop button: resting scaled, hover fixed. At 100 the resting fill passed the hover (0.238 against 0.20, and 0.17 against 0.16) so hovering dimmed the control; at 0 the hover ignored the setting entirely. Both hover alphas now take the same gain, which keeps the ratio constant across the range.
  • Dataset dropzone: resting border scaled, hover and drag-over fixed at 30% and 40%. At contrast 0 that was an eightfold step out of the setting, at 100 the hover landed on the resting value. Both now take the edge gain.

While checking those I swept the rest of the gain-aware files. The only other split pair was the colour swatch ring, where the light branch scaled and the dark one did not, so that is on the gain too. The overlays that cover content (the settings backdrop, the image hover scrim, the selection marker) keep their own alpha on purpose, they are not chrome.

@shimmyshimmer

Copy link
Copy Markdown
Member Author

@codex review

chatgpt-codex-connector[bot]

This comment was marked as resolved.

Unsloth added 2 commits September 21, 2026 15:06
bg-foreground/[x] is a fixed alpha, so rows, chips and progress tracks
that dimmed or lifted in dark mode sat still in light mode. Each one is
now mixed from the same token with the gain applied, which resolves to
the identical colour at the default and moves with the slider elsewhere.
@shimmyshimmer

Copy link
Copy Markdown
Member Author

Right about the catalog rows, and it was not only those rows. bg-foreground/[x] is a fixed alpha, so every light-theme wash sat still while its dark twin followed the slider: row hovers and selection, menu button fills, chips, progress tracks, the picker items, the loaded models pills.

All of them now mix from the same token with the gain applied:

bg-[color-mix(in_oklab,var(--foreground)_calc(7%*var(--contrast-wash-gain,1)),transparent)]

Measured against the class it replaces, that resolves to oklab(0.2686 0 0 / 0.07) at the default, exactly what bg-foreground/[0.07] produces, and moves to 0.119 at contrast 100 and 0.0175 at contrast 0. 45 sites across 22 files, and a test now walks every .tsx so a new fixed wash cannot slip back in.

Also merged main, which came in clean here.

@shimmyshimmer

Copy link
Copy Markdown
Member Author

@codex review

chatgpt-codex-connector[bot]

This comment was marked as resolved.

bg-foreground/5 and /10 are the same fixed alpha in shorthand, so the
Studio progress track, the export badges, the attachment tile and the
chat action button still ignored the setting. The sweep now catches both
spellings. Two fills stay fixed: the dark button's own surface, and the
snippet highlight whose amber and red siblings are on no curve.
@shimmyshimmer

Copy link
Copy Markdown
Member Author

Right, the sweep only matched the arbitrary spelling. Extended it to the shorthand and migrated the five it found: the Studio progress track, the export badge and icon circle, the attachment tile and the chat action button's hover.

Two are deliberately left fixed, and the test names them:

  • components/ui/button.tsx, where hover:bg-foreground/85 is the dark button's own surface rather than a wash over the page. On the gain it would clamp at 100% high and drop to 21% low, which is a different button, not a lower-contrast one.
  • remote-code-consent-dialog.tsx, where bg-foreground/15 marks a snippet line beside amber and red siblings that are on no curve either.

@shimmyshimmer

Copy link
Copy Markdown
Member Author

@codex review

chatgpt-codex-connector[bot]

This comment was marked as resolved.

The dropzone's own borders were the last fixed part of it: resting 15%,
hover 30%, drag-over 45%, while its fills and its dark borders followed
the slider. Every light border-foreground hairline now mixes with the
edge gain, so a control's outline moves with the setting the way its fill
already does.
@danielhanchen

Copy link
Copy Markdown
Member

Confirmed the slider previously only moved --border, --sidebar-border and muted text, so cards, menus and control fills ignored it, and that the derived tokens resolve to the authored literals at the default. Will get this reviewed.

Five dark fills were written as literal hex and sat on top of gain-aware
rules: the model card hover, the soft field's focus, the instant menu,
the hero panel, and the light tab pill's hover. At contrast 100 the card
hover dimmed a card that had just brightened, and the focused field lost
its distance from rest.

Each one is now the same colour at the default, written as the wash its
twin uses, or as a surface mix where the tint has to survive.
@shimmyshimmer

Copy link
Copy Markdown
Member Author

Both right, and there were five of these rather than two: the model card hover, the soft field's focus, the instant menu surface, the hero panel, and the light tab pill's hover were all literal hex sitting on top of gain-aware rules.

Each is now written as the wash its twin already uses, over the page colour so the painted result stays opaque, with the percentage chosen to land on the shipped colour. Measured in the dark palette:

  • card: resting 40, hover 32 at the default, exactly #202020; 51 and 38 at contrast 100; 28 and 26 at contrast 0.
  • field: resting 36, focus 28 at the default, exactly #1c1c1c; 44 and 31 at 100; 27 and 25 at 0.

Worth noting the dark hover and focus have always been a shade darker than their resting state, not lighter. That is the shipped look and I kept it; the point of the change is that the pair now moves together instead of one of them standing still. The instant menu keeps its blue tint, so it takes the surface mix rather than a neutral wash, and is byte-identical at the default.

@shimmyshimmer

Copy link
Copy Markdown
Member Author

@codex review

chatgpt-codex-connector[bot]

This comment was marked as resolved.

The bar's dark surface was a fixed #2c2c2c while --card moves with the
slider, so at contrast 100 the cards passed it and the bar read as a
groove in the page it floats over. It takes the same surface step now,
which holds card below bar below border at 0, 50 and 100, and the test
reads both sides rather than one.
@shimmyshimmer

Copy link
Copy Markdown
Member Author

Right. The bar sat at a fixed #2c2c2c while --card moved, so the cards caught up with it and passed it. It takes the same surface step now. Measured in the dark palette, as lightness:

  • contrast 0: card 0.221, bar 0.234, border 0.239
  • default: card 0.248, bar 0.293, border 0.309
  • contrast 100: card 0.308, bar 0.350, border 0.364

Card below bar below border at all three, which is the ordering find-in-page.test.ts pins, and the default is the same colour it always was. The test reads both sides now, so the two cannot drift apart again.

The light bar is still the composer's white, deliberately: that test pins the two to the same colour and the composer is fixed white as well, so the pair stays consistent.

@shimmyshimmer

Copy link
Copy Markdown
Member Author

@codex review

chatgpt-codex-connector[bot]

This comment was marked as resolved.

@shimmyshimmer

Copy link
Copy Markdown
Member Author

You were right that a class sweep misses washes written longhand in CSS. Three of them were still fixed:

  • index.css .unsloth-plus-menu item hover, rgba(0, 0, 0, 0.06) in light and rgba(255, 255, 255, 0.1) in dark
  • hub.css dark trending size chip, rgb(255 255 255 / 0.12)

All three now carry calc(N * var(--contrast-wash-gain, 1)). Computed values: identical at the default (0.06, 0.1, 0.12), 0.102 / 0.17 / 0.204 at the top of the range, 0.015 / 0.025 / 0.03 at the bottom.

tests/contrast-slider.test.ts gained a RAW_WASH pattern next to the class sweep, so a longhand rgba background with a fractional alpha is caught the same way. Verified it bites by restoring the old rgba line, which made the test report index.css.

Box shadows keep their own alphas. Those are depth rather than chrome, and the find bar tests pin them.

@codex review

chatgpt-codex-connector[bot]

This comment was marked as resolved.

@shimmyshimmer

Copy link
Copy Markdown
Member Author

Correct, the arbitrary value is a spelling neither pattern saw: colour and alpha both sit inside the brackets. Those three chips in model-inspector.tsx are the only ones in the tree, and they pair with bg-muted in light mode, which does follow the curve, so the dark twin was the odd one out.

All three are now dark:bg-[rgb(255_255_255_/_calc(0.04*var(--contrast-wash-gain,1)))]. Computed in the browser: rgba(255, 255, 255, 0.04) at the default, 0.067 at the top of the range, 0.01 at the bottom.

FIXED_WASH grew a fourth alternative for bg-[rgba(...)] and bg-[rgb(... / .04)]. Verified it bites by putting the old class back, which made the test report model-inspector.tsx.

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Another round soon, please!

Reviewed commit: c074b08dce

ℹ️ 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".

@shimmyshimmer
shimmyshimmer merged commit 3bc5eb5 into main Sep 22, 2026
48 of 56 checks passed
@shimmyshimmer
shimmyshimmer deleted the studio-contrast-reaches-surfaces-and-controls branch September 22, 2026 03:03
@shimmyshimmer

Copy link
Copy Markdown
Member Author

Clean pass on c074b08, thanks. Nothing changed here since, so one more round for confirmation.

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Keep them coming!

Reviewed commit: 3bc5eb53d5

ℹ️ 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".

shimmyshimmer pushed a commit that referenced this pull request Sep 22, 2026
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.
shaojun pushed a commit to shaojun/unsloth that referenced this pull request Sep 29, 2026
…ai#11459)

* Studio: make the contrast slider reach surfaces and controls

The contrast slider only remapped --border, --sidebar-border and muted
text, so cards, menus, buttons and control fills ignored it and the
setting looked like it did nothing.

The palettes now author their surfaces and lines as --*-base and two
rules own the public tokens: an identity at :root, and a
html[data-contrast-adjust] block that mixes each toward the foreground
above 50 or the background below it. Fills, hairlines, control outlines
and secondary text each get their own curve.

Controls that wash the page with translucent white or black instead of
taking a token now carry their authored alpha times a gain, so they move
in step. Opaque scrims keep their own alpha.

* Studio: contrast row uses the run settings slider

Drop the description line and match the run settings controls: the value
moves into a panel field beside the label, and the track becomes a
full-width panel-slider under the row, step 1 so it drags smoothly.

SettingsRow gains a `below` slot for full-width content on its own line.

* Studio: keep the panel input hover on the contrast curve

The resting fill was derived while its hover twin kept its authored
value, so at high contrast the two crossed: in light mode the resting
surface went darker than the fixed hover, and the hover read lighter.
Derive both from the same curve.

* Studio: keep the contrast slider in the settings control column

The full-width track under the row read as a section, not a row. Put the
run settings slider and its field back on the row itself, beside the
label, so the contrast row lines up with the controls above it.

* Studio: contrast reaches panel sliders and hover washes

Three controls sat outside the slider's reach. .panel-slider repaints the
track, fill and thumb with !important, so the parameter sliders in chat,
model config, RAG, Images and Video never moved; the track alpha now takes
the wash gain and --panel-slider-fg follows the text curve.

The profile picture button and the dictation stop button scaled only their
resting fill, so above about 80 the hover read fainter than the resting
state. Both hover alphas now take the same gain.

* Studio: put the dropzone and swatch outlines on the edge gain

The dataset dropzone scaled only its resting border, so hovering or
dragging jumped to a fixed 30% or 40% outline: at contrast 0 that is an
eightfold step out of the setting, and at 100 the hover lands on top of
the resting state. The dark colour swatch ring was fixed the same way
while its light twin already scaled.

* Studio: put the light-theme washes on the contrast gain

bg-foreground/[x] is a fixed alpha, so rows, chips and progress tracks
that dimmed or lifted in dark mode sat still in light mode. Each one is
now mixed from the same token with the gain applied, which resolves to
the identical colour at the default and moves with the slider elsewhere.

* Studio: put the shorthand foreground washes on the gain too

bg-foreground/5 and /10 are the same fixed alpha in shorthand, so the
Studio progress track, the export badges, the attachment tile and the
chat action button still ignored the setting. The sweep now catches both
spellings. Two fills stay fixed: the dark button's own surface, and the
snippet highlight whose amber and red siblings are on no curve.

* Studio: put the light-theme outlines on the edge gain

The dropzone's own borders were the last fixed part of it: resting 15%,
hover 30%, drag-over 45%, while its fills and its dark borders followed
the slider. Every light border-foreground hairline now mixes with the
edge gain, so a control's outline moves with the setting the way its fill
already does.

* Studio: route the last hover surfaces through the contrast tokens

--sidebar-accent, --chat-icon-bg-hover and the line tab's indicator were
authored straight by the palettes, so the chat controls, the model picker
rows and the selected tab kept their shipped contrast at 0 and at 100.
All three are now authored as -base and derived on the surface curve.

The picker rows and the project switcher also hardcoded the light value
those tokens already carry, so they take the token instead.

* Studio: shorten three appearance descriptions

Chat width, Sidebar navigation and Profile menu each explained what the
list below already shows. The fixed rows read as fixed on screen, so the
sentences about them are gone, in all twelve locales.

* Studio: reach the washes the stylesheets author

The sweep only read .tsx, so anything authored in CSS or in a .ts helper
escaped it: the panel number input's hover and focus fills, the composer
and thinking pills' dark hover, the Hub's tag and card surfaces, and the
LoRA option's light hover outline.

The scan now covers .ts and .css, minus the scrims, and the Hub sheet's
foreground mixes carry the wash or edge gain by property. Every one
resolves to its authored value at the default.

* Studio: sweep the numeric black and white washes too

The scan read an arbitrary alpha on black and white but only shorthand on
the foreground token, so bg-white/25 and its kind passed unseen. It now
reads all four spellings, and the surfaces that stay fixed are named
rather than missed: the media viewers and their controls, the image hover
scrims and the selection markers, which stage a picture at a contrast of
their own.

* Studio: put the ring hairlines on the edge gain too

Cards, dialogs, menus and hover cards draw their outline as a ring rather
than a border, so the sweep never saw them: at contrast 0 the surfaces
flattened into the page while their outlines held full strength. All
eleven now mix with the edge gain, and the scan reads both spellings.
Focus rings are untouched, they take --ring.

* Studio: put the Hub's fixed hex fills on the curve

Five dark fills were written as literal hex and sat on top of gain-aware
rules: the model card hover, the soft field's focus, the instant menu,
the hero panel, and the light tab pill's hover. At contrast 100 the card
hover dimmed a card that had just brightened, and the focused field lost
its distance from rest.

Each one is now the same colour at the default, written as the wash its
twin uses, or as a surface mix where the tint has to survive.

* Studio: keep the find bar above the cards at any contrast

The bar's dark surface was a fixed #2c2c2c while --card moves with the
slider, so at contrast 100 the cards passed it and the bar read as a
groove in the page it floats over. It takes the same surface step now,
which holds card below bar below border at 0, 50 and 100, and the test
reads both sides rather than one.

* Studio: put the longhand menu washes on the contrast gain

* Studio: put the inspector's arbitrary rgba chips on the contrast gain

---------

Co-authored-by: shimmyshimmer <[email protected]>
shaojun pushed a commit to shaojun/unsloth that referenced this pull request Sep 29, 2026
…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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants