fix: keep original order when filtering models (#2416)
commitc9efb207ea0575ca837e2d957738452da78b366b
authorAndrey Nering <andreynering@users.noreply.github.com>
dateMon 16 Mar 2026, 16:14 (7 months ago)
parent6e56a7f
internal/ui/dialog/models_list.go+3−1
@@ -216,8 +216,10 @@ func (f *ModelsList) VisibleItems() []list.Item {
216216 }
217217
218218 matches := fuzzy.Find(query, names)
219+
220+ // Sort by original index to preserve order within the group
219221 sort.SliceStable(matches, func(i, j int) bool {
220− return matches[i].Score > matches[j].Score
222+ return matches[i].Index < matches[j].Index
221223 })
222224
223225 for _, match := range matches {