Skip to content

Commit f265549

Browse files
refactor(web): field controls stop restyling Input, Select, Combobox and Command
Drops every className restyle on the field-family ui exports (Input, NumberField*, InputGroup*, Combobox*, Select*, Command*, Autocomplete, Textarea). Only one ui file changes; everything else moves onto an existing variant or size, or restructures. Primitive change (a real concept, several consumers): - AutocompleteItem lays its children out with gap-2, like ComboboxItem content already does. Its only item consumer (SSH host suggestions) passed gap-2 by hand; CommandItem inherits it, so the palette and composer menus drop their gap overrides. Moved onto existing variants/sizes (drift, visible change accepted): - Dense numeric/hex inputs (browser viewport width/height, provider accent hex, theme token hex) use Input size="compact" + font="mono" instead of hand-shrunk sm inputs. The theme token hex field becomes a normal bordered compact input instead of a borderless tinted chip. - Keybinding "when" expression uses InputGroup + compact mono InputGroupInput with the unknown-condition warning as an inline-end addon; the header search uses InputGroup + addon icon instead of an absolutely placed icon and a reach-in padding override. Invalid state comes from aria-invalid, which the group already styles. - Keybinding recording state drops its primary tint; the focus ring and "Press shortcut" placeholder carry it. - Branch toolbar env/workspace selects and the branch combobox trigger lose their font/size/colour overrides; the branch trigger renders through ComposerControl size="xs", the owner of that resting look. - Diff panel base-ref trigger renders as Button ghost-muted size="xs" instead of a hand-built button recipe. - Legacy sidebar visible-thread stepper uses NumberField size="sm" as is. - ComboboxItem pe-* overrides, ComboboxItem font-medium, CommandGroupLabel and CommandFooter spacing tweaks, CommandDialogPopup p-0 (it has no padding), NumberField gap tweaks, redundant bg-background on Inputs, Textarea and AutocompleteEmpty text tweaks, SelectValue leading-7 and the StorageSettings NumberFieldInput padding are deleted outright. - ComposerCommandMenu rows use CommandItem's own padding and radius. Restructured: - Preview address bar: the hover-revealed "open in browser" button fades via a plain span inside the addon; the input no longer animates its padding. - Empty project-content search renders its message as a plain <p> instead of styling CommandPaletteContent's panel text. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
1 parent 2585a7e commit f265549

24 files changed

Lines changed: 72 additions & 90 deletions

‎apps/web/src/browser/BrowserDeviceToolbar.tsx‎

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -189,10 +189,7 @@ export function BrowserDeviceToolbar({
189189
<SelectTrigger
190190
variant="ghost"
191191
size="xs"
192-
className={cn(
193-
"shrink-0 justify-between px-1.5 font-medium",
194-
width >= 440 ? "w-36" : "w-24",
195-
)}
192+
className={cn("shrink-0 justify-between", width >= 440 ? "w-36" : "w-24")}
196193
aria-label="Browser device preset"
197194
>
198195
<SelectValue />
@@ -227,7 +224,8 @@ export function BrowserDeviceToolbar({
227224
nativeInput
228225
type="number"
229226
inputMode="numeric"
230-
size="sm"
227+
size="compact"
228+
font="mono"
231229
min={PREVIEW_VIEWPORT_MIN_DIMENSION}
232230
max={PREVIEW_VIEWPORT_MAX_DIMENSION}
233231
value={presentedSize.width}
@@ -245,16 +243,17 @@ export function BrowserDeviceToolbar({
245243
aria-label="Viewport width"
246244
aria-invalid={!customValid}
247245
className={cn(
248-
"h-6 rounded-md text-center tabular-nums [&_[data-slot=input]]:h-full [&_[data-slot=input]]:px-1 [&_[data-slot=input]]:text-xs [&_[data-slot=input]]:leading-none [&_[data-slot=input]::-webkit-inner-spin-button]:appearance-none [&_[data-slot=input]]:[appearance:textfield]",
249-
width >= 360 ? "w-14" : "w-11",
246+
"text-center [&_[data-slot=input]::-webkit-inner-spin-button]:appearance-none [&_[data-slot=input]]:[appearance:textfield]",
247+
width >= 360 ? "w-14" : "w-13",
250248
)}
251249
/>
252250
<span className="text-xs text-muted-foreground">×</span>
253251
<Input
254252
nativeInput
255253
type="number"
256254
inputMode="numeric"
257-
size="sm"
255+
size="compact"
256+
font="mono"
258257
min={PREVIEW_VIEWPORT_MIN_DIMENSION}
259258
max={PREVIEW_VIEWPORT_MAX_DIMENSION}
260259
value={presentedSize.height}
@@ -272,8 +271,8 @@ export function BrowserDeviceToolbar({
272271
aria-label="Viewport height"
273272
aria-invalid={!customValid}
274273
className={cn(
275-
"h-6 rounded-md text-center tabular-nums [&_[data-slot=input]]:h-full [&_[data-slot=input]]:px-1 [&_[data-slot=input]]:text-xs [&_[data-slot=input]]:leading-none [&_[data-slot=input]::-webkit-inner-spin-button]:appearance-none [&_[data-slot=input]]:[appearance:textfield]",
276-
width >= 360 ? "w-14" : "w-11",
274+
"text-center [&_[data-slot=input]::-webkit-inner-spin-button]:appearance-none [&_[data-slot=input]]:[appearance:textfield]",
275+
width >= 360 ? "w-14" : "w-13",
277276
)}
278277
/>
279278
</form>

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

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -704,7 +704,6 @@ export function BranchToolbarBranchSelector({
704704
key={itemValue}
705705
index={index}
706706
value={itemValue}
707-
className="pe-2"
708707
onClick={() => selectPickerItem(itemValue)}
709708
>
710709
<div className="flex min-w-0 items-center gap-2 py-1">
@@ -726,7 +725,6 @@ export function BranchToolbarBranchSelector({
726725
key={itemValue}
727726
index={index}
728727
value={itemValue}
729-
className="pe-1.5"
730728
onClick={() => selectPickerItem(itemValue)}
731729
>
732730
<span className="truncate">Create new ref &quot;{newRefName}&quot;</span>
@@ -754,7 +752,6 @@ export function BranchToolbarBranchSelector({
754752
key={itemValue}
755753
index={index}
756754
value={itemValue}
757-
className="pe-1.5"
758755
onClick={() => selectPickerItem(itemValue)}
759756
onContextMenu={(event) => handleBranchContextMenu(event, itemValue)}
760757
>
@@ -809,10 +806,10 @@ export function BranchToolbarBranchSelector({
809806
onContextMenu={(event) => handleBranchContextMenu(event, resolvedActiveBranch)}
810807
>
811808
<ComboboxTrigger
812-
render={<Button variant="ghost" size="xs" />}
809+
render={<ComposerControl size="xs" />}
813810
// No press-scale: the popup aligns live to this trigger, so a
814811
// momentary 0.97 shrink would drag the open popup ~3px sideways.
815-
className="min-w-0 max-w-full font-normal text-muted-foreground/70 text-xs! hover:text-foreground/80 active:scale-100"
812+
className="min-w-0 max-w-full active:scale-100"
816813
disabled={isInitialBranchesLoadPending || isBranchActionPending}
817814
>
818815
<GitBranchIcon className="size-3 shrink-0 opacity-70" />

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ export const BranchToolbarEnvModeSelector = memo(function BranchToolbarEnvModeSe
110110
<SelectTrigger
111111
variant="ghost"
112112
size="xs"
113-
className="min-w-0 shrink font-normal text-xs!"
113+
className="min-w-0 shrink"
114114
aria-label="Workspace"
115115
data-composer-shortcut="composer.workspace"
116116
data-composer-context-control

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ export const BranchToolbarEnvironmentSelector = memo(function BranchToolbarEnvir
102102
<SelectTrigger
103103
variant="ghost"
104104
size="xs"
105-
className="min-w-0 max-w-full font-normal text-xs!"
105+
className="min-w-0 max-w-full"
106106
aria-label="Run on"
107107
data-composer-shortcut="composer.host"
108108
data-composer-context-control

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -650,7 +650,7 @@ function CommandPaletteDialog(props: {
650650
? "Search project contents"
651651
: "Command palette"
652652
}
653-
className={cn("overflow-hidden p-0", props.mode === "content" && "h-105")}
653+
className={cn("overflow-hidden", props.mode === "content" && "h-105")}
654654
data-command-palette="true"
655655
data-palette-mode={props.mode}
656656
data-testid="command-palette"

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ export function CommandPaletteContent({
5050
{inputAccessory}
5151
</div>
5252
<CommandPanel className={panelClassName}>{children}</CommandPanel>
53-
<CommandFooter className="gap-3 max-sm:flex-col max-sm:items-start">
53+
<CommandFooter className="max-sm:flex-col max-sm:items-start">
5454
<div className="flex items-center gap-3">
5555
<KbdGroup>
5656
<Kbd>

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ export function CommandPaletteResults(props: CommandPaletteResultsProps) {
4141
<CommandList>
4242
{props.groups.map((group) => (
4343
<CommandGroup items={group.items} key={group.value}>
44-
<CommandGroupLabel className="ps-[9px]">{group.label}</CommandGroupLabel>
44+
<CommandGroupLabel>{group.label}</CommandGroupLabel>
4545
<CommandCollection>
4646
{(item) =>
4747
item.disabled ? (
@@ -109,7 +109,6 @@ function CommandPaletteResultRow(props: {
109109
<CommandItem
110110
value={props.item.value}
111111
active={props.isActive}
112-
className="gap-2"
113112
onMouseDown={(event) => {
114113
event.preventDefault();
115114
}}

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,6 @@ function CustomSnoozeDialog() {
169169
) : (
170170
<div className="grid grid-cols-1 gap-3 sm:grid-cols-2">
171171
<NumberField
172-
className="gap-1.5"
173172
id={`${id}-amount`}
174173
min={0}
175174
step="any"

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -749,7 +749,8 @@ export default function DiffPanel({
749749
}}
750750
>
751751
<ComboboxTrigger
752-
className="inline-flex min-w-0 max-w-48 items-center gap-1 overflow-hidden rounded-md px-1.5 py-1 outline-none transition-colors hover:bg-muted hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring"
752+
render={<Button variant="ghost-muted" size="xs" />}
753+
className="min-w-0 max-w-48"
753754
aria-label={`Change comparison target. Currently ${selectedGitSource.baseRef}`}
754755
>
755756
<span className="min-w-0 truncate">{selectedGitSource.baseRef}</span>

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

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2784,30 +2784,29 @@ function ProjectSortMenu({
27842784
<div className="px-2 py-1">
27852785
<NumberField
27862786
aria-label="Visible thread count"
2787-
className="w-28 gap-0"
2787+
className="w-28"
27882788
max={MAX_SIDEBAR_THREAD_PREVIEW_COUNT}
27892789
min={MIN_SIDEBAR_THREAD_PREVIEW_COUNT}
27902790
onValueChange={handleThreadPreviewCountChange}
27912791
size="sm"
27922792
step={1}
27932793
value={threadPreviewCount}
27942794
>
2795-
<NumberFieldGroup className="h-7 rounded-md sm:h-6.5">
2795+
<NumberFieldGroup>
27962796
<NumberFieldDecrement
27972797
aria-label="Decrease visible thread count"
2798-
className="px-2 sm:px-2 [&_svg]:size-3.5"
2798+
className="[&_svg]:size-3.5"
27992799
/>
28002800
<NumberFieldInput
28012801
aria-label="Visible thread count"
2802-
className="h-7 w-9 grow-0 px-0 text-xs leading-7 sm:h-6.5 sm:leading-6.5"
28032802
inputMode="numeric"
28042803
onKeyDownCapture={(event) => {
28052804
event.stopPropagation();
28062805
}}
28072806
/>
28082807
<NumberFieldIncrement
28092808
aria-label="Increase visible thread count"
2810-
className="px-2 sm:px-2 [&_svg]:size-3.5"
2809+
className="[&_svg]:size-3.5"
28112810
/>
28122811
</NumberFieldGroup>
28132812
</NumberField>

0 commit comments

Comments
 (0)