diff options
| author | Aiden Cline <[email protected]> | 2025-12-27 19:07:25 -0600 |
|---|---|---|
| committer | Aiden Cline <[email protected]> | 2025-12-27 19:07:38 -0600 |
| commit | de28fafb471cca4a79be2b9e0b8767ec852ea5ab (patch) | |
| tree | 7fd195d61ff52952ba8a8a27fc698844b082aa0a | |
| parent | 9d485dd307ebced056729ae56903064c66cff85c (diff) | |
| download | opencode-de28fafb471cca4a79be2b9e0b8767ec852ea5ab.tar.gz opencode-de28fafb471cca4a79be2b9e0b8767ec852ea5ab.zip | |
fix: search all recent models instead of only top 5 in TUI /models command
| -rw-r--r-- | packages/opencode/src/cli/cmd/tui/component/dialog-model.tsx | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/packages/opencode/src/cli/cmd/tui/component/dialog-model.tsx b/packages/opencode/src/cli/cmd/tui/component/dialog-model.tsx index fc0559cd6..bc90dbb5c 100644 --- a/packages/opencode/src/cli/cmd/tui/component/dialog-model.tsx +++ b/packages/opencode/src/cli/cmd/tui/component/dialog-model.tsx @@ -37,11 +37,9 @@ export function DialogModel(props: { providerID?: string }) { const recents = local.model.recent() const recentList = showExtra() - ? recents - .filter( - (item) => !favorites.some((fav) => fav.providerID === item.providerID && fav.modelID === item.modelID), - ) - .slice(0, 5) + ? recents.filter( + (item) => !favorites.some((fav) => fav.providerID === item.providerID && fav.modelID === item.modelID), + ) : [] const favoriteOptions = favorites.flatMap((item) => { @@ -182,7 +180,10 @@ export function DialogModel(props: { providerID?: string }) { // Apply fuzzy filtering to each section separately, maintaining section order if (q) { const filteredFavorites = fuzzysort.go(q, favoriteOptions, { keys: ["title"] }).map((x) => x.obj) - const filteredRecents = fuzzysort.go(q, recentOptions, { keys: ["title"] }).map((x) => x.obj) + const filteredRecents = fuzzysort + .go(q, recentOptions, { keys: ["title"] }) + .map((x) => x.obj) + .slice(0, 5) const filteredProviders = fuzzysort.go(q, providerOptions, { keys: ["title", "category"] }).map((x) => x.obj) const filteredPopular = fuzzysort.go(q, popularProviders, { keys: ["title"] }).map((x) => x.obj) return [...filteredFavorites, ...filteredRecents, ...filteredProviders, ...filteredPopular] |
