Skip to content

Commit f054d67

Browse files
alari76claude
andcommitted
fix: wire up OpenCode loading state and deduplicate recents in model picker
- Set loadingOcModels to true before fetching and false in finally, so the model picker shows "Loading models..." while OpenCode models load - Exclude recent model IDs from the "All Models" section to prevent duplicate entries in the searchable dropdown Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 56299fe commit f054d67

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

src/components/workflows/WorkflowModelPicker.tsx

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -93,8 +93,13 @@ function SearchablePicker({ models, selected, onSelect }: {
9393
)
9494
: models
9595

96+
// Exclude recents from the "All Models" section to avoid duplicates
97+
const allWithoutRecents = (!query && recents.length > 0)
98+
? filtered.filter(m => !recents.includes(m.id))
99+
: filtered
100+
96101
const visibleList = (!query && recents.length > 0)
97-
? [...recents.map(id => models.find(m => m.id === id)).filter(Boolean) as ModelOption[], ...filtered]
102+
? [...recents.map(id => models.find(m => m.id === id)).filter(Boolean) as ModelOption[], ...allWithoutRecents]
98103
: filtered
99104

100105
// Scroll active item into view
@@ -192,10 +197,10 @@ function SearchablePicker({ models, selected, onSelect }: {
192197
{!query && (
193198
<div className="px-3 py-1 text-[11px] text-neutral-5 uppercase tracking-wide">All Models</div>
194199
)}
195-
{filtered.length === 0 && (
200+
{allWithoutRecents.length === 0 && (
196201
<div className="px-3 py-2 text-[13px] text-neutral-5">No models match your search</div>
197202
)}
198-
{filtered.map((m, idx) => {
203+
{allWithoutRecents.map((m, idx) => {
199204
const baseIndex = (!query && recents.length > 0) ? recents.length : 0
200205
const index = baseIndex + idx
201206
return (

0 commit comments

Comments
 (0)