on main help sign in
feat(ui): models dialog: improve group filtering by ignoring spaces

Related: 861db845

commitc280dd546834d6f54c74ea0484c49fc0c5920caf authorAyman Bagabas <ayman.bagabas@gmail.com> dateMon 5 Jan 2026, 16:13 (1 year ago) parentf541590
1 file changed+4−2
internal/ui/dialog/models_list.go+4−2
internal/ui/dialog/models_list.go+4−2
@@ -167,7 +167,9 @@ func (f *ModelsList) IsSelectedLast() bool {
167167
168168// VisibleItems returns the visible items after filtering.
169169func (f *ModelsList) VisibleItems() []list.Item {
170− if f.query == "" {
170+ query := strings.ToLower(strings.ReplaceAll(f.query, " ", ""))
171+
172+ if query == "" {
171173 // No filter, return all items with group headers
172174 items := []list.Item{}
173175 for _, g := range f.groups {
@@ -199,7 +201,7 @@ func (f *ModelsList) VisibleItems() []list.Item {
199201 names[i] = filterValue(ms)
200202 }
201203
202− matches := fuzzy.Find(f.query, names)
204+ matches := fuzzy.Find(query, names)
203205 sort.SliceStable(matches, func(i, j int) bool {
204206 return matches[i].Score > matches[j].Score
205207 })