Skip to content

Commit e71a6a0

Browse files
fix(web): unify control sizing across settings pages
Settings rows mixed control heights freely: selects at 32px, inputs at 30px, buttons at 24/28/32px plus hand-pinned h-5/h-7/h-8 overrides, and the Keybindings page on its own compact scale. Integrations alone had three selects at one height and two at another. Every settings surface now follows three tiers: row controls use size="sm" (Button, Select, Input, NumberField) or icon-sm; section header actions and buttons inside list items, cards and toolbars use xs/icon-xs; inline affordances like reset arrows stay icon-micro. Dialog footers keep the app-wide default. The tiers are documented above SettingsRow. Switch gains a size="sm" variant replacing the ad-hoc --thumb-size overrides, ServerUpdateAction gains a size prop, and FontFamilyPicker reuses selectTriggerVariants instead of a hand-copied trigger. Co-Authored-By: Claude Code <[email protected]>
1 parent ca63d42 commit e71a6a0

20 files changed

Lines changed: 154 additions & 93 deletions

‎apps/web/src/components/BranchToolbarBranchSelector.tsx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -850,7 +850,7 @@ export function BranchToolbarBranchSelector({
850850
<Switch
851851
id={startFromOriginSwitchId}
852852
checked={startFromOrigin}
853-
className="[--thumb-size:--spacing(3.5)]"
853+
size="sm"
854854
aria-label="Start worktree from origin"
855855
onCheckedChange={(checked) => onStartFromOriginChange(Boolean(checked))}
856856
/>

‎apps/web/src/components/ServerUpdateAction.tsx‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@ export function ServerUpdateAction({
8383
targetVersion,
8484
label = "Update",
8585
variant = "outline",
86+
size = "xs",
8687
}: {
8788
readonly environmentId: EnvironmentId;
8889
readonly serverLabel: string;
@@ -95,6 +96,7 @@ export function ServerUpdateAction({
9596
readonly targetVersion: string;
9697
readonly label?: string;
9798
readonly variant?: ComponentProps<typeof Button>["variant"];
99+
readonly size?: ComponentProps<typeof Button>["size"];
98100
}) {
99101
const isDesktopAppUpdate = selfUpdate === "desktop-managed";
100102
const continueThreadsAfterServerUpdate = useClientSettings(
@@ -185,14 +187,14 @@ export function ServerUpdateAction({
185187
if (selfUpdate === null) {
186188
const command = manualServerUpdateCommand(targetVersion);
187189
return (
188-
<Button size="xs" variant={variant} onClick={() => copyToClipboard(command, { command })}>
190+
<Button size={size} variant={variant} onClick={() => copyToClipboard(command, { command })}>
189191
Copy update command
190192
</Button>
191193
);
192194
}
193195

194196
return (
195-
<Button size="xs" variant={variant} onClick={() => void handleUpdate()}>
197+
<Button size={size} variant={variant} onClick={() => void handleUpdate()}>
196198
{label}
197199
</Button>
198200
);

‎apps/web/src/components/settings/AddProviderInstanceDialog.tsx‎

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -380,9 +380,9 @@ export function AddProviderInstanceDialog({
380380
{accentColor ? (
381381
<Button
382382
type="button"
383-
size="sm"
383+
size="xs"
384384
variant="ghost"
385-
className="h-7 px-2 text-xs text-muted-foreground"
385+
className="text-muted-foreground"
386386
onClick={() => setAccentColor("")}
387387
>
388388
Clear
@@ -417,7 +417,6 @@ export function AddProviderInstanceDialog({
417417
<DialogFooter variant="bare">
418418
<Button
419419
variant="outline"
420-
size="sm"
421420
onClick={() => {
422421
if (wizardStep === 0) {
423422
onOpenChange(false);
@@ -429,13 +428,9 @@ export function AddProviderInstanceDialog({
429428
{wizardStep === 0 ? "Cancel" : "Back"}
430429
</Button>
431430
{wizardStep < ADD_PROVIDER_WIZARD_STEPS.length - 1 ? (
432-
<Button size="sm" onClick={() => navigateToStep(wizardStep + 1)}>
433-
Next
434-
</Button>
431+
<Button onClick={() => navigateToStep(wizardStep + 1)}>Next</Button>
435432
) : (
436-
<Button size="sm" onClick={handleSave}>
437-
Add instance
438-
</Button>
433+
<Button onClick={handleSave}>Add instance</Button>
439434
)}
440435
</DialogFooter>
441436
</div>

‎apps/web/src/components/settings/ConnectionsSettings.tsx‎

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -785,7 +785,7 @@ const PairingLinkListRow = memo(function PairingLinkListRow({
785785
Done
786786
</Button>
787787
{canCopyToClipboard ? (
788-
<Button variant="outline" size="xs" onClick={handleCopyCode}>
788+
<Button variant="outline" onClick={handleCopyCode}>
789789
Copy code
790790
</Button>
791791
) : null}
@@ -2784,7 +2784,7 @@ export function ConnectionsSettings() {
27842784
status={<span className="block text-destructive">{desktopWslError}</span>}
27852785
control={
27862786
<Button
2787-
size="xs"
2787+
size="sm"
27882788
variant="outline"
27892789
onClick={loadWslState}
27902790
disabled={isLoadingWslState}
@@ -2819,6 +2819,7 @@ export function ConnectionsSettings() {
28192819
}
28202820
control={
28212821
<Button
2822+
size="sm"
28222823
variant="outline"
28232824
disabled={isUpdatingWslBackend}
28242825
onClick={() => handleSelectWslMode(BACKEND_VALUE_WSL_OFF)}
@@ -2867,6 +2868,7 @@ export function ConnectionsSettings() {
28672868
}}
28682869
>
28692870
<SelectTrigger
2871+
size="sm"
28702872
className="w-full sm:w-56"
28712873
aria-label="WSL backend"
28722874
disabled={isUpdatingWslBackend}
@@ -3062,6 +3064,7 @@ export function ConnectionsSettings() {
30623064
primaryEnvironmentId !== null &&
30633065
primaryServerUpdateState.status !== "running" ? (
30643066
<ServerUpdateAction
3067+
size="sm"
30653068
environmentId={primaryEnvironmentId}
30663069
serverLabel={
30673070
primaryEnvironment ? `${primaryEnvironment.label} server` : "server"
@@ -3418,7 +3421,7 @@ export function ConnectionsSettings() {
34183421
<Button
34193422
size="xs"
34203423
variant="ghost"
3421-
className="h-5 gap-1 rounded-sm px-1 text-[11px] font-normal text-muted-foreground/60 hover:text-muted-foreground"
3424+
className="font-normal text-muted-foreground/60 hover:text-muted-foreground"
34223425
aria-label="Add environment"
34233426
>
34243427
<PlusIcon className="size-3" />

‎apps/web/src/components/settings/DiagnosticsSettings.tsx‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -793,13 +793,13 @@ function DiagnosticsRefreshButton({
793793
<TooltipTrigger
794794
render={
795795
<Button
796-
size="icon-micro"
796+
size="icon-xs"
797797
variant="ghost-muted"
798798
disabled={isPending}
799799
onClick={onClick}
800800
aria-label={label}
801801
>
802-
<RefreshCwIcon className={cn("size-3", isPending && "animate-spin")} />
802+
<RefreshCwIcon className={cn(isPending && "animate-spin")} />
803803
</Button>
804804
}
805805
/>
@@ -1129,13 +1129,13 @@ export function DiagnosticsSettingsPanel() {
11291129
<TooltipTrigger
11301130
render={
11311131
<Button
1132-
size="icon-micro"
1132+
size="icon-xs"
11331133
variant="ghost-muted"
11341134
disabled={!observability?.logsDirectoryPath || isOpeningLogsDirectory}
11351135
onClick={openLogsDirectory}
11361136
aria-label="Open logs folder"
11371137
>
1138-
<FolderOpenIcon className="size-3" />
1138+
<FolderOpenIcon />
11391139
</Button>
11401140
}
11411141
/>

‎apps/web/src/components/settings/FontFamilyPicker.tsx‎

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import {
1111
ComboboxPopup,
1212
ComboboxTrigger,
1313
} from "../ui/combobox";
14+
import { selectTriggerVariants } from "../ui/select";
1415

1516
const DEFAULT_FONT_VALUE = "__default__";
1617

@@ -203,14 +204,11 @@ export function FontFamilyPicker({
203204
void listRef.current?.scrollIndexIntoView?.({ index: eventDetails.index, animated: false });
204205
}}
205206
>
206-
<ComboboxTrigger
207-
aria-label={ariaLabel}
208-
className="relative inline-flex min-h-9 w-full min-w-36 cursor-pointer select-none items-center justify-between gap-2 rounded-lg border border-input bg-background px-[calc(--spacing(3)-1px)] text-left text-base text-foreground shadow-xs/5 outline-none transition-[color,box-shadow] focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/24 sm:min-h-8 sm:text-sm dark:bg-input/32"
209-
>
207+
<ComboboxTrigger aria-label={ariaLabel} className={selectTriggerVariants({ size: "sm" })}>
210208
<span className="min-w-0 truncate">
211209
{selectedFamily.length === 0 ? defaultFamily : selectedFamily}
212210
</span>
213-
<ChevronDownIcon className="-me-1 size-3 shrink-0 text-muted-foreground opacity-50" />
211+
<ChevronDownIcon className="-me-1 size-3 opacity-50" />
214212
</ComboboxTrigger>
215213
<ComboboxPopup align="end" className="flex w-72 flex-col">
216214
<div className="shrink-0 px-3 pt-2.5">

‎apps/web/src/components/settings/IntegrationsSettings.tsx‎

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -354,7 +354,7 @@ function BrowserZoomSetting({ disabled }: { readonly disabled: boolean }) {
354354
if (next !== undefined) updateSettings({ browserDefaultZoomFactor: next });
355355
}}
356356
>
357-
<SelectTrigger className="w-full sm:w-40" aria-label="Default browser zoom">
357+
<SelectTrigger size="sm" className="w-full sm:w-40" aria-label="Default browser zoom">
358358
<SelectValue>{zoomLabel(zoomFactor)}</SelectValue>
359359
</SelectTrigger>
360360
<SelectPopup align="end" alignItemWithTrigger={false}>
@@ -396,7 +396,11 @@ function BrowserAppearanceSetting({ disabled }: { readonly disabled: boolean })
396396
}
397397
}}
398398
>
399-
<SelectTrigger className="w-full sm:w-40" aria-label="Default browser appearance">
399+
<SelectTrigger
400+
size="sm"
401+
className="w-full sm:w-40"
402+
aria-label="Default browser appearance"
403+
>
400404
<SelectValue>{APPEARANCE_LABELS[appearance]}</SelectValue>
401405
</SelectTrigger>
402406
<SelectPopup align="end" alignItemWithTrigger={false}>
@@ -441,7 +445,11 @@ function BrowserRecordingFrameRateSetting({ disabled }: { readonly disabled: boo
441445
}
442446
}}
443447
>
444-
<SelectTrigger className="w-full sm:w-40" aria-label="Browser recording frame rate">
448+
<SelectTrigger
449+
size="sm"
450+
className="w-full sm:w-40"
451+
aria-label="Browser recording frame rate"
452+
>
445453
<SelectValue>{frameRate} fps</SelectValue>
446454
</SelectTrigger>
447455
<SelectPopup align="end" alignItemWithTrigger={false}>
@@ -706,7 +714,7 @@ function BrowserProfilesSetting({ disabled }: { readonly disabled: boolean }) {
706714
render={
707715
<span className="inline-flex" {...(!removalAvailable ? { tabIndex: 0 } : {})}>
708716
<Button
709-
size="icon-sm"
717+
size="icon-xs"
710718
variant="ghost-muted"
711719
disabled={profileWritesDisabled || !removalAvailable}
712720
aria-label={`Remove ${profile.name}`}

‎apps/web/src/components/settings/KeybindingsSettings.tsx‎

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -131,12 +131,12 @@ function ExpandableHeaderSearch({
131131
render={
132132
<Button
133133
type="button"
134-
size="icon-micro"
134+
size="icon-xs"
135135
variant="ghost-muted"
136136
onClick={() => onOpenChange(true)}
137137
aria-label="Search keybindings"
138138
>
139-
<SearchIcon className="size-3" />
139+
<SearchIcon />
140140
</Button>
141141
}
142142
/>
@@ -168,7 +168,7 @@ function ExpandableHeaderSearch({
168168
placeholder="Search keybindings"
169169
aria-label="Search keybindings"
170170
className="w-44 [&_[data-slot=input]]:pl-7"
171-
size="compact"
171+
size="sm"
172172
/>
173173
</div>
174174
);
@@ -850,7 +850,7 @@ function KeybindingKeyControl({
850850
<>
851851
{isDirty ? (
852852
<Button
853-
size="compact"
853+
size="sm"
854854
disabled={isSaving || keyDraft.trim().length === 0 || !isWhenDraftValid}
855855
onClick={save}
856856
>
@@ -863,7 +863,7 @@ function KeybindingKeyControl({
863863
onClick={() => setDraft({ isRecording: true })}
864864
aria-label={`Edit shortcut for ${commandLabel(row.command)}: ${formatShortcutLabel(row.binding.shortcut)}`}
865865
className={cn(
866-
"inline-flex h-7 cursor-pointer items-center rounded-md border border-transparent px-1.5 outline-none transition-colors hover:border-border/70 hover:bg-accent focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/24",
866+
"inline-flex h-8 cursor-pointer items-center rounded-md border border-transparent px-1.5 sm:h-7 outline-none transition-colors hover:border-border/70 hover:bg-accent focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/24",
867867
pillClassName,
868868
)}
869869
>
@@ -876,7 +876,7 @@ function KeybindingKeyControl({
876876
aria-label={`Keybinding for ${commandLabel(row.command)}`}
877877
value={isRecording ? "" : keyDraft}
878878
placeholder={isRecording ? "Press shortcut" : "Unassigned"}
879-
size="compact"
879+
size="sm"
880880
className={cn("w-44 font-mono", isRecording && "border-primary/70 bg-primary/5")}
881881
onFocus={() => setDraft({ isRecording: true })}
882882
onBlur={() => setDraft({ isRecording: false })}
@@ -954,7 +954,7 @@ function KeybindingRowMenu({
954954
type="button"
955955
variant="ghost"
956956
size="icon-sm"
957-
className="size-7 text-muted-foreground hover:text-foreground sm:size-7"
957+
className="text-muted-foreground hover:text-foreground"
958958
disabled={isSaving}
959959
aria-label={`Actions for ${commandLabel(row.command)}`}
960960
/>
@@ -1155,7 +1155,7 @@ function NewKeybindingCommandSelect({
11551155
value={draft.commandDraft}
11561156
onValueChange={(value) => draft.setCommandDraft(value as KeybindingCommand)}
11571157
>
1158-
<SelectTrigger size="compact" className={className}>
1158+
<SelectTrigger size="sm" className={className}>
11591159
<SelectValue placeholder="Command" />
11601160
</SelectTrigger>
11611161
<SelectContent
@@ -1189,7 +1189,7 @@ function NewKeybindingKeyInput({
11891189
aria-label={`Keybinding for ${draft.commandLabelText}`}
11901190
value={draft.isRecording ? "" : draft.keyDraft}
11911191
placeholder={draft.isRecording ? "Press shortcut" : "Unassigned"}
1192-
size="compact"
1192+
size="sm"
11931193
className={cn("font-mono", draft.isRecording && "border-primary/70 bg-primary/5", className)}
11941194
onFocus={() => draft.setDraft({ isRecording: true })}
11951195
onBlur={() => draft.setDraft({ isRecording: false })}
@@ -1233,7 +1233,7 @@ function NewKeybindingCancelIcon({
12331233
type="button"
12341234
variant="ghost"
12351235
size="icon-sm"
1236-
className="size-7 text-muted-foreground hover:text-foreground"
1236+
className="text-muted-foreground hover:text-foreground"
12371237
disabled={isSaving}
12381238
aria-label="Cancel new keybinding"
12391239
onClick={onCancel}
@@ -1271,7 +1271,7 @@ function NewKeybindingSettingsRow(props: NewKeybindingProps) {
12711271
/>
12721272
<KeybindingConflictWarning labels={draft.conflictLabels} />
12731273
<NewKeybindingKeyInput draft={draft} className="w-44" />
1274-
<Button size="compact" disabled={isSaving || !draft.canSave} onClick={draft.save}>
1274+
<Button size="sm" disabled={isSaving || !draft.canSave} onClick={draft.save}>
12751275
{isSaving ? "Saving" : "Save"}
12761276
</Button>
12771277
<NewKeybindingCancelIcon isSaving={isSaving} onCancel={onCancel} />
@@ -1514,12 +1514,12 @@ export function KeybindingsSettingsPanel() {
15141514
render={
15151515
<Button
15161516
type="button"
1517-
size="icon-micro"
1517+
size="icon-xs"
15181518
variant="ghost-muted"
15191519
onClick={() => setIsAddingBinding(true)}
15201520
aria-label="Add keybinding"
15211521
>
1522-
<PlusIcon className="size-3" />
1522+
<PlusIcon />
15231523
</Button>
15241524
}
15251525
/>
@@ -1530,13 +1530,13 @@ export function KeybindingsSettingsPanel() {
15301530
render={
15311531
<Button
15321532
type="button"
1533-
size="icon-micro"
1533+
size="icon-xs"
15341534
variant="ghost-muted"
15351535
disabled={!keybindingsConfigPath}
15361536
onClick={openKeybindingsFile}
15371537
aria-label="Open keybindings.json"
15381538
>
1539-
<FileJsonIcon className="size-3" />
1539+
<FileJsonIcon />
15401540
</Button>
15411541
}
15421542
/>

0 commit comments

Comments
 (0)