Skip to content

Let the cache row's path label follow the interface font size - #11520

Merged
danielhanchen merged 1 commit into
mainfrom
fix/cache-rows-scale-the-path-label
Sep 22, 2026
Merged

danielhanchen merged 1 commit into
mainfrom
fix/cache-rows-scale-the-path-label

Conversation

@danielhanchen

Copy link
Copy Markdown
Member

What is wrong

Repo tests (CPU, studio) is failing on main:

FAILED tests/studio/test_ui_font_scale_contract.py::test_no_raw_pixel_text_utilities
AssertionError: Raw px text utilities ignore the UI font size preference; use the
text-ui-* / leading-ui-* tokens in index.css instead:
['features/settings/components/cache-storage-rows.tsx: text-[11px]']

It is the only failure in that lane: 1 failed, 7533 passed, 165 skipped.

Where it came from

f18373631 ("Studio: show what the caches cost and let them be cleared", #10528) added cache-storage-rows.tsx, and the path label under each cache name carries a raw text-[11px]. That is the one piece of type on the screen that ignores Settings > Appearance: at the 20px setting every label around it grows and this one stays at 11px.

The test is right and the code is wrong here. The contract exists precisely because a raw px text utility opts out of the preference, and nothing about a file path makes it an exception. The two documented exceptions in that file are the chart fontSize props and the offscreen clipboard textarea, and neither covers this.

The change

text-[11px] becomes text-ui-11, the token the rest of the UI uses for 11px-class text:

--text-ui-11: calc(0.6875rem * var(--ui-font-scale, 1));

Worth stating plainly, because it is a visible change rather than a pure refactor: --ui-font-scale is 0.9375 at the default 15px setting, so the label renders 10.3px instead of 11px by default. That is the same arithmetic every other text-ui-11 on the screen already goes through, so the label now matches the type around it rather than sitting slightly larger than it, and at every non-default setting it moves with the rest of the screen instead of staying fixed.

Verification

  • tests/studio/test_ui_font_scale_contract.py: 12 passed (was 1 failed, 11 passed)
  • with tests/studio/test_desktop_reliability_frontend_contract.py: 53 passed
  • putting the raw text-[11px] back fails the contract again, so the guard is what is holding this and not an incidental pass

The cache storage rows landed with a raw text-[11px] on the path label,
which is the one piece of type on that screen that ignores Settings >
Appearance. tests/studio/test_ui_font_scale_contract.py names it, and
that check has been failing Repo tests (CPU, studio) on main since the
rows merged.

Swapped for the text-ui-11 token, which is what the rest of the UI uses
for 11px-class text: calc(0.6875rem * var(--ui-font-scale, 1)). At the
default 15px setting that renders 10.3px rather than 11px, so the label
is a touch smaller than it was, and at every other setting it now moves
with the rest of the screen instead of staying put.
@danielhanchen

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for security reviews. Please try again later.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 22, 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-22T10:02:23.626530Z b7f7bb9 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

Copy link
Copy Markdown

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

Reviewed commit: b7f7bb9ed5

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

@danielhanchen

Copy link
Copy Markdown
Member Author

UI evidence

I could not get a before/after screenshot pair off this host. The two Studio installs were killed by the machine's memory watchdog on four consecutive attempts, three of them mid-build, and the last one wiped both frontend bundles on its way out. Both sides did build once and both worktrees hold the right source, so this is the host being squeezed by other work rather than anything about the change. Posting a pair that came out of a half-built install would be worse than posting none, so here is the measurement instead.

The label's rendered size, computed from the declarations that ship:

  • index.css: --text-ui-11: calc(0.6875rem * var(--ui-font-scale, 1)), so 11px at the 16px root before the scale
  • appearance-custom-store.ts: --ui-font-scale is uiFontSize / 16, over the range { min: 12, max: 20, default: 15 }
Settings > Appearance before, text-[11px] after, text-ui-11
12px, the minimum 11px 8.25px
15px, the default 11px 10.31px
20px, the maximum 11px 13.75px

The before column is the defect: one fixed number across the whole range, on a label sitting among rows that all move. The after column is the same arithmetic every other text-ui-11 on that screen already goes through.

The default row is the visible change to weigh, 11px becoming 10.31px. That is the label matching the type around it rather than sitting slightly larger than it, which is what the token is for.

@danielhanchen
danielhanchen merged commit ed15309 into main Sep 22, 2026
38 of 40 checks passed
@danielhanchen
danielhanchen deleted the fix/cache-rows-scale-the-path-label branch September 22, 2026 10:19
shaojun pushed a commit to shaojun/unsloth that referenced this pull request Sep 29, 2026
…hai#11520)

The cache storage rows landed with a raw text-[11px] on the path label,
which is the one piece of type on that screen that ignores Settings >
Appearance. tests/studio/test_ui_font_scale_contract.py names it, and
that check has been failing Repo tests (CPU, studio) on main since the
rows merged.

Swapped for the text-ui-11 token, which is what the rest of the UI uses
for 11px-class text: calc(0.6875rem * var(--ui-font-scale, 1)). At the
default 15px setting that renders 10.3px rather than 11px, so the label
is a touch smaller than it was, and at every other setting it now moves
with the rest of the screen instead of staying put.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant