Commit c866be6
feat: Add search/filter functionality to Files UI (#2451)
* feat: Add search/filter functionality to Files UI
- Add SearchFilter component with real-time filtering
- Support searching by file name, CID, and file type
- Integrate search with both list and grid view modes
- Add proper keyboard navigation support for filtered results
- Include internationalization support for search UI
- Maintain all existing functionality while adding search capability
Resolves #2447
* fix: Remove unused modalOpen parameter from FilesGrid component
- Remove modalOpen from FilesGridPropsConnected interface
- Remove modalOpen parameter from FilesGrid component function
- Fixes TypeScript error TS6133 about unused variable
* feat(files): add toggle for search filter visibility
search filter bar is now hidden by default, with a toolbar button
to show/hide it. preference persists to localStorage.
also fixes "no matches" message not showing due to <Trans> wrapper
swallowing the filter conditional, and improves clear button alignment.
* fix(files): improve aria attributes on search toggle button
add aria-pressed to convey toggle state, use static aria-label,
and hide decorative SVG icon from screen readers.
* test(files): add e2e tests for search filter
cover search toggle visibility, filtering by name and CID in both
list and grid views, hiding search to clear filter, and no-matches
message.
* fix(files): preserve search filter across view switches, fix input bug
use a ref in FilesPage to share filter text across list/grid views
without passing it through connect()/withTranslation() HOC layers,
which caused render delays that broke the controlled input (only the
first character was registered).
each child now owns local filter state for fast updates and syncs
to the shared ref. SearchFilter accepts initialValue prop so it
starts with the correct text on remount.
also restores the isRoot guard in emptyRowsRenderer, fixes stale
keyHandler deps in files-grid, and adds e2e test for filter
persistence across view switches.
* fix(files): grid select-all should only select filtered files
move the grid "Select all entries" checkbox from FilesPage.js into
files-grid.tsx where filteredFiles is computed, matching how FilesList
already handles its own select-all. the old code in FilesPage selected
all files regardless of the active search filter.
* fix(a11y): toggle aria-label on search filter button to match state
aria-label was static, always saying "show" even when filter was visible
---------
Co-authored-by: Suchitra Swain <suchitraswain.2012gmail.com>
Co-authored-by: Marcin Rataj <lidel@lidel.org>1 parent 17f675e commit c866be6
File tree
8 files changed
+459
-89
lines changed- public/locales/en
- src/files
- files-grid
- files-list
- search-filter
- test
- e2e
- setup
- helpers
8 files changed
+459
-89
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
192 | 192 | | |
193 | 193 | | |
194 | 194 | | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
195 | 198 | | |
196 | 199 | | |
197 | 200 | | |
| |||
202 | 205 | | |
203 | 206 | | |
204 | 207 | | |
205 | | - | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
206 | 211 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
| 18 | + | |
18 | 19 | | |
19 | 20 | | |
20 | 21 | | |
| |||
26 | 27 | | |
27 | 28 | | |
28 | 29 | | |
29 | | - | |
30 | 30 | | |
31 | 31 | | |
32 | 32 | | |
| |||
44 | 44 | | |
45 | 45 | | |
46 | 46 | | |
| 47 | + | |
| 48 | + | |
47 | 49 | | |
48 | 50 | | |
49 | 51 | | |
50 | 52 | | |
51 | 53 | | |
52 | 54 | | |
53 | 55 | | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
54 | 61 | | |
55 | 62 | | |
56 | 63 | | |
| |||
85 | 92 | | |
86 | 93 | | |
87 | 94 | | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
88 | 100 | | |
89 | 101 | | |
90 | 102 | | |
| |||
263 | 275 | | |
264 | 276 | | |
265 | 277 | | |
266 | | - | |
267 | | - | |
| 278 | + | |
| 279 | + | |
268 | 280 | | |
269 | 281 | | |
270 | 282 | | |
| |||
364 | 376 | | |
365 | 377 | | |
366 | 378 | | |
| 379 | + | |
| 380 | + | |
| 381 | + | |
| 382 | + | |
| 383 | + | |
| 384 | + | |
| 385 | + | |
| 386 | + | |
| 387 | + | |
| 388 | + | |
367 | 389 | | |
368 | 390 | | |
369 | 391 | | |
370 | | - | |
371 | | - | |
372 | | - | |
373 | | - | |
374 | | - | |
375 | | - | |
376 | | - | |
377 | | - | |
378 | | - | |
379 | | - | |
380 | | - | |
381 | | - | |
382 | | - | |
383 | | - | |
384 | | - | |
385 | | - | |
386 | | - | |
387 | | - | |
388 | | - | |
389 | | - | |
390 | | - | |
391 | | - | |
392 | 392 | | |
393 | 393 | | |
394 | 394 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| 7 | + | |
7 | 8 | | |
8 | 9 | | |
9 | 10 | | |
10 | 11 | | |
11 | 12 | | |
| 13 | + | |
12 | 14 | | |
13 | 15 | | |
14 | 16 | | |
15 | 17 | | |
16 | 18 | | |
17 | 19 | | |
18 | 20 | | |
| 21 | + | |
| 22 | + | |
19 | 23 | | |
20 | 24 | | |
21 | 25 | | |
| |||
34 | 38 | | |
35 | 39 | | |
36 | 40 | | |
37 | | - | |
38 | 41 | | |
39 | 42 | | |
40 | 43 | | |
41 | 44 | | |
42 | | - | |
| 45 | + | |
43 | 46 | | |
44 | 47 | | |
| 48 | + | |
45 | 49 | | |
46 | 50 | | |
47 | 51 | | |
| |||
63 | 67 | | |
64 | 68 | | |
65 | 69 | | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
66 | 91 | | |
67 | 92 | | |
68 | 93 | | |
69 | 94 | | |
70 | | - | |
71 | | - | |
72 | | - | |
73 | | - | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
74 | 108 | | |
| 109 | + | |
75 | 110 | | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
76 | 119 | | |
77 | 120 | | |
78 | 121 | | |
| |||
86 | 129 | | |
87 | 130 | | |
88 | 131 | | |
89 | | - | |
| 132 | + | |
90 | 133 | | |
91 | 134 | | |
92 | 135 | | |
| |||
101 | 144 | | |
102 | 145 | | |
103 | 146 | | |
104 | | - | |
| 147 | + | |
105 | 148 | | |
106 | 149 | | |
107 | 150 | | |
| |||
120 | 163 | | |
121 | 164 | | |
122 | 165 | | |
123 | | - | |
| 166 | + | |
124 | 167 | | |
125 | 168 | | |
126 | 169 | | |
127 | 170 | | |
128 | 171 | | |
129 | | - | |
| 172 | + | |
130 | 173 | | |
131 | 174 | | |
132 | 175 | | |
| |||
139 | 182 | | |
140 | 183 | | |
141 | 184 | | |
142 | | - | |
| 185 | + | |
143 | 186 | | |
144 | 187 | | |
145 | 188 | | |
146 | 189 | | |
147 | 190 | | |
148 | 191 | | |
149 | 192 | | |
150 | | - | |
| 193 | + | |
151 | 194 | | |
152 | 195 | | |
153 | 196 | | |
| |||
156 | 199 | | |
157 | 200 | | |
158 | 201 | | |
159 | | - | |
160 | | - | |
| 202 | + | |
| 203 | + | |
161 | 204 | | |
162 | 205 | | |
163 | 206 | | |
| |||
167 | 210 | | |
168 | 211 | | |
169 | 212 | | |
170 | | - | |
| 213 | + | |
171 | 214 | | |
172 | 215 | | |
173 | 216 | | |
| |||
180 | 223 | | |
181 | 224 | | |
182 | 225 | | |
183 | | - | |
184 | | - | |
185 | | - | |
186 | | - | |
187 | | - | |
188 | | - | |
189 | | - | |
190 | | - | |
191 | | - | |
192 | | - | |
193 | | - | |
194 | | - | |
195 | | - | |
196 | | - | |
197 | | - | |
198 | | - | |
199 | | - | |
200 | | - | |
201 | | - | |
202 | | - | |
203 | | - | |
204 | | - | |
205 | | - | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
206 | 240 | | |
207 | | - | |
208 | | - | |
209 | | - | |
210 | | - | |
211 | | - | |
212 | | - | |
213 | | - | |
214 | 241 | | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
215 | 276 | | |
216 | 277 | | |
217 | 278 | | |
| |||
0 commit comments