Commit 13b486a
committed
FE: soft-refresh path for
The list components' single reset effect treated every `totalCount` change as a hard reset: wipe `cachedEntries`, wipe `columnWidths`, refetch from scratch. That fit cold context changes (nav, sort, hidden-files toggle), but `directory-diff` events also bump `totalCount` (and `FilePane` was also bumping `cacheGeneration` on every diff), so a bulk delete fired a destructive wipe per coalesced event. The pane went empty between the wipe and the async IPC response — visible flicker, and in brief mode the columns collapsed to a single name column until the new widths landed.
Splits the path into two:
- **Hard reset** (`cacheGeneration` bump): cold context only. Still wipes and refetches. `FilePane.refreshView` and `adoptListing` keep their existing `cacheGeneration++`.
- **Soft refresh** (new `softRefreshTick` prop, bumped on every `directory-diff`): refetch the visible range in the background with the new `force` flag on `fetchVisibleRange`, then atomically replace `cachedEntries`. Existing rows stay on screen until the new ones land, so the burst is invisible to the user.
`totalCount` is no longer in `shouldResetCache` — it changes on diffs and only needs a soft refresh; the `cacheGeneration` / `listingId` / `includeHidden` triad covers true cold resets. The same change applies in both `BriefList` and `FullList`.
Brief mode's per-column width refetch also moves behind a 200 ms trailing throttle in `FilePane.scheduleColumnWidthRefetch`. A 10 k-file delete previously fired one `get_brief_column_text_widths` IPC per coalesced event; now it caps at ~5/sec with the final widths landing once the burst settles.
Test plan: covered by `file-list-utils.test.ts` (reset is name+hidden+generation, not count) plus visual verification on a large local + MTP delete.directory-diff, no more empty-pane flicker1 parent 5467485 commit 13b486a
5 files changed
Lines changed: 157 additions & 37 deletions
File tree
- apps/desktop/src/lib/file-explorer
- pane
- views
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
679 | 679 | | |
680 | 680 | | |
681 | 681 | | |
682 | | - | |
| 682 | + | |
| 683 | + | |
| 684 | + | |
| 685 | + | |
683 | 686 | | |
684 | 687 | | |
| 688 | + | |
| 689 | + | |
| 690 | + | |
| 691 | + | |
| 692 | + | |
| 693 | + | |
| 694 | + | |
| 695 | + | |
| 696 | + | |
| 697 | + | |
| 698 | + | |
| 699 | + | |
| 700 | + | |
| 701 | + | |
| 702 | + | |
| 703 | + | |
| 704 | + | |
| 705 | + | |
| 706 | + | |
| 707 | + | |
| 708 | + | |
| 709 | + | |
685 | 710 | | |
686 | 711 | | |
687 | 712 | | |
| |||
1836 | 1861 | | |
1837 | 1862 | | |
1838 | 1863 | | |
1839 | | - | |
1840 | | - | |
1841 | | - | |
1842 | | - | |
| 1864 | + | |
| 1865 | + | |
| 1866 | + | |
| 1867 | + | |
| 1868 | + | |
| 1869 | + | |
1843 | 1870 | | |
1844 | 1871 | | |
1845 | | - | |
1846 | | - | |
1847 | | - | |
1848 | | - | |
| 1872 | + | |
| 1873 | + | |
1849 | 1874 | | |
1850 | 1875 | | |
1851 | 1876 | | |
| |||
2247 | 2272 | | |
2248 | 2273 | | |
2249 | 2274 | | |
| 2275 | + | |
2250 | 2276 | | |
2251 | 2277 | | |
2252 | 2278 | | |
| |||
2281 | 2307 | | |
2282 | 2308 | | |
2283 | 2309 | | |
| 2310 | + | |
2284 | 2311 | | |
2285 | 2312 | | |
2286 | 2313 | | |
| |||
Lines changed: 46 additions & 8 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
50 | 50 | | |
51 | 51 | | |
52 | 52 | | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
53 | 61 | | |
54 | 62 | | |
55 | 63 | | |
| |||
87 | 95 | | |
88 | 96 | | |
89 | 97 | | |
| 98 | + | |
90 | 99 | | |
91 | 100 | | |
92 | 101 | | |
| |||
207 | 216 | | |
208 | 217 | | |
209 | 218 | | |
210 | | - | |
211 | | - | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
212 | 224 | | |
213 | 225 | | |
214 | 226 | | |
| |||
220 | 232 | | |
221 | 233 | | |
222 | 234 | | |
223 | | - | |
| 235 | + | |
224 | 236 | | |
225 | 237 | | |
226 | 238 | | |
| |||
235 | 247 | | |
236 | 248 | | |
237 | 249 | | |
| 250 | + | |
238 | 251 | | |
239 | 252 | | |
240 | 253 | | |
| |||
592 | 605 | | |
593 | 606 | | |
594 | 607 | | |
595 | | - | |
596 | | - | |
597 | | - | |
| 608 | + | |
| 609 | + | |
| 610 | + | |
| 611 | + | |
| 612 | + | |
| 613 | + | |
| 614 | + | |
| 615 | + | |
| 616 | + | |
| 617 | + | |
| 618 | + | |
598 | 619 | | |
599 | | - | |
| 620 | + | |
| 621 | + | |
| 622 | + | |
600 | 623 | | |
601 | 624 | | |
602 | | - | |
603 | 625 | | |
604 | 626 | | |
605 | 627 | | |
606 | 628 | | |
| 629 | + | |
| 630 | + | |
607 | 631 | | |
608 | 632 | | |
609 | 633 | | |
| |||
616 | 640 | | |
617 | 641 | | |
618 | 642 | | |
| 643 | + | |
| 644 | + | |
| 645 | + | |
| 646 | + | |
| 647 | + | |
| 648 | + | |
| 649 | + | |
| 650 | + | |
| 651 | + | |
| 652 | + | |
| 653 | + | |
| 654 | + | |
| 655 | + | |
| 656 | + | |
619 | 657 | | |
620 | 658 | | |
621 | 659 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
65 | 65 | | |
66 | 66 | | |
67 | 67 | | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
68 | 76 | | |
69 | 77 | | |
70 | 78 | | |
| |||
109 | 117 | | |
110 | 118 | | |
111 | 119 | | |
| 120 | + | |
112 | 121 | | |
113 | 122 | | |
114 | 123 | | |
| |||
315 | 324 | | |
316 | 325 | | |
317 | 326 | | |
318 | | - | |
| 327 | + | |
| 328 | + | |
319 | 329 | | |
320 | 330 | | |
321 | 331 | | |
| |||
324 | 334 | | |
325 | 335 | | |
326 | 336 | | |
327 | | - | |
| 337 | + | |
328 | 338 | | |
329 | 339 | | |
330 | 340 | | |
| |||
339 | 349 | | |
340 | 350 | | |
341 | 351 | | |
| 352 | + | |
342 | 353 | | |
343 | 354 | | |
344 | 355 | | |
| |||
488 | 499 | | |
489 | 500 | | |
490 | 501 | | |
491 | | - | |
492 | | - | |
493 | | - | |
| 502 | + | |
| 503 | + | |
| 504 | + | |
| 505 | + | |
| 506 | + | |
| 507 | + | |
| 508 | + | |
| 509 | + | |
| 510 | + | |
494 | 511 | | |
495 | | - | |
| 512 | + | |
| 513 | + | |
| 514 | + | |
496 | 515 | | |
497 | 516 | | |
498 | | - | |
499 | 517 | | |
500 | 518 | | |
501 | 519 | | |
502 | 520 | | |
| 521 | + | |
| 522 | + | |
503 | 523 | | |
504 | 524 | | |
505 | 525 | | |
| |||
509 | 529 | | |
510 | 530 | | |
511 | 531 | | |
| 532 | + | |
| 533 | + | |
| 534 | + | |
| 535 | + | |
| 536 | + | |
| 537 | + | |
| 538 | + | |
| 539 | + | |
| 540 | + | |
512 | 541 | | |
513 | 542 | | |
514 | 543 | | |
| |||
Lines changed: 7 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
316 | 316 | | |
317 | 317 | | |
318 | 318 | | |
319 | | - | |
320 | 319 | | |
321 | 320 | | |
322 | 321 | | |
| |||
332 | 331 | | |
333 | 332 | | |
334 | 333 | | |
335 | | - | |
336 | | - | |
337 | | - | |
338 | | - | |
339 | 334 | | |
340 | 335 | | |
341 | 336 | | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
342 | 344 | | |
343 | 345 | | |
344 | 346 | | |
| |||
Lines changed: 32 additions & 8 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
92 | 92 | | |
93 | 93 | | |
94 | 94 | | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
95 | 102 | | |
96 | 103 | | |
97 | 104 | | |
| |||
136 | 143 | | |
137 | 144 | | |
138 | 145 | | |
139 | | - | |
140 | | - | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
141 | 157 | | |
142 | 158 | | |
143 | 159 | | |
144 | | - | |
145 | | - | |
| 160 | + | |
| 161 | + | |
146 | 162 | | |
147 | 163 | | |
148 | 164 | | |
| |||
163 | 179 | | |
164 | 180 | | |
165 | 181 | | |
166 | | - | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
167 | 192 | | |
168 | | - | |
169 | | - | |
| 193 | + | |
| 194 | + | |
170 | 195 | | |
171 | 196 | | |
172 | 197 | | |
173 | 198 | | |
174 | | - | |
175 | 199 | | |
176 | 200 | | |
177 | 201 | | |
| |||
0 commit comments