internal/ui/dialog/models_list.go 🔗
@@ -216,8 +216,10 @@ func (f *ModelsList) VisibleItems() []list.Item {
}
matches := fuzzy.Find(query, names)
+
+ // Sort by original index to preserve order within the group
sort.SliceStable(matches, func(i, j int) bool {
- return matches[i].Score > matches[j].Score
+ return matches[i].Index < matches[j].Index
})
for _, match := range matches {