From 9a14c502507fa2eb9b68b04972b05ca171736d81 Mon Sep 17 00:00:00 2001 From: Masahiko AMANO Date: Thu, 11 Jun 2026 15:49:34 +0300 Subject: [PATCH] fix(frontend): reload the file grid on filter/sort change MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Changing the filter (or sort/order) reset the grid to empty but never fetched page 1 — the reset effect only loaded for the deep-link anchor case and otherwise relied on InfiniteScroll, which doesn't re-trigger without a remount or scroll. So filtering blanked the list until a hard refresh. Load page 1 from the reset effect itself for the non-anchor case (guarded by `loading`, so it doesn't double-fetch with InfiniteScroll's mount load). Co-Authored-By: Claude Opus 4.8 --- frontend/src/routes/files/+page.svelte | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/frontend/src/routes/files/+page.svelte b/frontend/src/routes/files/+page.svelte index 0c20714..0698679 100644 --- a/frontend/src/routes/files/+page.svelte +++ b/frontend/src/routes/files/+page.svelte @@ -119,9 +119,13 @@ error = ''; // Deep-link return carrying a position anchor but no loaded grid: load a // window centred on the anchor instead of page 1, so we can scroll to it - // and grow the grid in both directions. + // and grow the grid in both directions. Otherwise (first mount, or a sort/ + // filter change) load page 1 right here — the list isn't remounted on a + // query change, so InfiniteScroll won't re-trigger on its own. if (firstRun && anchorParam) { void loadAroundAnchor(anchorParam); + } else { + void loadMore(); } });