Repository navigation
refactor(studio): use Label for the settings switch labels (#2201 group B) - #2359
Merged
Merged
Conversation
Pins the Starter prompts, Show tools and model Visible labels: the label targets the switch, the switch keeps its accessible name, a click on the label toggles the switch once, and the text keeps its weight and line height. Refs #2340 Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
The Starter prompts and Show tools labels in Appearance and each model card's Visible label now use the Label primitive. font-normal keeps the text at its old weight against Label's font-medium; the text-sm and text-xs sizes already replace Label's leading-none, so line heights stay. Refs #2340 Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This was referenced Oct 15, 2026
kantord
approved these changes
Oct 15, 2026
kantord
left a comment
Member
There was a problem hiding this comment.
Thanks for this, the decision table covers every call site and the Label swaps are correct. Approving, with a few non-blocking nits:
- The tests assert that
font-mediumandleading-noneare absent. That ties them to class names rather than behaviour. The first two pins (the label wraps and targets the switch, one toggle per click) are the useful ones. - Where
leading-noneis dropped without an explicit override (Tool activity, model card), it relies on tailwind-merge treatingtext-sm/text-xsas conflicting withleading-*. That works and the test pins it, but it is implicit. - The Starter prompts Label has no text, so the swap has no visible effect there.
Fully or partially written by an AI agent.
Merged
2 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Handles the #2340 and #2337 call sites in
chat/tool-call-list.tsx,settings/interface-settings.tsxandsettings/settings-workspace.tsx, which #2352 skipped because other open PRs were changing those files at the time. Three native<label>elements move to the Label primitive. The tool-activity disclosure and the running-status pulse stay as they are; the decision table below gives the reasons. Names, roles, keyboard and pointer behaviour are unchanged, and every captured state is pixel-identical.Part of #2340
Part of #2337
Part of #2201
Part of #2210
What changed
settings/interface-settings.tsx: the Starter prompts and Show tools labels in Appearance → Chat are nowLabel.settings/settings-workspace.tsx: each model card's Visible label is nowLabel.font-normal, which keeps the text at its old weight against Label'sfont-medium. Their existingtext-smandtext-xsclasses already replace Label'sleading-nonethroughcn, so line heights stay. The Starter prompts label has no text, so Label's type classes have nothing to style.chat/tool-call-list.tsxis unchanged.Every call site
<label>,aria-expanded=,role="alert"andanimate-pulsein the three files. Lines are onmain(550c67fee); the #2352 base lines are in brackets.apps/web/src/features/)settings/interface-settings.tsx:183[181]<label>settings/interface-settings.tsx:219[208]<label>settings/settings-workspace.tsx:530[569]<label>settings/settings-workspace.tsx[150]<label>chat/tool-call-list.tsx:187[209]aria-expandedmainyet. Accordion doesn't fit: its trigger is wrapped in anh3, which would add a heading for every tool group in the transcript. It also brings its own chevron, padding and underline. Its content unmounts when closed unless forced, but the closed list keeps its rows in the document, hidden, so tool names stay findable. This site moves to Collapsible after #2352 merges.chat/tool-call-list.tsx:28animate-pulseNone of the three files has a
role="alert". Notitle=attribute was touched.Behaviour differences
None visible, and none to assistive technology. The label is still a
<label for>the switch. Label addsdata-slot="label". Radix Label also prevents text selection when the label text is double-clicked; a double-click on the switch itself is unaffected.No regression
Pins first (
bb17023de):settings/settings-switch-labels.pinning.test.tsx(3 tests), passing onmain's code and on the head. For each of the three labels, the tests check that:font-mediumnorleading-none.Existing tests also cover these controls:
settings-accessibility.test.tsx(44px label targets),settings-alignment.test.tsx(Starter prompts) andsettings-workspace.test.tsx(Visible). No existing test was modified.Mutation proof. Each mutation was applied alone, and the pin file was rerun:
font-normalfont-normalhtmlFortext-smtext-xsPixels. 16 captures: 2 surfaces × 2 states × desktop and 390px × light and dark. Each Before is
main's two files in the same tree, captured twice. After vs Before differs by 0 pixels in all 16, except 7 pixels in two mobile dark model captures, and those 7 pixels also differ between the two Before runs.pixel-report.txtScreenshots
Before (
main,550c67fee) | After (9f4d63c81) | Prototype (stack-08). Red boxes mark the labels this PR touches. They aren't diff boxes, because every pair is pixel-identical. The prototype columns show the closest prototype pages: Personalise for Appearance, and the provider's model table for Models. Studio keeps its own layout for both pages; this PR doesn't change it.Appearance → Chat, switches on. Pixel-identical. The Starter prompts switch matches the prototype's; the prototype has no Show tools row.
Models, Visible on. Pixel-identical. The prototype lists models in a table with an Enabled switch rather than in cards; Studio's cards are unchanged.
All 16 composites (open states: switches turned off by clicking their labels)
Appearance, switches on:
Appearance, both switches turned off by clicking their labels:
Models, Visible on:
Models, the first card's Visible turned off by clicking its label:
Gates
On the head (
9f4d63c81), run through the shared gate lock:task studio:check: passes. Server 252/252 tests (27 files); web 1589/1589 tests (182 files), 3 of them new.task studio:browser: 136 passed, 38 skipped, 0 failed.🤖 Generated with Claude Code