TypeScript
refactor(web): one row height for select, combobox and radio items (#13041)
Julius Marminge4321aa24fd21
diff --git a/apps/web/src/components/DiffPanel.tsx b/apps/web/src/components/DiffPanel.tsxindex ac8623067ab..ce73a9e0691 100644--- a/apps/web/src/components/DiffPanel.tsx+++ b/apps/web/src/components/DiffPanel.tsx@@ -773,7 +773,7 @@ export default function DiffPanel({<ComboboxEmpty>No matching refs.</ComboboxEmpty><ComboboxList className="max-h-64 min-w-0 overflow-x-hidden"><ComboboxItem- className="h-8 w-full min-w-0 grid-cols-[1rem_minmax(0,1fr)] py-0"+ className="w-full min-w-0 grid-cols-[1rem_minmax(0,1fr)]"contentClassName="w-full min-w-0 overflow-hidden"value={AUTOMATIC_BASE_REF}>@@ -786,7 +786,7 @@ export default function DiffPanel({return (<ComboboxItemkey={choice.id}- className="h-8 w-full min-w-0 grid-cols-[1rem_minmax(0,1fr)] py-0"+ className="w-full min-w-0 grid-cols-[1rem_minmax(0,1fr)]"contentClassName="w-full min-w-0 overflow-hidden"value={item}>diff --git a/apps/web/src/components/LegacySidebar.tsx b/apps/web/src/components/LegacySidebar.tsxindex 97df88f889c..abeab989297 100644--- a/apps/web/src/components/LegacySidebar.tsx+++ b/apps/web/src/components/LegacySidebar.tsx@@ -2758,7 +2758,7 @@ function ProjectSortMenu({>{(Object.entries(SIDEBAR_SORT_LABELS) as Array<[SidebarProjectSortOrder, string]>).map(([value, label]) => (- <MenuRadioItem key={value} value={value} className="min-h-7 py-1 sm:text-xs">+ <MenuRadioItem key={value} value={value}>{label}</MenuRadioItem>),@@ -2778,7 +2778,7 @@ function ProjectSortMenu({{(Object.entries(SIDEBAR_THREAD_SORT_LABELS) as Array<[SidebarThreadSortOrder, string]>).map(([value, label]) => (- <MenuRadioItem key={value} value={value} className="min-h-7 py-1 sm:text-xs">+ <MenuRadioItem key={value} value={value}>{label}</MenuRadioItem>))}diff --git a/apps/web/src/components/Sidebar.tsx b/apps/web/src/components/Sidebar.tsxindex 66cc11625f4..95f0e062d8e 100644--- a/apps/web/src/components/Sidebar.tsx+++ b/apps/web/src/components/Sidebar.tsx@@ -4491,7 +4491,7 @@ export default function Sidebar() {key={item.value}hideIndicatorvalue={item}- className="h-8 min-h-8 py-0 font-medium"+ className="font-medium"contentClassName="flex min-w-0 items-center gap-2"onContextMenu={(event) => {if (project) handleProjectSettings(event, project);diff --git a/apps/web/src/components/chat/ChatComposer.tsx b/apps/web/src/components/chat/ChatComposer.tsxindex 101dbcb4af2..e258c995e57 100644--- a/apps/web/src/components/chat/ChatComposer.tsx+++ b/apps/web/src/components/chat/ChatComposer.tsx@@ -1164,7 +1164,7 @@ const ComposerFooterModeControls = memo(function ComposerFooterModeControls(propconst option = runtimeModeConfig[mode];const OptionIcon = option.icon;return (- <SelectItem key={mode} value={mode} hideIndicator className="min-w-64 py-2">+ <SelectItem key={mode} value={mode} hideIndicator className="min-w-64"><div className="flex min-w-0 items-center gap-3"><div className="grid min-w-0 flex-1 gap-0.5"><span className="inline-flex items-center gap-1.5 font-medium text-foreground">diff --git a/apps/web/src/components/pullRequest/PullRequestCandidatePicker.tsx b/apps/web/src/components/pullRequest/PullRequestCandidatePicker.tsxindex bae150dd918..00ced09cfbf 100644--- a/apps/web/src/components/pullRequest/PullRequestCandidatePicker.tsx+++ b/apps/web/src/components/pullRequest/PullRequestCandidatePicker.tsx@@ -147,7 +147,6 @@ export function PullRequestCandidatePicker<T>({index={index}value={keys[index]}disabled={disabled}- className="min-h-0 py-1.5 text-xs sm:min-h-0 sm:text-xs"contentClassName="flex min-w-0 items-center gap-2">{children(candidate)}diff --git a/apps/web/src/components/settings/KeybindingsSettings.tsx b/apps/web/src/components/settings/KeybindingsSettings.tsxindex 1fc1eba01ae..e23c4875279 100644--- a/apps/web/src/components/settings/KeybindingsSettings.tsx+++ b/apps/web/src/components/settings/KeybindingsSettings.tsx@@ -326,7 +326,7 @@ function WhenVariableSelect({</SelectTrigger><SelectContent alignItemWithTrigger={false} matchTriggerWidth={false} className="max-h-72">{options.map((option) => (- <SelectItem key={option} value={option} className="min-h-7 w-full py-1 text-[12px]">+ <SelectItem key={option} value={option} className="w-full"><span className="truncate">{option}</span></SelectItem>))}@@ -530,12 +530,8 @@ function WhenExpressionNodeEditor({<SelectValue /></SelectTrigger><SelectContent alignItemWithTrigger={false} matchTriggerWidth={false}>- <SelectItem value="and" className="min-h-7 py-1 text-[12px]">- and- </SelectItem>- <SelectItem value="or" className="min-h-7 py-1 text-[12px]">- or- </SelectItem>+ <SelectItem value="and">and</SelectItem>+ <SelectItem value="or">or</SelectItem></SelectContent></Select><Button type="button" variant="outline" size="compact" onClick={addCondition}>@@ -1145,7 +1141,7 @@ function NewKeybindingCommandSelect({</SelectTrigger><SelectContent alignItemWithTrigger={false} matchTriggerWidth={false} className="max-h-72">{commandOptions.map((command) => (- <SelectItem key={command} value={command} className="min-h-7 w-full py-1 text-[12px]">+ <SelectItem key={command} value={command} className="w-full"><span className="truncate">{commandLabel(command)}</span></SelectItem>))}diff --git a/apps/web/src/components/settings/ProjectDefaultsSettings.tsx b/apps/web/src/components/settings/ProjectDefaultsSettings.tsxindex 25a3f5d1fa2..fe757693385 100644--- a/apps/web/src/components/settings/ProjectDefaultsSettings.tsx+++ b/apps/web/src/components/settings/ProjectDefaultsSettings.tsx@@ -264,7 +264,7 @@ export function ProjectDefaultsSettings({ category }: { category: ProjectSettingconst option = runtimeModeConfig[mode];const Icon = option.icon;return (- <SelectItem key={mode} value={mode} className="min-w-64 py-2">+ <SelectItem key={mode} value={mode} className="min-w-64"><div className="grid gap-0.5"><span className="inline-flex items-center gap-1.5 font-medium"><Icon className="size-3.5 shrink-0 text-muted-foreground" />diff --git a/scripts/lint-restyle-ceiling.ts b/scripts/lint-restyle-ceiling.tsindex 18167bce67c..c27dc7c4f47 100644--- a/scripts/lint-restyle-ceiling.ts+++ b/scripts/lint-restyle-ceiling.ts@@ -8,7 +8,7 @@ import * as NodeURL from "node:url";// components/ui exports are migrated to variants (see vite.config.ts). This gate keeps the// count from growing: CI fails when findings exceed the ceiling. Lower the ceiling when you// migrate a file, and delete this script when the rule becomes an error.-export const RESTYLE_CEILING = 737;+export const RESTYLE_CEILING = 717;const RULE = "shadcn(no-restyle)";