Skip to content

Commit 3c24b62

Browse files
committed
fix: address PR review feedback
- Fix fuzzy search to only search by name (not ID) - Add ChevronUp rotation animation when dropdown is open - Replace Lucide icons with codicons for consistency - Fix hover layout shift by using opacity instead of display toggle
1 parent 202fb59 commit 3c24b62

File tree

1 file changed

+15
-11
lines changed

1 file changed

+15
-11
lines changed

webview-ui/src/components/chat/ApiConfigSelector.tsx

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ import { IconButton } from "./IconButton"
66
import { useAppTranslation } from "@/i18n/TranslationContext"
77
import { vscode } from "@/utils/vscode"
88
import { Fzf } from "fzf"
9-
import { Check, X, Pin, ChevronUp } from "lucide-react"
109
import { Button } from "@/components/ui"
1110

1211
interface ApiConfigSelectorProps {
@@ -41,7 +40,7 @@ export const ApiConfigSelector = ({
4140
const searchableItems = useMemo(() => {
4241
return listApiConfigMeta.map((config) => ({
4342
original: config,
44-
searchStr: [config.name, config.id].filter(Boolean).join(" "),
43+
searchStr: config.name,
4544
}))
4645
}, [listApiConfigMeta])
4746

@@ -101,8 +100,8 @@ export const ApiConfigSelector = ({
101100
<span className="flex-1 truncate">{config.name}</span>
102101
<div className="flex items-center gap-1">
103102
{isCurrentConfig && (
104-
<div className="size-5 p-1">
105-
<Check className="size-3" />
103+
<div className="size-5 p-1 flex items-center justify-center">
104+
<span className="codicon codicon-check text-xs" />
106105
</div>
107106
)}
108107
<StandardTooltip content={isPinned ? t("chat:unpin") : t("chat:pin")}>
@@ -118,11 +117,11 @@ export const ApiConfigSelector = ({
118117
text: config.id,
119118
})
120119
}}
121-
className={cn("size-5", {
122-
"hidden group-hover:flex": !isPinned && !isCurrentConfig,
123-
"bg-accent": isPinned,
120+
className={cn("size-5 flex items-center justify-center", {
121+
"opacity-0 group-hover:opacity-100": !isPinned && !isCurrentConfig,
122+
"bg-accent opacity-100": isPinned,
124123
})}>
125-
<Pin className="size-3 p-0.5 opacity-50" />
124+
<span className="codicon codicon-pin text-xs opacity-50" />
126125
</Button>
127126
</StandardTooltip>
128127
</div>
@@ -145,7 +144,12 @@ export const ApiConfigSelector = ({
145144
: "opacity-90 hover:opacity-100 hover:bg-[rgba(255,255,255,0.03)] hover:border-[rgba(255,255,255,0.15)] cursor-pointer",
146145
triggerClassName,
147146
)}>
148-
<ChevronUp className="pointer-events-none opacity-80 flex-shrink-0 size-3" />
147+
<span
148+
className={cn(
149+
"codicon codicon-chevron-up pointer-events-none opacity-80 flex-shrink-0 text-xs transition-transform duration-200",
150+
open && "rotate-180",
151+
)}
152+
/>
149153
<span className="truncate">{displayName}</span>
150154
</PopoverTrigger>
151155
)
@@ -172,8 +176,8 @@ export const ApiConfigSelector = ({
172176
/>
173177
{searchValue.length > 0 && (
174178
<div className="absolute right-4 top-0 bottom-0 flex items-center justify-center">
175-
<X
176-
className="text-vscode-input-foreground opacity-50 hover:opacity-100 size-4 p-0.5 cursor-pointer"
179+
<span
180+
className="codicon codicon-close text-vscode-input-foreground opacity-50 hover:opacity-100 text-xs cursor-pointer"
177181
onClick={() => setSearchValue("")}
178182
/>
179183
</div>

0 commit comments

Comments
 (0)