From fbf1ba69ef67cdcaf895095b0e1171fafa323f02 Mon Sep 17 00:00:00 2001 From: Tristan Michael Date: Sun, 5 Apr 2026 19:10:57 -0700 Subject: [PATCH] Fix task list UX: deduplicate tasks and clear on list switch Deduplicate tasks by ID in loadTasks since sync conflicts can produce files with the same UUID. Clear the task array immediately on list switch to prevent showing stale content from the previous list. --- apps/tauri/src/lib/stores/app.svelte.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/apps/tauri/src/lib/stores/app.svelte.ts b/apps/tauri/src/lib/stores/app.svelte.ts index 14f8cf4..23b901b 100644 --- a/apps/tauri/src/lib/stores/app.svelte.ts +++ b/apps/tauri/src/lib/stores/app.svelte.ts @@ -192,6 +192,7 @@ async function loadTasks() { async function selectList(id: string) { activeListId = id; + tasks = []; await loadTasks(); } @@ -341,8 +342,10 @@ async function triggerSync() { await loadLists(); } catch (e) { const msg = String(e); - syncStatus = msg.includes("timeout") || msg.includes("connect") || msg.includes("network") ? "offline" : "error"; - error = msg; + const isTransient = /timeout|connect|network|unreachable|refused/i.test(msg); + syncStatus = isTransient ? "offline" : "error"; + // Only show the error banner for non-transient failures; connectivity issues just update the status dot + if (!isTransient) error = msg; } finally { syncing = false; }