Repository navigation
Studio: scale menu, toast, chat and composer icons with the UI font size - #7400
Conversation
Glyphs that sit beside scaled labels now follow the preference: the shared --icon-size token (nav, settings tabs, chat action bars, code block actions), classed svgs inside dropdown, select, context, menubar, popover and command surfaces, toasts, the chat thread and both composers, and the composer pill glyph slot. Sonner toast text is unpinned from its injected 13px. Hit targets, paddings and surface geometry stay fixed and every value is identity at the default size.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 1743abfce5
ℹ️ 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".
| [data-sonner-toast][data-styled='true'] [data-icon] { | ||
| width: calc(16px * var(--ui-font-scale, 1)) !important; | ||
| height: calc(16px * var(--ui-font-scale, 1)) !important; |
There was a problem hiding this comment.
Scale Sonner's loading spinner too
When the toast is a loading/promise toast, Sonner 2.0.7 renders the spinner with a .sonner-loading-wrapper that has its own fixed --size: 16px, not an SVG. These new overrides scale the toast text and [data-icon] well, but leave that internal spinner fixed, so at UI font size 12 the spinner stays 16px while the well is reduced to 12px and can overflow; at UI font size 20 it remains undersized. This affects existing loading flows such as toast.loading(...) in recipe model loading and toast.promise(...) unloads, so the wrapper/spinner size needs to track --ui-font-scale as well.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
The built-in loader never renders here: the Toaster always passes icons.loading (the app Spinner, an svg with size-4), and Sonner wraps a custom loading icon in .sonner-loader, not .sonner-loading-wrapper, so the spinner already tracked the preference. Added a defensive --size override for the built-in wrapper anyway in ddf149e in case the custom icon is ever removed.
| [data-sonner-toast][data-styled='true'] { | ||
| font-size: calc(13px * var(--ui-font-scale, 1)) !important; |
There was a problem hiding this comment.
Scale Sonner action labels too
When a toast includes an action button, Sonner applies its own [data-button] { font-size: 12px; }, so the inherited font size set here does not reach the button label. With UI font size 12 or 20 the toast title/description now shrink or grow while existing action toasts such as the Discover retry action keep a fixed 12px label, leaving part of the toast text outside the user preference; add a matching override for Sonner action buttons.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Correct, Sonner pins action labels at 12px in its injected stylesheet. Verified against sonner 2.x dist CSS and the Discover retry toast. Fixed in ddf149e: action buttons now scale at the same full text rate as the title and description.
| :is( | ||
| [data-slot='dropdown-menu-content'], | ||
| [data-slot='dropdown-menu-sub-content'], | ||
| [data-slot='select-content'], |
There was a problem hiding this comment.
Include closed select triggers in the icon scale
This only scopes select content, but the closed select control still has data-slot="select-trigger", text-sm for its selected label, and a size-4 chevron in components/ui/select.tsx. When the UI font size is changed, the selected value text scales while the always-visible trigger chevron stays at 16px until the menu is opened, so select controls remain inconsistent in Settings and other forms; add the trigger slot to the scoped icon overrides as well.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Correct, the closed trigger kept a fixed 16px chevron while its label scaled. Fixed in ddf149e: select-trigger joins the scoped surfaces, verified at settings 12/16/20 (16px base moving at half rate, 14/16/18).
Icons now follow the preference at half the rate of the text, matching the logo lockup: base + (setting - 16) / 2. The menu specific rules that outranked the scoped block (app-user-menu, unsloth-plus-menu, unsloth-tick) carry the scale too, which also restores the plus menu's intended 1.15rem glyph base at the default size. From review: closed select triggers join the scoped surfaces so their chevron tracks the label, sonner action button labels scale at full text rate alongside the title and description, and the unused built-in sonner loader gets a defensive size override.
Piecewise icon scaling: below the 16px default icons follow the UI font size at the full text rate, above it they move at half the rate so glyphs stay slightly smaller than the text. Written as min(full, half) since the smaller branch is correct on each side. Applies to the shared --icon-size token, the scoped menu, toast, chat and composer overrides, and the menu rules that outrank them.
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 174c58b967
ℹ️ 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".
| width: min(calc(1.15rem * var(--ui-font-scale, 1)), calc(0.575rem + 0.575rem * var(--ui-font-scale, 1))) !important; | ||
| height: min(calc(1.15rem * var(--ui-font-scale, 1)), calc(0.575rem + 0.575rem * var(--ui-font-scale, 1))) !important; |
There was a problem hiding this comment.
Keep thinking tick sizing from being overridden
In the Thinking dropdowns, the selected-state icons are rendered as unsloth-tick size-4 inside an unsloth-plus-menu. Because this later plus-menu rule is now also !important and is more specific than .unsloth-tick, it overrides the smaller 0.8rem tick rule above, so the check marks grow to the generic 1.15rem menu icon size at every UI scale instead of staying intentionally smaller.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Correct. The plus menu rule is important and more specific than .unsloth-tick, so ticks inside those menus rendered at the standard icon size. Verified live (18px instead of 14.4px at setting 20) and fixed in 28dd7c5: the menu rule now excludes .unsloth-tick.
| [data-sonner-toast][data-styled='true'] [data-button] { | ||
| font-size: calc(12px * var(--ui-font-scale, 1)) !important; |
There was a problem hiding this comment.
Scale Sonner cancel labels as well
Model-loading toasts use Sonner's cancel: { label: "Cancel" }, and the stylesheet already treats [data-cancel] as a separate Sonner button, but this new font-size override only covers [data-button]. In those toasts the Cancel label remains pinned by Sonner's injected 12px styling while the toast text and other action labels scale, so the common cancel action still ignores the UI font-size preference.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Sonner renders the cancel button with data-button set alongside data-cancel (checked the 2.x dist: createElement(button, { data-button: true, data-cancel: true })), so the data-button font override already reaches it. Verified live: a cancel button computes 15px at setting 20, which is 12px times 1.25. No change needed.
| & svg.size-\[20px\] { width: min(calc(20px * var(--ui-font-scale, 1)), calc(10px + 10px * var(--ui-font-scale, 1))); height: min(calc(20px * var(--ui-font-scale, 1)), calc(10px + 10px * var(--ui-font-scale, 1))); } | ||
| & svg.size-\[21px\] { width: min(calc(21px * var(--ui-font-scale, 1)), calc(10.5px + 10.5px * var(--ui-font-scale, 1))); height: min(calc(21px * var(--ui-font-scale, 1)), calc(10.5px + 10.5px * var(--ui-font-scale, 1))); } | ||
| & svg.size-\[22px\] { width: min(calc(22px * var(--ui-font-scale, 1)), calc(11px + 11px * var(--ui-font-scale, 1))); height: min(calc(22px * var(--ui-font-scale, 1)), calc(11px + 11px * var(--ui-font-scale, 1))); } |
There was a problem hiding this comment.
Include branch picker chevrons in the scaled set
The branch picker in the chat thread renders its prev/next chevrons as svg.size-[36px] next to the text-ui-13 counter, but this scoped .aui-root list stops at size-[22px]. In multi-branch messages with the UI font size set below or above 16, the counter scales while those chevrons remain at the old fixed 36px glyph box, leaving one of the chat action controls this change is meant to cover unscaled.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Correct, the 36px branch chevrons sat beside a scaling counter without moving. Fixed in 28dd7c5: size-36px svgs scale proportionally (27px at setting 12, 40.5px at 20).
| [data-slot='menubar-content'], | ||
| [data-slot='popover-content'], | ||
| [data-slot='command'], | ||
| [data-sonner-toast], |
There was a problem hiding this comment.
Add combobox popups to the icon scaling scope
Combobox popups use [data-slot="combobox-content"]/combobox-item in components/ui/combobox.tsx, with text-sm labels and default size-4 SVG indicators. Because this new scoped list omits combobox content, any model/dataset/settings combobox with a selected-item tick or leading icon still shows fixed 16px glyphs while its item text follows --ui-font-scale, leaving the same menu-icon mismatch this block fixes for dropdown/select/command surfaces.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Correct, combobox popups were missed. Fixed in 28dd7c5: combobox-content and combobox-trigger join the scoped surfaces; their size-4 indicators now render at the shared icon size.
Below the default icons still match the text scale; above it they now keep their default size instead of growing at half rate, so enlarged text dominates and glyphs read slightly smaller than the text. The curve is min(full rate, base).
|
@codex review |
|
Codex Review: Didn't find any major issues. Swish! 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". |
A 16px glyph at setting 20 renders 18px, as if the setting were 18: above the default icons move at half the rate of the text, below it they match the text scale. The curve is min(full rate, half rate).
One shared --ui-icon-size token replaces the per-base curves for every glyph with a 16px or larger base: icons match the UI font size below the default and grow at half the change above it, so setting 12 gives 12px icons, 16 gives 16px and 20 gives 18px, slightly smaller than the enlarged text. Sub 16px glyphs keep their proportions through the same curve as a factor. This also slims the previous 18px to 21px icon bases down to the font size at the default setting.
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 0c322350ca
ℹ️ 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".
| [data-sonner-toast][data-styled='true'] [data-button] { | ||
| font-size: calc(12px * var(--ui-font-scale, 1)) !important; |
There was a problem hiding this comment.
Scale Sonner cancel labels too
When a toast uses Sonner's cancel option, the cancel button is rendered under [data-cancel] (this repo already positions and disables selection for [data-cancel], and model loading / document-index waits pass cancel: { label: "Cancel" }). This new override only targets [data-button], so at non-default UI font sizes the title/description/action labels scale while the cancel label stays at Sonner's fixed 12px, leaving one of the main toast controls ignoring the accessibility preference.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Same as the earlier cancel thread: sonner sets data-button on the cancel button too, so the existing override covers it. Verified live at setting 20: cancel computes 15px.
| & svg.size-4 { width: var(--ui-icon-size); height: var(--ui-icon-size); } | ||
| & svg.size-4\.5 { width: var(--ui-icon-size); height: var(--ui-icon-size); } | ||
| & svg.size-5 { width: var(--ui-icon-size); height: var(--ui-icon-size); } | ||
| & svg.size-6 { width: var(--ui-icon-size); height: var(--ui-icon-size); } |
There was a problem hiding this comment.
Avoid shrinking attachment thumbnails
Because this scoped block includes the entire .aui-root, the svg.size-6 override also matches non-text glyphs such as AttachmentThumb's File/Audio icon inside the 56px attachment tile. At the default scale --ui-icon-size is only 16px, so adding any non-image attachment now renders that thumbnail icon at 16px instead of the intended Tailwind size-6 24px (and only 18px at UI 20), making attachment previews look incorrectly tiny; narrow this rule to actual action/text surfaces or exclude attachment tiles.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Correct, the uniform token wrongly slimmed 24px art glyphs like the attachment tile icon to 16px at the default. Fixed in 28dd7c5: size-6 svgs are back on the proportional curve (24px at default, 18px at setting 12, 27px at 20).
| & [data-slot*='item'] svg:not([class*='size-'], [class*='w-'], [class*='h-']) { | ||
| width: var(--ui-icon-size); | ||
| height: var(--ui-icon-size); | ||
| } |
There was a problem hiding this comment.
Include unclassed action-button icons
This fallback only handles unclassed menu-item SVGs, but chat/composer action buttons often rely on the shared Button selector ([&_svg:not([class*='size-'])]:size-4) instead of putting a size-* class on the SVG itself, for example the prompt-queue remove icon in components/assistant-ui/thread.tsx. Those SVGs do not match any of the svg.size-* rules and are not under a [data-slot*='item'], so changing the UI font size still leaves part of the chat/composer icon set fixed at its old size.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Correct, buttons that size un-classed icons through the shared Button selector were missed. Fixed in 28dd7c5: within the scoped surfaces those svgs get the shared icon token; xs buttons that pin size-3 icons are excluded and keep their small glyphs.
From review: thinking ticks keep their own size inside plus menus (the important menu rule now excludes them), combobox popups and triggers join the scoped surfaces, 24px size-6 art glyphs such as attachment tile icons go back to proportional scaling instead of the uniform token, branch picker 36px chevrons scale proportionally beside their counter, and buttons that default un-classed icons to size-4 get the shared token (xs buttons keep their pinned small icons). Sonner cancel labels already scale: sonner renders cancel with data-button set, so the existing override reaches it.
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 28dd7c5197
ℹ️ 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".
| & button:not([class*=':size-3']) svg:not([class*='size-'], [class*='w-'], [class*='h-'], .unsloth-tick) { | ||
| width: var(--ui-icon-size); | ||
| height: var(--ui-icon-size); |
There was a problem hiding this comment.
Exclude toast close icons from the fallback
For Sonner toasts that pass closeButton: true (for example the model loading/loaded toasts), this fallback also matches the close button because [data-sonner-toast] is in the scope and Sonner's default close SVG is unclassed. That changes the close X from Sonner's compact close-control glyph to --ui-icon-size (16px at default, 18px at UI font size 20) inside the fixed close button, making it visually oversized; the toast status icon is already handled by the dedicated [data-icon] rule below, so this button fallback should exclude [data-close-button].
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Correct. The fallback matched Sonner's close button and its unclassed 12px X rendered at the shared icon size (measured 18px at setting 20 inside the fixed 20px control). Fixed in 500f120: data-close-button is excluded from the fallback, and the X measures 12px again while regular button icons keep the token.
The button icon fallback matched Sonner's close button, whose unclassed 12px X then rendered at the shared icon size inside its fixed control. Exclude data-close-button from the fallback.
The raw px guard caught a text-[11px] added on main; raw px text ignores the UI font size preference.
|
@codex review |
|
Codex Review: Didn't find any major issues. Keep it up! 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". |
#7400 folded every glyph with a 16px or larger base into --ui-icon-size, which took the composer plus from 22px down to 16px at the default UI font size. It now renders at 1.375x the token, which is the same curve a 22px base follows, so the size is back where it was and only its scaling changed.
* feat(studio): stop and send buttons on the dictation bar Replace the check/cross pair in the chat recording bar with a stop button and the normal send button. - Stop ends the recording and leaves the transcript in the composer - Send transcribes and submits the message in one action - Escape discards a recording without transcribing * fix(studio): grey stop button and roomier dictation bar spacing - Neutral grey in both themes; --secondary read as brand green on light and blended into --card on dark - Wider gap between stop and send, more padding around the waveform * fix(studio): skip dictation Escape when a dialog claimed it Drops preventDefault and bails on defaultPrevented so Escape closing an open overlay no longer also cancels the recording. * fix(studio): rebalance dictation bar spacing Tighten the gap between the waveform and the timer, and push the timer further from the stop button. * fix(studio): tighten recording buttons, enlarge dictate icon * fix(studio): nudge dictate icon up to 24px * fix(studio): back dictate icon down to 23px * revert(studio): keep dictate icon at 20px * fix(studio): nudge dictate icon to 21px * fix(studio): set dictate icon to 22px * fix(studio): address review on dictation send - Empty transcript no longer submits a pre-recording draft; the send compares against the text at session start, so a final result matching the browser engine's interim still counts as new - Disable dictation send while an attachment uploads, matching the regular send, which handleSubmit would otherwise reject silently - Cover the send decision with unit tests * fix(studio): enlarge composer mic and send controls, tuck send into the corner The mic and send arrow are filled glyphs that span their whole viewBox, so at the shared --ui-icon-size they read smaller than the stroked icons beside them. Both now opt out of that size and stay slightly above it, still tracking the UI font scale. Send, queue, cancel and dictation stop circles go from 32px to 36px, matching the plus button, and the send circle now sits 10px from the right and bottom edges so it tucks evenly into the composer's 32px corner. Compare gets the same treatment. Also drops two comments describing the discard button this branch removed. * fix(studio): give the send circle a 12px corner gap Gemini-style breathing room rather than the tighter tuck: the circle sits 12px from the right and bottom edges in both composers, still even on both axes inside the 32px corner. * fix(studio): restore the composer plus to its pre-#7400 size #7400 folded every glyph with a 16px or larger base into --ui-icon-size, which took the composer plus from 22px down to 16px at the default UI font size. It now renders at 1.375x the token, which is the same curve a 22px base follows, so the size is back where it was and only its scaling changed. * fix(studio): round the icon button hovers and tidy temporary chat Hover backgrounds on the sidebar search and collapse buttons and on the chat header's temporary chat, research and run settings buttons are now circles. The sidebar pair squares off at 28px, its previous width, so the spacing between them does not move. The header group also loses 4px of gap: gap-1 plus the 2px nudge that pushed the run settings button right, leaving 4px between the circles. Temporary chat drops two redundant markers: the greeting mascot, so the title stands alone, and the green Temporary pill, since the header toggle already turns green and the welcome copy explains the mode. * fix(studio): tighten the dictation send gate and skip partial transcripts Send was only gated on disabled and pending attachments, so it stayed live in states handleSubmit rejects: an active research run, and a running response or prompt queue holding an attachment, pending audio or an image overlay. The intent was already spent by then, so the click quietly acted as stop. It now covers each of those, leaving out the text check since the transcript supplies it. Both engines can also end holding a partial transcript, the browser one through a recognition error and the local model one when a segment fails to transcribe. That text still belongs in the composer, but send no longer fires on it. The adapters flag the failure and the recording bar reads it after the session is gone. * fix(studio): scope the dictation send to its own thread and outcome The composer is reused across thread switches, so a send pressed in one thread could land after a move to another and submit that thread's draft. The pending send now records the composer it started in and drops the intent when it no longer matches. The failure flag moves off reportTranscriptionError, which is also the catch for the speculative model preload: that can fail transiently without costing any audio, and a complete transcript would then refuse to send. Only a lost segment marks the outcome partial now. Escape stays live while transcribing. Cancel aborts the in-flight request and both buttons are disabled, so it is the only way out of a stalled one. * fix(studio): key the pending dictation send on the thread list item referenceThreadId moves from null to the remote id when a new chat first persists, so the composite identity changed under the same composer and dropped a perfectly good send. The thread list item id does not move: the adapter initializes with the id the runtime passes in and returns it as the remote id, so both sides are the same string. * fix(studio): keep the branch chevrons on size-[36px] Renaming the send circles to size-9 also caught the two branch picker chevrons, which are glyphs, not buttons. index.css scales svg.size-[36px] through the 36px curve and has no size-9 selector, so they froze at 36px while the counter beside them kept tracking the UI font size. Measured against the built stylesheet: at scale 1.25 the class renders 40.5px and size-9 renders 36px, at 0.75 it is 27px against the same 36px. Every other size-9 on this branch is a button, which the glyph rules do not touch. * fix(studio): gate the dictation send on a published transcript Comparing composer text could not tell speech from an edit: the plus menu stays open while recording, so inserting a saved prompt looked like dictated text and a silent recording would submit it. Both engines publish exactly one final transcript, each behind a guard, so they now record that directly and the send requires it. The text comparison stays as well, so a transcript that never reached this composer still cannot send the draft that was already there. * fix(studio): hold the dictation send while an upload finishes The plus stays live during transcription, so an attachment started after send was pressed made handleSubmit reject a submit whose intent was already spent. The intent is now kept until the upload lands, and the effect reruns on it, so the message sends by itself. Session start is tracked explicitly with that dependency added: the base text is captured once per recording rather than on every rerun, and a new recording clears a send still held for an upload rather than firing it on the next stop. * fix(studio): one gate for the dictation send, and a cancel touch can reach The button gate and the pending send disagreed: an attachment added after the press could finish uploading before transcription, clearing the hold while leaving content that cannot be queued, so the submit bounced and the intent was gone. Both now read one predicate, dictationSendBlocked, and a pending send waits on it rather than being spent. Nothing-to-send is settled first, so a silent or cancelled recording never leaves an intent pending. Stop also discards on a second press once transcription starts, which is what Compare's dictation button already does. Escape was otherwise the only way to abort a stalled request, and touch has no way to press it. * fix(studio): drop a held dictation send when the composer is edited The recording bar is gone while a send waits on a block, so the hold has no indicator and no cancel. Replacing the transcript with another draft still satisfied the base-text comparison, so clearing the block sent that draft. The hold now lasts only as long as the transcript it was pressed for: the text is recorded when the send is first held, and any edit releases it. * fix(studio): read the reactive composer text in the dictation send effect The effect reruns on composerText to notice edits, so it should read that rather than a fresh getState of the same value. Also clears the lint error the extra dependency raised. --------- Co-authored-by: Unsloth <[email protected]>
Follow up to #7396. Text scales with the UI font size preference but the icons next to it stayed at fixed pixel sizes, so glyphs in menus, toasts and the chat surface never tracked the preference.
What changes
Standard icons render at a single shared token, --ui-icon-size, which follows the UI font size itself: it matches the setting below the 16px default and grows at half the change above it.
So setting 12 gives 12px icons, 16 gives 16px, and 20 gives 18px, keeping glyphs slightly smaller than enlarged text. Every glyph with a 16px or larger base uses the token uniformly (this also slims the previous 18px to 21px icon bases down to the font size at the default); sub 16px glyphs keep their proportions through the same curve as a factor. Hit targets, paddings and surface geometry stay fixed.
Verification
Tests