Skip to content

Commit 08bbab3

Browse files
refactor(web): one row height for select, combobox and radio items
Twelve list rows re-declared their own height and padding: compact (min-h-7 py-1 text-xs) in the keybinding editor and the legacy sidebar sort menu, roomy (py-2) in two settings selects, pinned (h-8 py-0) in the project-scope and base-ref pickers. A list row has one height. Visible effect: keybinding editor rows grow from 28px to 32px on touch and read at text-sm; the composer mode and project-defaults selects lose 4px of row padding; the project-scope and base-ref rows go from 32px to 28px on desktop. Lowers the no-restyle ceiling from 782 to 762. Co-Authored-By: Claude Fable 5 <[email protected]>
1 parent c5e744d commit 08bbab3

8 files changed

Lines changed: 12 additions & 17 deletions

File tree

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -773,7 +773,7 @@ export default function DiffPanel({
773773
<ComboboxEmpty>No matching refs.</ComboboxEmpty>
774774
<ComboboxList className="max-h-64 min-w-0 overflow-x-hidden">
775775
<ComboboxItem
776-
className="h-8 w-full min-w-0 grid-cols-[1rem_minmax(0,1fr)] py-0"
776+
className="w-full min-w-0 grid-cols-[1rem_minmax(0,1fr)]"
777777
contentClassName="w-full min-w-0 overflow-hidden"
778778
value={AUTOMATIC_BASE_REF}
779779
>
@@ -786,7 +786,7 @@ export default function DiffPanel({
786786
return (
787787
<ComboboxItem
788788
key={choice.id}
789-
className="h-8 w-full min-w-0 grid-cols-[1rem_minmax(0,1fr)] py-0"
789+
className="w-full min-w-0 grid-cols-[1rem_minmax(0,1fr)]"
790790
contentClassName="w-full min-w-0 overflow-hidden"
791791
value={item}
792792
>

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2758,7 +2758,7 @@ function ProjectSortMenu({
27582758
>
27592759
{(Object.entries(SIDEBAR_SORT_LABELS) as Array<[SidebarProjectSortOrder, string]>).map(
27602760
([value, label]) => (
2761-
<MenuRadioItem key={value} value={value} className="min-h-7 py-1 sm:text-xs">
2761+
<MenuRadioItem key={value} value={value}>
27622762
{label}
27632763
</MenuRadioItem>
27642764
),
@@ -2778,7 +2778,7 @@ function ProjectSortMenu({
27782778
{(
27792779
Object.entries(SIDEBAR_THREAD_SORT_LABELS) as Array<[SidebarThreadSortOrder, string]>
27802780
).map(([value, label]) => (
2781-
<MenuRadioItem key={value} value={value} className="min-h-7 py-1 sm:text-xs">
2781+
<MenuRadioItem key={value} value={value}>
27822782
{label}
27832783
</MenuRadioItem>
27842784
))}

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4491,7 +4491,7 @@ export default function Sidebar() {
44914491
key={item.value}
44924492
hideIndicator
44934493
value={item}
4494-
className="h-8 min-h-8 py-0 font-medium"
4494+
className="font-medium"
44954495
contentClassName="flex min-w-0 items-center gap-2"
44964496
onContextMenu={(event) => {
44974497
if (project) handleProjectSettings(event, project);

‎apps/web/src/components/chat/ChatComposer.tsx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1164,7 +1164,7 @@ const ComposerFooterModeControls = memo(function ComposerFooterModeControls(prop
11641164
const option = runtimeModeConfig[mode];
11651165
const OptionIcon = option.icon;
11661166
return (
1167-
<SelectItem key={mode} value={mode} hideIndicator className="min-w-64 py-2">
1167+
<SelectItem key={mode} value={mode} hideIndicator className="min-w-64">
11681168
<div className="flex min-w-0 items-center gap-3">
11691169
<div className="grid min-w-0 flex-1 gap-0.5">
11701170
<span className="inline-flex items-center gap-1.5 font-medium text-foreground">

‎apps/web/src/components/pullRequest/PullRequestCandidatePicker.tsx‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,6 @@ export function PullRequestCandidatePicker<T>({
147147
index={index}
148148
value={keys[index]}
149149
disabled={disabled}
150-
className="min-h-0 py-1.5 text-xs sm:min-h-0 sm:text-xs"
151150
contentClassName="flex min-w-0 items-center gap-2"
152151
>
153152
{children(candidate)}

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

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -326,7 +326,7 @@ function WhenVariableSelect({
326326
</SelectTrigger>
327327
<SelectContent alignItemWithTrigger={false} matchTriggerWidth={false} className="max-h-72">
328328
{options.map((option) => (
329-
<SelectItem key={option} value={option} className="min-h-7 w-full py-1 text-[12px]">
329+
<SelectItem key={option} value={option} className="w-full">
330330
<span className="truncate">{option}</span>
331331
</SelectItem>
332332
))}
@@ -530,12 +530,8 @@ function WhenExpressionNodeEditor({
530530
<SelectValue />
531531
</SelectTrigger>
532532
<SelectContent alignItemWithTrigger={false} matchTriggerWidth={false}>
533-
<SelectItem value="and" className="min-h-7 py-1 text-[12px]">
534-
and
535-
</SelectItem>
536-
<SelectItem value="or" className="min-h-7 py-1 text-[12px]">
537-
or
538-
</SelectItem>
533+
<SelectItem value="and">and</SelectItem>
534+
<SelectItem value="or">or</SelectItem>
539535
</SelectContent>
540536
</Select>
541537
<Button type="button" variant="outline" size="compact" onClick={addCondition}>
@@ -1145,7 +1141,7 @@ function NewKeybindingCommandSelect({
11451141
</SelectTrigger>
11461142
<SelectContent alignItemWithTrigger={false} matchTriggerWidth={false} className="max-h-72">
11471143
{commandOptions.map((command) => (
1148-
<SelectItem key={command} value={command} className="min-h-7 w-full py-1 text-[12px]">
1144+
<SelectItem key={command} value={command} className="w-full">
11491145
<span className="truncate">{commandLabel(command)}</span>
11501146
</SelectItem>
11511147
))}

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,7 @@ export function ProjectDefaultsSettings({ category }: { category: ProjectSetting
264264
const option = runtimeModeConfig[mode];
265265
const Icon = option.icon;
266266
return (
267-
<SelectItem key={mode} value={mode} className="min-w-64 py-2">
267+
<SelectItem key={mode} value={mode} className="min-w-64">
268268
<div className="grid gap-0.5">
269269
<span className="inline-flex items-center gap-1.5 font-medium">
270270
<Icon className="size-3.5 shrink-0 text-muted-foreground" />

‎scripts/lint-restyle-ceiling.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import * as NodeURL from "node:url";
88
// components/ui exports are migrated to variants (see vite.config.ts). This gate keeps the
99
// count from growing: CI fails when findings exceed the ceiling. Lower the ceiling when you
1010
// migrate a file, and delete this script when the rule becomes an error.
11-
export const RESTYLE_CEILING = 737;
11+
export const RESTYLE_CEILING = 717;
1212

1313
const RULE = "shadcn(no-restyle)";
1414

0 commit comments

Comments
 (0)