@@ -264,13 +264,7 @@ func (f *filterableGroupList[T]) filterItemsInGroup(group Group[T], query string
264 return matchedItems
264 return matchedItems
267− // No matches, return all items without highlights
267+ return []T{}
269− for _, item := range group.Items {
270− f.setMatchIndexes(item, make([]int, 0))
271− allItems = append(allItems, item)
276func (f *filterableGroupList[T]) searchAllGroups(query string) []Group[T] {
270func (f *filterableGroupList[T]) searchAllGroups(query string) []Group[T] {
@@ -319,6 +313,21 @@ func (f *filterableGroupList[T]) Filter(query string) tea.Cmd {
317+ // add any matching items from other groups
318+ allGroups := f.searchAllGroups(lowerQuery)
319+ for _, g := range allGroups {
321+ for _, existing := range newGroups {
322+ if existing.Section.ID() == g.Section.ID() {
328+ newGroups = append(newGroups, g)
323 // No group matches, search all groups
332 // No group matches, search all groups
324 newGroups = f.searchAllGroups(lowerQuery)
333 newGroups = f.searchAllGroups(lowerQuery)