Skip to content

Studio Agents tab: use text-ui-* tokens instead of raw px text sizes - #7464

Closed
danielhanchen wants to merge 1 commit into
unslothai:mainfrom
danielhanchen:fix/agents-tab-ui-font-tokens
Closed

danielhanchen wants to merge 1 commit into
unslothai:mainfrom
danielhanchen:fix/agents-tab-ui-font-tokens

Conversation

@danielhanchen

Copy link
Copy Markdown
Member

Problem

Backend CI / Repo tests (CPU) is red on main for a second reason, on top of the ROCm routing errors that #7461 fixes:

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/tabs/agents-tab.tsx: text-[11px]',
 'features/settings/tabs/agents-tab.tsx: text-[10px]',
 'features/settings/tabs/agents-tab.tsx: text-[10px]']

The Agents settings tab added in #7303 carries three raw pixel text utilities. Raw text-[Npx] bypasses the --ui-font-scale tokens, so that text ignores the Settings > Appearance UI font size preference, which is exactly what the contract guards against.

Fix

Swap them for the equivalent scaled tokens, the same treatment the voice tab got in #7378:

  • text-[11px] -> text-ui-11 (calc(0.6875rem * var(--ui-font-scale, 1)))
  • text-[10px] -> text-ui-10 (calc(0.625rem * var(--ui-font-scale, 1)))

Both resolve to the current pixel size at scale 1, so the default rendering is byte-for-byte the same size and the text now follows the preference when it is changed.

Verification

pytest tests/studio/test_ui_font_scale_contract.py -q -> 11 passed (was 1 failed, 10 passed).

tests/studio/test_ui_font_scale_contract.py::test_no_raw_pixel_text_utilities
is failing on main, so Repo tests (CPU) is red on every open PR:

    Raw px text utilities ignore the UI font size preference; use the
    text-ui-* / leading-ui-* tokens in index.css instead:
    ['features/settings/tabs/agents-tab.tsx: text-[11px]',
     'features/settings/tabs/agents-tab.tsx: text-[10px]',
     'features/settings/tabs/agents-tab.tsx: text-[10px]']

The Agents settings tab landed with three raw pixel text utilities. They
ignore the Settings > Appearance UI font size preference, which is exactly
what the contract guards.

Swap them for the equivalent scaled tokens, same as the voice tab did:
text-[11px] -> text-ui-11 (0.6875rem) and text-[10px] -> text-ui-10
(0.625rem). Both resolve to the current pixel size at scale 1, so the
default rendering is unchanged and the text now follows the preference.
@danielhanchen

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. More of your lovely PRs please.

Reviewed commit: 1c99935cd1

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

Duplicate of #7462, which has the identical diff and landed first. Continuing there.

@danielhanchen
danielhanchen deleted the fix/agents-tab-ui-font-tokens branch July 26, 2026 09:48
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