feat: search model in /model
Browse files
src/components/SearchableModelPicker.tsx
CHANGED
|
@@ -178,14 +178,9 @@ export function SearchableModelPicker({
|
|
| 178 |
onSelect(option.value, selectedEffort)
|
| 179 |
}, [effort, hasToggledEffort, onSelect, setAppState, skipSettingsWrite])
|
| 180 |
|
| 181 |
-
// Render model item
|
| 182 |
const renderItem = useCallback((option: { value: string | null; label: string; description: string }, isFocused: boolean) => {
|
| 183 |
-
return
|
| 184 |
-
<Box flexDirection="column">
|
| 185 |
-
<Text bold={isFocused}>{option.label}</Text>
|
| 186 |
-
<Text dimColor>{option.description}</Text>
|
| 187 |
-
</Box>
|
| 188 |
-
)
|
| 189 |
}, [])
|
| 190 |
|
| 191 |
// Render preview with effort
|
|
@@ -196,21 +191,20 @@ export function SearchableModelPicker({
|
|
| 196 |
const defaultEffort = getDefaultEffortLevelForOption(option.value ?? undefined)
|
| 197 |
const displayEffort = effort === 'max' && !supportsMax ? 'high' : effort
|
| 198 |
|
| 199 |
-
if (!supportsEffort) {
|
| 200 |
-
return (
|
| 201 |
-
<Box flexDirection="column" gap={1}>
|
| 202 |
-
<Text dimColor>Effort not supported</Text>
|
| 203 |
-
</Box>
|
| 204 |
-
)
|
| 205 |
-
}
|
| 206 |
-
|
| 207 |
return (
|
| 208 |
<Box flexDirection="column" gap={1}>
|
| 209 |
-
<Text dimColor>
|
| 210 |
-
|
| 211 |
-
|
| 212 |
-
|
| 213 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 214 |
</Box>
|
| 215 |
)
|
| 216 |
}, [effort])
|
|
|
|
| 178 |
onSelect(option.value, selectedEffort)
|
| 179 |
}, [effort, hasToggledEffort, onSelect, setAppState, skipSettingsWrite])
|
| 180 |
|
| 181 |
+
// Render model item - only show label (description shown in preview)
|
| 182 |
const renderItem = useCallback((option: { value: string | null; label: string; description: string }, isFocused: boolean) => {
|
| 183 |
+
return <Text bold={isFocused}>{option.label}</Text>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 184 |
}, [])
|
| 185 |
|
| 186 |
// Render preview with effort
|
|
|
|
| 191 |
const defaultEffort = getDefaultEffortLevelForOption(option.value ?? undefined)
|
| 192 |
const displayEffort = effort === 'max' && !supportsMax ? 'high' : effort
|
| 193 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 194 |
return (
|
| 195 |
<Box flexDirection="column" gap={1}>
|
| 196 |
+
<Text dimColor>{option.description}</Text>
|
| 197 |
+
{!supportsEffort ? (
|
| 198 |
+
<Text dimColor>Effort not supported</Text>
|
| 199 |
+
) : (
|
| 200 |
+
<>
|
| 201 |
+
<Text dimColor>
|
| 202 |
+
{capitalize(displayEffort)} effort
|
| 203 |
+
{displayEffort === defaultEffort ? ' (default)' : ''}
|
| 204 |
+
</Text>
|
| 205 |
+
<Text color="subtle">← → to adjust</Text>
|
| 206 |
+
</>
|
| 207 |
+
)}
|
| 208 |
</Box>
|
| 209 |
)
|
| 210 |
}, [effort])
|