Skip to content

Studio: one padding for every main button - #15122

Merged
shimmyshimmer merged 15 commits into
mainfrom
studio-button-padding
Oct 25, 2026
Merged

shimmyshimmer merged 15 commits into
mainfrom
studio-button-padding

Conversation

@shimmyshimmer

@shimmyshimmer shimmyshimmer commented Oct 24, 2026 •

Copy link
Copy Markdown
Member

Studio: one padding for every main button

Filled action buttons came in five shapes: 32px and 36px tall, 40px tall with 28px sides, 20px or 14px sides. They now all have 12px from the edge to the label (or its icon) at the sides and 8px above and below the label's line, so "New chat", "Generate", "Export", "Eject" and every Settings action read as the same control.

What changed

  • Button: the filled variants (default, dark, primary, outline, secondary, muted, destructive) share one shape at every text size (default, sm, lg, hero). The height comes from the label's line plus 8px above and below, with the 1px border counted, instead of a fixed height.

  • Dropdown buttons (a trailing chevron or other icon) get 15px on the label side and 14px on the chevron side, because the chevron glyph sits inset in its box; the label sits 15px from the left edge and the chevron about 18px from the right.

  • Icons never set the padding. A leading or trailing icon gets the same 12px side as a plain label, and icons take no block space, so a larger glyph cannot make a button taller.

  • Per-call height and padding overrides on filled buttons are removed (Images, Video and Audio Generate/Stop, Library New chat, Run settings Load model/Reset/Share, update banners, Settings actions, and others), and the hand-built main buttons follow the same rule (Library and Chats New menus, Hub Run, Load more and Clear filters, the Data tab's archive buttons, browser downloads and annotate, the reload prompt).

  • The API page's model trigger label had leading-none inside a truncating span, which cropped the tails of g, p, q and y. It now has a full line.

  • Settings > Data: the Archive all chats row button is now just the archive icon (labelled for screen readers and on hover); the confirm dialog keeps its text.

Left alone on purpose: ghost and link buttons, icon-only buttons, xs chips, toggles and segmented controls, value pickers, and option cards.

Verification

  • npm run typecheck, npm test (13,859 pass) and npm run build.
  • Two isolated Studios (main and this branch), measured with Playwright across Chat, Library, Images, Video, Audio, Studio, Export, Hub, Data Recipes, API Monitor, all 18 Settings tabs and Run settings:
    • main: 1 of 100 filled Settings and Run settings buttons at 12px sides; this branch: every filled action button at 12px sides, the rest being the pickers, one toggle and one card listed above.
    • every icon button has exactly 8px between its label's line and its top and bottom edges.
    • 121 filled text buttons checked for clipped descenders: 0 clipped.

Screenshots

Same buttons on main (left) and this branch (right). Library New chat had 20px sides, Images Generate was 40px tall with 28px sides, API Eject had 14px sides:

Before and after: filled buttons

Icon buttons: + Add and Archive all keep 12px sides next to the icon, Hub Run loses its fixed 112px width, and Library New drops its 16px left side:

Before and after: icon buttons

Not covered here

  • Dialogs and banners that need a particular state to open were checked in code, not on screen.
  • The Desktop startup and update screens use the hero size; Desktop builds are not run from this host.
  • At the default text size, filled buttons are 34.75px tall instead of 36px, in line with the 34.9px pickers beside them. Some compact buttons in dense panels grow from 28 to 32px to that height.

Filled Buttons (default, dark, primary, outline, secondary, muted, destructive) at sm, lg and hero now share the default 36px height and 12px side padding, and the per-call height and padding overrides on those buttons are gone. Ghost and link buttons, icon buttons, xs chips, toggles, pickers and option cards keep their sizes.
Run settings' Load model, Reset and Share used 16px sides from their own footer class, and the Data tab's archive buttons were 39px tall; both now take 36px and 12px sides.
Filled buttons no longer trim the side next to a leading or trailing icon to 10px, so an icon button has the same 12px sides as a plain one; the Decisions Run button drops its own uneven padding. The API page's model trigger label had leading-none inside a truncating span, which cropped the tails of g, p, q and y; it now gets a 20px line.
Filled buttons take their height from the label's line plus 8px above and below instead of a fixed 36px, and their icons get a negative block margin so a larger glyph cannot push the padding out. The 1px border now counts toward the 12px sides and 8px top and bottom. The Library New menus, the Hub Run, Load more and Clear filters buttons, and the other hand-built main buttons follow the same rule.
shimmyshimmer added a commit to shimmyshimmer/unsloth-staging-4 that referenced this pull request Oct 24, 2026
shimmyshimmer added a commit to shimmyshimmer/unsloth-staging-4 that referenced this pull request Oct 24, 2026
shimmyshimmer pushed a commit to shimmyshimmer/unsloth-staging-4 that referenced this pull request Oct 24, 2026
@danielhanchen

Copy link
Copy Markdown
Member

Two reds here:

  1. Repo tests (CPU, studio) comes from this PR's padding change in images-page.tsx:

    tests/studio/test_desktop_reliability_frontend_contract.py::test_the_lengths_these_contracts_measure_still_follow_the_ui_scale
        images-page.tsx states 1 scaled !h-34px, not 2
    

    The contract expects two !h-[calc(34px*var(--ui-space-scale,1))] heights in images-page.tsx, and only one is left. If the second one was replaced by the shared button padding on purpose and still scales with the UI size setting, lower the expected count for that row in _LENGTHS_THAT_MUST_KEEP_THE_SCALE in this PR. If it became a fixed length, it needs the calc(...*var(--ui-space-scale,1)) form back.

  2. Inline images (windows-latest): only the chrome channel failed, on its first check (path: plot.png, Condition timed out). chromium, firefox, webkit and msedge passed every check in the same job, so this looks like a first-load timeout rather than something this PR changed. I'll rerun it once the workflow finishes.

Images and Video put Cancel load in the header row of 34px pills; it keeps the shared side padding but stays the row's height, as the desktop contract test expects.
@shimmyshimmer

Copy link
Copy Markdown
Member Author

@codex security review

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 24, 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 🔄 Running since 2026-10-25T02:28:21.916086Z 8099112 Manual request
🔒 Security Review ✅ Completed 2026-10-24T12:41:29.523640Z 9fb4568 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. What shall we delve into next?

Reviewed commit: 9fb4568836

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

@chatgpt-codex-connector

Copy link
Copy Markdown

🛡️ Codex Security Review

Security review completed. No security issues were found in this pull request.

Reviewed commit: 9fb4568836

View security finding report

Only the user who started this review can view the report in Codex.

ℹ️ About Codex security reviews in GitHub

This is an experimental Codex feature. Security reviews are triggered when:

  • You comment "@codex security review"
  • A regular code review gets triggered (for example, "@codex review" or when a PR is opened), and you’re opted in so security review runs alongside code review

Once complete, Codex will leave suggestions, or a comment if no findings are found.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Breezy!

Reviewed commit: 6e75e2a67d

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

@chatgpt-codex-connector

Copy link
Copy Markdown

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

Reviewed commit: 6e75e2a67d

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

# Conflicts:
#	studio/frontend/src/features/api-monitor/components/api-model-load-controls.tsx
#	studio/frontend/src/features/model-picker/components/model-config-page.tsx
#	studio/frontend/src/features/settings/components/cache-storage-rows.tsx
The Data tab's Archive all row button shows just the archive icon, labelled for screen readers and on hover; the confirm dialog keeps its text.
A chevron glyph sits inset in its icon box, so with 12px sides a dropdown button read as tight on the label side. Buttons ending in an icon (and the Library New menus) now use the select trigger's 15px from edge to content: label 15px from the left edge, chevron about 19px from the right, matching the Appearance selects.
chatgpt-codex-connector[bot]

This comment was marked as resolved.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Breezy!

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

@unslothai unslothai deleted a comment from chatgpt-codex-connector Bot Oct 25, 2026
@shimmyshimmer

Copy link
Copy Markdown
Member Author

@codex review

@shimmyshimmer
shimmyshimmer merged commit 3bf5e85 into main Oct 25, 2026
11 of 41 checks passed
@shimmyshimmer
shimmyshimmer deleted the studio-button-padding branch October 25, 2026 02:35
shimmyshimmer added a commit that referenced this pull request Oct 26, 2026
…lish (#15232)

## Studio: control heights, composer fades, API page layout, settings
polish

A round of UI fixes on top of #15122 (one padding for every main
button).

### Fields and pickers line up with buttons
- In Settings, every option dropdown (selects and picker-style menus, 55
across the tabs) has one height, a filled Button's, with 14px sides, a
pill shape and regular text-sm; they were 32, 34.75 or 36px with some at
11.25px, 12px sides or 16px corners. Scoped to `[data-settings-dialog]`,
so other pages keep their pickers; action menus (Export, Delete all)
keep the button look.
- New `h-control` / `size-control` utilities give a field or picker the
filled Button's height (label line + 7px padding + 1px border) at every
UI font size.
- Applied only where a field or picker shares a row with a filled
button: Settings rows (HF token and endpoint, upload cap, idle seconds,
sandbox memory, llama.cpp path and backend, LAN port and addresses,
first-token timeout, dictation search and sort, embedding model picker),
the accounts search, the API key form, Projects and Tasks search, and
the Hub folders dialog. Shared `Input`, `SelectTrigger` and icon
`Button` defaults are unchanged, so Images, Video and other pages look
as before.
- Dropdown rows round up to a whole pixel (`min-h-menu-row`), so the
last hover pill and the menu's bottom edge no longer sit between pixels.
A label pads itself the same way.

### Composer
- The circular Stop buttons (Stop generating, research, queued message,
dictation) draw their square at about 31% of the circle, up from 26%,
and the queue Resume button's play glyph is 1.125x the icon size (18px
at the default scale, from 16px), about a third of the circle's height.
The send arrow keeps its size.
- Stop, Send and Resume glyphs round up to an even pixel size, so their
offset in the circle is a whole pixel. At UI scales where the glyph came
out fractional (13.125px Stop, 19.5px Send) the browser snapped it up
and left; measured at 2x, Stop sat 1px left and 0.5px up, Send 0.5px
both ways, and both are now centred. Browsers without CSS `round()` keep
the unrounded size.
- Text cut off at the bottom fades; the last line of any draft gets a
faint fade on its descenders, and lines scrolled past the top fade once
you scroll.
- The scrollbar sits 8px from the composer edge instead of 14px; text
does not move.
- On the welcome screen, expanding the composer keeps its bottom edge
fixed and grows upward. Before, the whole composer jumped up and grew
only to a viewport clamp that, on a short window, barely exceeded a long
draft's compact height (#10863).
- Attachment tiles are 14px round instead of 16px. The remove X is white
in light mode and black in dark mode with a 1px outline.
- The scroll-to-bottom button has a 0.5px ring. Its edge came from the
outline Button border that #14919 replaced with a fill.

### Chat messages
- The context usage popup (Chat header and API page) uses the dropdown
surface instead of the black tooltip: popover background and text, the
menu radius, the body font, the menus' soft shadow in light mode and
page-coloured glow in dark mode.
- The Response stopped bar's Resume icon sits on its label's centre line
instead of 3.4px above it. As the button's last element (the label was
bare text), the icon lost its bottom margin to the message's
trailing-margin reset, so its box centred off-axis, and the button took
the trailing-icon padding. The label is a span now.
- The composer's solid play (Resume queue) is optically centred in its
circle: its box was exactly centred, which left the triangle's weight
1.7px left of the middle; it moves right by 1/12 of its width.
- Numbered list markers stay inside the message column. A fixed 1.25rem
gutter let "10." (and "1." at a larger chat font) hang past the
composer's edge; the gutter is now in em and widens at 10 and 100 items.

### API page
- The model picker sits in the top-left bar like Chat, Images and Video,
with Chat's label size and font. With nothing loaded it reads Load
models, since the page can serve several.
- The Base URL card lists every served model the same way, one or many
("1 model answering requests", "No models loaded"). Each row has the
code example beside its name and Run settings, Reload and Eject at its
end.
- Card buttons read Reload / Eject for one model and Reload all / Eject
all for several. Reload all reloads every served model, kept ones first
so the primary stays primary; with nothing served it reloads the last
local load as before. The reload logic moves to
`use-api-model-reload.ts`. A row reloads by its checkpoint (not a kept
slot's public alias), an MLX precision folder reloads as a model rather
than a GGUF quant, and an AMD NPU model goes through the NPU loader, as
the picker does.
- Each row shows Context with Chat's context chip, its ring in front of
the count and sized like the row's other icons: the latest request's
prompt plus reply against that request's window. Hover shows the usage,
prompt and completion split; a click pins it until a click elsewhere or
Escape (`pinOnClick`, opt-in, so Chat's chip is unchanged). Only
requests since the model's latest load count, and requests logged as
`<id>:<quant>` match their model.
- The row icons and the Context chip share one hover: the icons take the
chip's colour in dark mode, the chip takes the icons' colour in light
mode, and on this page the chip hovers as a full pill (`hoverClassName`,
opt-in, so Chat's chip is unchanged).
- A row's code example icon shows only while that row is hovered or the
icon has keyboard focus (always on touch). Rows are subgrids rather than
`display: contents`, so the whole row, gaps included, is the hover
target.
- After Context each row shows Speed (generation tok/s), Total time
(average per request: queue wait, prompt processing and generation) and
Requests (with errors in red), over requests since the model's latest
load. Icons stand in for the labels (the lightning and timer from the
request log, arrows for requests); the label stays in the hover title
and for screen readers.
- The page works at every width down to phones. Under a narrow card a
model row stacks: the name on its own line (wrapping, never cut), then
the facts and its buttons. The summary tiles go 2, 3 or 6 across by the
page's own width rather than the window's, so the sidebar no longer
squeezes six tiles into cut-off labels, and the settings button stays
beside the title.
- The rows drop the Slots fact. It only existed for the primary model,
read "0/4 busy" nearly always, and opened the same Run settings as the
gear; queued requests still show under In flight.
- Fixed: after the code example dialog closed, the Context popup never
opened again. The shared Tooltip latched every controlled tooltip shut
when a modal opened, until its owner next said false; one that was
already shut never says it again. The latch now applies only to a
controlled tooltip that was open.
- Empty-state icons are borderless circles; the saved load settings
forget button is red.
- The page fades into the sticky picker bar with Chat's 24px header fade
instead of cutting off under it.

### Hub
- The Run button's label and play icon are white in both themes (they
used the success foreground, which is dark), and it has 15px of right
padding against 12px on the left, since the play glyph's empty side
already reads as left padding.

### Audio
- The Record button (Clone, Edit and the other pages with an Upload /
Record / From history source) uses the composer's microphone instead of
Hugeicons `Mic01Icon`.

### Settings and sidebar
- Settings > API: Create token uses the dark action button and is never
disabled for an empty name. An unnamed token is called New Token N, one
past the highest N in use (translated in every locale); the name field
reads Token name. The expiry presets and Create token have tooltips
(Create token names the token it will make).
- Settings > API: access tokens are a table with Name, Token, Created,
Last used and Expires columns. The token created panel, its field and
the rows use the standard settings card, input and hover styles instead
of the green panel, and the field no longer draws a focus ring around
the preselected token.
- Settings > API: the row menu adds Regenerate token, which makes a
token with the same name and expiry period and then revokes the old one,
after a confirmation. The new token is created first, so a failed create
leaves the old one working.
- Settings > API is regrouped: access first (tokens, usage examples,
keyless access, MCP access), then the monitor link and model controls
(memory, auto-switch, aliases), then the audio, image and video, and
decision APIs.
- Danger zone draws its divider above the heading, not under it.
- Card icons (Remote access, LAN, Keyless API, MCP, Decision API,
monitor) are borderless filled circles in both themes.
- Sidebar New pills use the API page's green chip (`Badge` variant
`accent`); #14938 had turned them grey through the shared secondary
fill.
- The sidebar More menu has pill hover rows in a matching corner radius.
- The remaining lucide trash icons (API saved settings, prompt storage,
OpenAI code exec, research panel, generation presets) use the Hugeicons
`Delete02Icon` used everywhere else.
- Controls that reload something draw Hugeicons' two-arc reload glyph
(`Refresh04Icon`, re-exported as `ReloadIcon` from `lib/reload-icon.ts`;
the package's own `ReloadIcon` is an older shape with bent arc ends):
Images and Video Reapply (reloads the model), the in-app browser's
Reload and Run again, and the browser tab menu's Reload (was lucide
`RotateCw` / `Refresh01Icon`). Refresh, retry, regenerate and update
keep `Refresh01Icon`.
- Settings > Resources lists Model memory right after GPU devices, above
the inference engine sections.
- Settings > API gets a Model memory section with the two rows that
decide what the server can answer: Keep model in GPU memory and Keep
multiple models loaded. Same controls and saved values as Resources
(`ModelMemorySection variant="api"`). A System settings link beside the
heading opens System settings scrolled to Model memory for the rest
(label in every locale).

### UI parity
- The studiobench thread-structure check reports every action's thread
scaffolding 84 or 172 characters longer. That is intended: it is the
composer's new fade wrappers and control-height classes around the
thread, not message content. The PR carries the `affects UI#` label for
it.
- The startup bundle budget is raised by this PR's measured growth
(2,639 B raw / 717 B transfer, mostly the new strings in the eager
locales), with the numbers in the comment above `BUDGET`.
- The queue Resume glyph is deliberately right of geometric centre
(optically centred), so `playwright_queue_localization.py` now asserts
that offset instead of exact centring.

## Verification
- `npm run typecheck`, `npm test` (13,947 pass, 0 fail), `npm run
i18n:check:strict`, `npm run build`.
- An isolated Studio from this branch, driven with Playwright:
- A scan of every page and Settings tab for a filled button beside a
control of a different height found 13 mismatches before and none after,
at UI font scales 0.8, 1 and 1.25.
- Menus measured at whole-pixel row heights with equal top and bottom
gaps (8px / 8px, 6px / 6px).
- Welcome composer expansion keeps the bottom edge fixed (650px window:
296-650 to 133-650; 900px window: 376-522 to 144-522).
- The API card was checked with one real GGUF model and with three
models (two faked in the browser by rewriting the status responses).
- The API page at 375, 768, 1024 and 1440px wide: no horizontal
overflow, and the row's ring and icons measure 14px on one centre line.
- Token regenerate run against a token the script created with a 30 day
expiry: the new token kept 30 days, the old one was revoked.

## Not covered here
- Reloading several real models at once (keep-models-loaded mode) was
not exercised; it was checked with one model and by reading the runtime
code.
- Desktop (Tauri) builds were not run from this host; the list marker
fix was checked in Chromium with overlay scrollbars.
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.

2 participants