Skip to content

Commit e23b876

Browse files
Polish branch picker search field
- Add search icon and unstyled input styling - Tighten popup spacing for virtualized and standard lists
1 parent 5159e95 commit e23b876

1 file changed

Lines changed: 20 additions & 13 deletions

File tree

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

Lines changed: 20 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { scopeProjectRef, scopeThreadRef } from "@t3tools/client-runtime";
22
import type { EnvironmentId, VcsRef, ThreadId } from "@t3tools/contracts";
33
import { LegendList, type LegendListRef } from "@legendapp/list/react";
4-
import { ChevronDownIcon, GitBranchIcon } from "lucide-react";
4+
import { ChevronDownIcon, GitBranchIcon, SearchIcon } from "lucide-react";
55
import {
66
useCallback,
77
useDeferredValue,
@@ -645,23 +645,30 @@ export function BranchToolbarBranchSelector({
645645
<ChevronDownIcon className="size-3 shrink-0 opacity-50" />
646646
</ComboboxTrigger>
647647
<ComboboxPopup align="end" side="top" className="flex w-80 flex-col">
648-
<div className="shrink-0 border-b p-1">
649-
<ComboboxInput
650-
className="[&_input]:font-sans rounded-md"
651-
inputClassName="ring-0"
652-
placeholder="Search refs..."
653-
showTrigger={false}
654-
size="sm"
655-
value={branchQuery}
656-
onChange={(event) => setBranchQuery(event.target.value)}
657-
/>
648+
<div className="shrink-0 px-3 pt-2.5">
649+
<div className="relative -translate-y-px border-b border-border/70 pb-1.5 transition-colors focus-within:border-ring">
650+
<SearchIcon
651+
aria-hidden="true"
652+
className="pointer-events-none absolute top-1.5 left-0 size-4 shrink-0 text-muted-foreground/55"
653+
/>
654+
<ComboboxInput
655+
className="[&_input]:h-6.5 [&_input]:ps-5 [&_input]:font-sans [&_input]:leading-6.5"
656+
inputClassName="rounded-none bg-transparent text-sm"
657+
placeholder="Search refs..."
658+
showTrigger={false}
659+
size="sm"
660+
unstyled
661+
value={branchQuery}
662+
onChange={(event) => setBranchQuery(event.target.value)}
663+
/>
664+
</div>
658665
</div>
659666
<div className="flex min-h-0 flex-1 flex-col overflow-hidden">
660667
<ComboboxEmpty>No refs found.</ComboboxEmpty>
661668
<div className="relative min-h-0 w-full max-h-56 flex-1 overflow-hidden">
662669
{shouldVirtualizeBranchList ? (
663670
<>
664-
<ComboboxListVirtualized className="not-empty:ps-1 not-empty:pe-0 not-empty:py-1">
671+
<ComboboxListVirtualized className="not-empty:ps-1 not-empty:pe-0 not-empty:pt-2 not-empty:pb-1">
665672
<LegendList<string>
666673
ref={branchListRef}
667674
data={filteredBranchPickerItems}
@@ -696,7 +703,7 @@ export function BranchToolbarBranchSelector({
696703
) : (
697704
<ComboboxList
698705
ref={setBranchListRef}
699-
className="h-full max-h-56 min-h-0 not-empty:ps-1 not-empty:pe-0 not-empty:py-1"
706+
className="h-full max-h-56 min-h-0 not-empty:ps-1 not-empty:pe-0 not-empty:pt-2 not-empty:pb-1"
700707
>
701708
{filteredBranchPickerItems.map((itemValue, index) =>
702709
renderPickerItem(itemValue, index),

0 commit comments

Comments
 (0)