Repository navigation
Studio: UI font size scales all text consistently without moving layout - #7355
Conversation
The UI font size setting changes the root rem base, so only rem sized text reacted. Hundreds of px text classes, px font sizes in CSS, and chart labels stayed fixed, while rem based padding, widths and radii wrongly grew. Convert all text sizes to rem so every font follows the setting, and pin spacing, radius, container widths, sidebar and thread widths to px so layout no longer follows the rem base. Library styles (streamdown, react-flow) are re-based via overrides. All conversions are exact at the default 16px root, so the default rendering is unchanged.
|
Caution The consumer version of Gemini Code Assist on GitHub has been sunset. All code review activity has officially ceased. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 25bee3bb11
ℹ️ 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 logo lockups (sidebar wordmark with beta badge, onboarding wizard) are branding and now keep px sizes at any UI font size. Two controls clipped their text at the largest setting: the appearance color chips (fixed w-24) and the voice tab selects (fixed w-56). Both use min widths now, so they keep the default look at 16px and only grow when the text needs the room.
|
Pushed a follow up commit:
|
A scrolling dropdown lost its rounded corners on the scrollbar side: WebKit paints the surface square when the rounded element itself hosts the scrollbar, which shows up in the desktop app whenever a menu overflows, for example at larger UI font sizes. Dropdown menu and select content now clip with overflow hidden and scroll an inner viewport instead. The surface padding insets the scrollbar clear of the curve, so corners stay rounded in every engine. Submenus are unaffected since sub content is portaled.
|
Pushed another fix: scrolling dropdowns lost their rounded corners on the scrollbar side. When a menu overflows (easy to hit at larger UI font sizes), WebKit paints the surface square wherever the rounded element itself hosts the scrollbar, so the right edge of the menu went flat in the desktop app.
Also swept the rest of the codebase for the same pattern. The remaining rounded scrollers are small inline log and code boxes with subtle radii where the artifact does not read, so they were left alone. |
Rather than pinning the logo, the sidebar lockup (sticker, wordmark, beta badge) and the onboarding lockup now follow the UI font size at half the rate of the change: size = base + (root - 16px) / 2, written as calc((base - 8)px + 0.5rem). A 4px font size change moves the logo by 2px, and the default 16px root renders the exact base sizes.
|
Changed the logo behavior: instead of staying pinned, the logo lockups now follow the UI font size at half the rate of the change. The formula is size = base + (root - 16px) / 2, written in CSS as calc((base - 8)px + 0.5rem), applied to the sidebar lockup (circle sticker, wordmark, beta badge) and the onboarding wizard lockup (sticker plus text). So a 4px font size change moves the logo by 2px, and the default 16px root still renders the exact base sizes. Verified through the actual Settings control: at 12px the wordmark, badge and sticker measure 19, 6 and 32 (each down 2 from 21, 8 and 34), and at 20px they measure 23, 10 and 36 (each up 2). |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 745b11d468
ℹ️ 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".
|
Ran a full simulation matrix against this branch to verify the fix end to end. Setup: isolated sandbox with a Playwright harness driving the real app (login, real Settings controls, real backend sync), plus a static audit of the built bundle running in a uv venv. Engines covered: Chromium (Chrome and Edge), WebKit (Safari and the desktop app), and Firefox, each at 1440x900, plus a Chromium pass at devicePixelRatio 1.25 to simulate Windows 125 percent display scaling. The changes are frontend only, so the browser engine is the compatibility variable rather than the OS. Results: 344 browser assertions passed with 0 failures, and 12 static checks passed. What was asserted, per engine:
Static audit of the built CSS: no stray px font sizes outside the known allowlist (the KaTeX 1px layout rule and the overridden library rules), the streamdown and react-flow overrides are present with winning specificity, spacing, radius and container tokens are pinned to px, no px arbitrary text classes remain in the source, and every converted rem value is an exact binary fraction so there is no rounding drift at any setting. No product issues surfaced. Two early scanner false positives (buttons inside the collapsed run settings panel, and Firefox reporting scrollWidth on inline boxes) were confirmed as measurement artifacts, and one flaky keyboard timing assertion was fixed in the harness, after which everything is green. |
…rolling Numeric leading utilities (leading-3 through leading-10) derive from --spacing, so pinning spacing to px also froze their line-heights while the paired text sizes now scale. Define them as rem theme tokens so line-height follows the UI font size again; values are identical at the 16px default. Convert the grid tracks the rem-to-px codemod missed (rem followed by an underscore escaped the word boundary): the response details label column and the on-device folder rows. Make the Radix select viewport the bounded scroller instead of a wrapper div, so Radix's scroll handling and the browser scroll the same element. Restore the app's thin scrollbar with an inline style, which beats the scrollbar hiding stylesheet Radix injects at runtime.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: a52536844c
ℹ️ 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".
|
@codex review |
|
Codex Review: Didn't find any major issues. 👍 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". |
|
Follow up: #7359 replaces the scaling mechanism from this PR with an explicit typography scale. The preference now writes a --ui-font-scale variable instead of mutating the root font size, the layout-only rem to px conversions from this PR are reverted since the rem base no longer moves, and all the behavior fixes here (tight controls, rounded scrolling menus, logo half rate) carry over. It also adds contract tests, a Playwright regression wired into the UI smoke workflow, and a guard against new raw pixel typography. |
…root font size (#7359) * Studio: drive UI font size through a typography scale, not the root font size Follow up to #7355. The preference now writes --ui-font-scale (selected / 16) and a data-ui-font-size attribute on the root instead of mutating the root font size, and the applier clears any stale inline root font-size left by older builds. Because the rem base never moves, every layout-only rem-to-px conversion from #7355 is reverted to its original form: the spacing, radius and container tokens, sidebar and thread widths, grid tracks, calc margins and hub.css dimensions match pre-#7355 main again, which also restores rem-based accessibility scaling for users with a larger browser default font size. Typography scales through tokens in index.css, all exact at 16px: - The named Tailwind sizes (--text-xs through --text-4xl) multiply their defaults by the scale, so standard utilities scale - One token per design px size (--text-ui-8 ... --text-ui-34) replaces every arbitrary text-[Npx] class; leading-ui-* mirrors the exact line heights and the numeric --leading-3..10 scale as well - CSS font-size and line-height declarations multiply by the scale - Chart labels scale through a .recharts-text rule; streamdown and react-flow px text is re-based via scaled overrides; KaTeX's 1px layout trick stays fixed by design - The logo lockups keep their half-rate behavior via the scale var - The explicit Code font size remains unmultiplied Keeps the #7355 behavior fixes: color chip min width, voice select min/max widths, and the select and dropdown menus scrolling an inner viewport so their corners stay rounded. The whitespace-password and IME rename guards that merged alongside are preserved. * Studio: contract and Playwright coverage for the UI font size scale test_ui_font_scale_contract.py pins the mechanism (scale var written, root font size never mutated, tokens scaled, code font size not multiplied, the Radix select viewport owning scroll state) and guards against new raw pixel typography, with a documented allowlist for the recharts fontSize props covered by the stylesheet override and the offscreen clipboard textarea. playwright_ui_font_scale.py drives the real appearance controls: root font size fixed at 12/16/20, text and line height scale by size/16, sidebar width invariant, explicit code font size stays fixed, an overflowing dictation select scrolls its Radix viewport by keyboard and wheel, and the default restores exactly. Wired into the UI smoke workflow against the second studio boot. The thinking-compact and descender contracts move back to the rem and token forms now that layout values no longer need px pinning.
Problem
The UI font size setting in Settings > Appearance was inconsistent. It works by changing the root font size (the rem base), so only rem sized text reacted to it. Everything with a px font size did not move at all: headings, sidebar labels, roughly 600
text-[13px]style classes across 130+ files, px font sizes inindex.cssandhub.css, and the training chart labels. At the same time, rem based padding, gaps, widths and radii wrongly grew with the setting, so bumping the font size also inflated the layout.Fix
Two sided normalization, all exact at the default 16px root so default rendering is byte for byte identical:
Text follows the rem base
text-[Npx]andleading-[Npx]arbitrary class to its rem equivalent (text-[13px]becomestext-[0.8125rem]), including inside@applyblocks in CSSfont-sizeandline-heightdeclarations inindex.cssandhub.cssto remfontSize={10}props now use"0.625rem"index.cssLayout ignores the rem base
--spacingto4pxand--radiusto17.6px(same computed values as before), plus the--container-*scale used bymax-w-mdand friendshub.cssdimensions are now pxFollow ups in this PR
Logo scales at half rate. The sidebar lockup (circle sticker, wordmark, beta badge) and the onboarding wizard lockup follow the UI font size at half the rate of the change: size = base + (root - 16px) / 2, written as calc((base - 8)px + 0.5rem). A 4px font size change moves the logo by 2px, and 16px renders the exact base sizes.
Tight controls fit the text. Audited every settings tab, the chat page and the run settings panel at the maximum setting (20px). The appearance color chips (fixed
w-24) and the voice tab selects (fixedw-56) clipped their text. The chips now use min widths, while the selects use bounded min/max widths, so they render identically at 16px, widen when needed, and truncate unusually long device names before they can overflow the dialog.Scrolling dropdowns keep rounded corners. When a menu overflows, WebKit paints the surface square wherever the rounded element itself hosts the scrollbar, so menus lost their rounding on the scrollbar side in the desktop app.
DropdownMenuContentandSelectContentnow clip the surface and scroll an inner viewport; the surface padding insets the scrollbar clear of the curve. Submenus are unaffected since sub content is portaled.Verification
Measured in headless Chromium and WebKit through the real Settings control:
Notes
font-size: 1pxrule, which is a layout trick and not visible text