|
1 | 1 | "use client"; |
2 | 2 |
|
3 | 3 | import { useAtom, useAtomValue } from "jotai"; |
4 | | -import { Check, ChevronDown, Search, Settings2 } from "lucide-react"; |
| 4 | +import { Check, ChevronDown, Search, SlidersHorizontal } from "lucide-react"; |
5 | 5 | import { useRouter } from "next/navigation"; |
6 | 6 | import type { UIEvent } from "react"; |
7 | 7 | import { useCallback, useMemo, useState } from "react"; |
@@ -130,6 +130,7 @@ export function ModelSelector({ |
130 | 130 | const selected = chatModelsById.get(selectedModelId); |
131 | 131 | const groups = useMemo(() => groupedModels(visibleChatModels), [visibleChatModels]); |
132 | 132 | const loading = globalLoading || connectionsLoading; |
| 133 | + const hasSearchQuery = search.trim().length > 0; |
133 | 134 |
|
134 | 135 | function handleOpenChange(nextOpen: boolean) { |
135 | 136 | if (!nextOpen) setSearch(""); |
@@ -197,7 +198,9 @@ export function ModelSelector({ |
197 | 198 | </div> |
198 | 199 | ) : Object.keys(groups).length === 0 ? ( |
199 | 200 | <div className="px-3 py-8 text-center text-sm text-muted-foreground"> |
200 | | - No enabled chat models. Add or enable models in Settings. |
| 201 | + {hasSearchQuery |
| 202 | + ? "No matching chat models." |
| 203 | + : "No enabled chat models. Add or enable models in Settings."} |
201 | 204 | </div> |
202 | 205 | ) : ( |
203 | 206 | Object.entries(groups).map(([connection, models]) => ( |
@@ -257,7 +260,7 @@ export function ModelSelector({ |
257 | 260 | className="w-full justify-start rounded-md bg-foreground/5 hover:bg-foreground/10 hover:text-foreground" |
258 | 261 | onClick={manageModelConnections} |
259 | 262 | > |
260 | | - <Settings2 className="mr-2 h-4 w-4" /> Manage models |
| 263 | + <SlidersHorizontal className="h-4 w-4" /> Manage models |
261 | 264 | </Button> |
262 | 265 | </div> |
263 | 266 | </div> |
@@ -304,7 +307,10 @@ export function ModelSelector({ |
304 | 307 | return ( |
305 | 308 | <Popover open={open} onOpenChange={handleOpenChange}> |
306 | 309 | <PopoverTrigger asChild>{trigger}</PopoverTrigger> |
307 | | - <PopoverContent align="start" className="w-[340px] p-0"> |
| 310 | + <PopoverContent |
| 311 | + align="start" |
| 312 | + className="w-[340px] border border-popover-border bg-popover p-0 text-popover-foreground shadow-md" |
| 313 | + > |
308 | 314 | {content} |
309 | 315 | </PopoverContent> |
310 | 316 | </Popover> |
|
0 commit comments