@@ -109,29 +109,31 @@ func (v CollectionsView) Update(msg tea.Msg) (CollectionsView, tea.Cmd) {
109109 break
110110 }
111111
112- // Handle pagination keys first, before the list can consume them
113- switch msg .String () {
114- case "n" , "right" :
115- // Next page
116- if v .currentPage < v .pagination .TotalPages {
117- return v , func () tea.Msg {
118- return v .loadCollectionsPage (v .currentPage + 1 , v .pageSize )
112+ // Handle pagination keys only when not filtering
113+ if ! v .list .IsFiltering () {
114+ switch msg .String () {
115+ case "n" , "right" :
116+ // Next page
117+ if v .currentPage < v .pagination .TotalPages {
118+ return v , func () tea.Msg {
119+ return v .loadCollectionsPage (v .currentPage + 1 , v .pageSize )
120+ }
119121 }
120- }
121- return v , nil
122- case "p" , "left" :
123- // Previous page
124- if v . currentPage > 1 {
125- return v , func () tea. Msg {
126- return v . loadCollectionsPage ( v . currentPage - 1 , v . pageSize )
122+ return v , nil
123+ case "p" , "left" :
124+ // Previous page
125+ if v . currentPage > 1 {
126+ return v , func () tea. Msg {
127+ return v . loadCollectionsPage ( v . currentPage - 1 , v . pageSize )
128+ }
127129 }
130+ return v , nil
128131 }
129- return v , nil
130- default :
131- // Forward other keys to the list
132- v .list , cmd = v .list .Update (msg )
133132 }
134133
134+ // Always forward keys to the list (handles filtering and navigation)
135+ v .list , cmd = v .list .Update (msg )
136+
135137 default :
136138 if v .initialized {
137139 v .list , cmd = v .list .Update (msg )
@@ -141,6 +143,10 @@ func (v CollectionsView) Update(msg tea.Msg) (CollectionsView, tea.Cmd) {
141143 return v , cmd
142144}
143145
146+ func (v CollectionsView ) IsFiltering () bool {
147+ return v .initialized && v .list .IsFiltering ()
148+ }
149+
144150func (v CollectionsView ) View () string {
145151 if ! v .initialized {
146152 return v .layout .FullView (
@@ -152,9 +158,12 @@ func (v CollectionsView) View() string {
152158
153159 content := v .list .View ()
154160
155- // Build instructions with pagination info
156- instructions := "↑↓: navigate • a: add • enter: edit • d: delete • q: quit"
157- if v .pagination .TotalPages > 1 {
161+ // Build instructions with pagination and filter info
162+ instructions := "↑↓: navigate • /: filter • enter: edit • d: delete • q: quit"
163+ if ! v .list .IsFiltering () {
164+ instructions = "↑↓: navigate • a: add • /: filter • enter: edit • d: delete • q: quit"
165+ }
166+ if v .pagination .TotalPages > 1 && ! v .list .IsFiltering () {
158167 instructions += fmt .Sprintf (" • p/n: prev/next page (%d/%d)" , v .currentPage , v .pagination .TotalPages )
159168 }
160169
0 commit comments