Skip to content

Studio: modern toggles, 34 x 20 with a flat centred thumb - #14322

Merged
shimmyshimmer merged 10 commits into
mainfrom
studio-modern-switch
Oct 20, 2026
Merged

shimmyshimmer merged 10 commits into
mainfrom
studio-modern-switch

Conversation

@shimmyshimmer

@shimmyshimmer shimmyshimmer commented Oct 20, 2026 •

Copy link
Copy Markdown
Member

What changed

Every toggle in Studio (components/ui/switch.tsx, used across Settings and the app) gets a cleaner, more modern look:

  • Default size goes from 32 x 18.4 to 34 x 20, with a flat 16 px white thumb on an even 2 px inset (the small size becomes 26 x 16 with a 12 px thumb).
  • The off track is a soft neutral wash (13% of the foreground in light, 22% in dark) instead of bg-input, and darkens slightly on hover. The on track stays --control-accent, so palettes keep their own colour, and hovering it darkens it a touch.
  • The 1 px transparent border is gone; the inset is padding, and the thumb slides 200 ms ease-out (off with reduced motion). Focus shows a soft ring.
  • The inset is kept to whole pixels on purpose: at 2.5 px the thumb rounded one device pixel off centre at both 1x and 2x.

Verification

  • npm run typecheck and npm run build pass; the tests that read the switch (general-settings-token-sync, account-permissions, export-hub-repo-required) pass. Biome reports nothing new in switch.tsx.
  • Isolated Studio built from this branch, Playwright (Chromium), Settings > Appearance, General, Chat, Browser, Voice, Library, System and Data: every default toggle measures 34 x 20 with a 16 px thumb, 2 px from the edge in both states, and edge measurements put the checked thumb 2.07 px from the top and bottom and 2.09 px from the end at 1x (4.03 / 4.04 / 4.03 device px at 2x).

Settings > Appearance sidebar items, before and after at the same scale (before = this PR's merge base, same Studio and window, only switch.tsx swapped).

Toggles before and after, light

Toggles before and after, dark

One checked toggle at 2x, enlarged: the same amount of track above and below the thumb.

Centred thumb, enlarged

shimmyshimmer added a commit to shimmyshimmer/unsloth-staging-4 that referenced this pull request Oct 20, 2026
shimmyshimmer added a commit to shimmyshimmer/unsloth-staging-4 that referenced this pull request Oct 20, 2026
shimmyshimmer added a commit to shimmyshimmer/unsloth-staging-4 that referenced this pull request Oct 20, 2026
shimmyshimmer added a commit to shimmyshimmer/unsloth-staging-4 that referenced this pull request Oct 20, 2026
shimmyshimmer added a commit to shimmyshimmer/unsloth-staging-4 that referenced this pull request Oct 20, 2026
shimmyshimmer added a commit to shimmyshimmer/unsloth-staging-4 that referenced this pull request Oct 20, 2026
@shimmyshimmer

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 20, 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-10-20T08:36:38.780146Z e80fefb 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. Delightful!

Reviewed commit: e80fefb8bf

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

danielhanchen commented Oct 20, 2026 •

Copy link
Copy Markdown
Member

Frontend build + bundle sanity fails on this PR's own growth:

over the startup budget: raw 6684.6 KB > 6684.4 KB

The run is against current main (360cd9a, which already includes the #14319 budget raise), and main builds within budget there with about 0.2 KB to spare, so the new switch.tsx adds roughly 0.4 KB raw to the startup set. If the extra styling has to ship, raise BUDGET in studio/frontend/scripts/check-bundle-budget.ts in this PR with a comment entry giving the measured build; otherwise trimming the class strings back under 0.2 KB of growth clears it.

shimmyshimmer added a commit to shimmyshimmer/unsloth-staging-4 that referenced this pull request Oct 20, 2026
shimmyshimmer added a commit to shimmyshimmer/unsloth-staging-4 that referenced this pull request Oct 20, 2026
shimmyshimmer added a commit to shimmyshimmer/unsloth-staging-4 that referenced this pull request Oct 20, 2026
@shimmyshimmer shimmyshimmer changed the title Studio: modern toggles, 42 x 23 with a flat centred thumb Studio: modern toggles, 42 x 21 with a flat centred thumb Oct 20, 2026
shimmyshimmer added a commit to shimmyshimmer/unsloth-staging-4 that referenced this pull request Oct 20, 2026
shimmyshimmer added a commit to shimmyshimmer/unsloth-staging-4 that referenced this pull request Oct 20, 2026
shimmyshimmer added a commit to shimmyshimmer/unsloth-staging-4 that referenced this pull request Oct 20, 2026
@shimmyshimmer shimmyshimmer changed the title Studio: modern toggles, 42 x 21 with a flat centred thumb Studio: modern toggles, 36 x 21 with a flat centred thumb Oct 20, 2026
shimmyshimmer added a commit to shimmyshimmer/unsloth-staging-4 that referenced this pull request Oct 20, 2026
shimmyshimmer added a commit to shimmyshimmer/unsloth-staging-4 that referenced this pull request Oct 20, 2026
shimmyshimmer added a commit to shimmyshimmer/unsloth-staging-4 that referenced this pull request Oct 20, 2026
@shimmyshimmer shimmyshimmer changed the title Studio: modern toggles, 36 x 21 with a flat centred thumb Studio: modern toggles, 34 x 20 with a flat centred thumb Oct 20, 2026
shimmyshimmer pushed a commit to shimmyshimmer/unsloth-staging-4 that referenced this pull request Oct 20, 2026
@shimmyshimmer
shimmyshimmer merged commit 37f5374 into main Oct 20, 2026
@shimmyshimmer
shimmyshimmer deleted the studio-modern-switch branch October 20, 2026 10:29
danielhanchen added a commit that referenced this pull request Oct 20, 2026
## Problem

`Frontend build + bundle sanity` is red again for PRs based on current
main. Main builds over the startup budget:

```
eager startup JS: 6684.5 KB raw, 2012.8 KB transfer, 96 chunks
over the startup budget: raw 6684.5 KB > 6684.4 KB
```

## Measurement

Exact totals, one machine and build, Node 24, 96 chunks throughout:

| Commit | Raw (B) | Transfer (B) |
|---|---|---|
| 3c68c2a (#14324) | 6,844,622 | 2,061,046 |
| ad2fc06 (#14329) | 6,844,459 | 2,061,006 |
| 37f5374 (#14322, modern toggles) | 6,844,908 | 2,061,092 |

#14322 adds 449 B raw / 86 B transfer. `switch.tsx` is a shared
primitive that is already in the startup chunks, so this is ordinary
growth and the chunk count is unchanged. #14329 had removed 163 B just
before.

## Change

`BUDGET` in `studio/frontend/scripts/check-bundle-budget.ts` is raised
to the main build plus the same 160 B raw / 189 B transfer margin:
`rawBytes` 6,845,068 and `transferBytes` 2,061,281. A comment entry
records the numbers.

## Testing

`npm ci && npm run build && npx tsx scripts/check-bundle-budget.ts` on
this branch: `within budget (0.2 KB transfer, 0.2 KB raw to spare)`. On
main, the over-budget output above.
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