From d8cccbb9e002745106d59c14b9509d4f911430fc Mon Sep 17 00:00:00 2001 From: Masahiko AMANO Date: Mon, 22 Jun 2026 22:20:39 +0300 Subject: [PATCH] fix(frontend): resolve duplicate actions in place without a full reload MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Every action button (Not a dup, Delete, Merge) called reload(), which wiped the whole cluster list and refetched from offset 0 — re-running the costly server-side clustering and jumping the scroll to the top on each tap. Give each cluster a stable local key and edit it in place: drop the resolved file from its cluster, removing the cluster when fewer than two files remain. The server view is live, so subsequent pages reconcile. A separate monotonic page cursor keeps "Load more" from repeating clusters after local removals. --- .../src/routes/files/duplicates/+page.svelte | 105 ++++++++++++------ 1 file changed, 73 insertions(+), 32 deletions(-) diff --git a/frontend/src/routes/files/duplicates/+page.svelte b/frontend/src/routes/files/duplicates/+page.svelte index 93ab502..0e91fd4 100644 --- a/frontend/src/routes/files/duplicates/+page.svelte +++ b/frontend/src/routes/files/duplicates/+page.svelte @@ -1,7 +1,7 @@ @@ -155,9 +196,9 @@ {/if} - {#each clusters as c (clusterKey(c))} + {#each clusters as c (c.key)} {@const keep = keeperId(c)} -
+
{#each c.files as f (f.id)}