From f5295b5980694b7bc512cbd4efda558807bd8fe7 Mon Sep 17 00:00:00 2001 From: Tristan Michael Date: Mon, 6 Apr 2026 09:10:36 -0700 Subject: [PATCH] fix: reset tasks and remount screen on workspace change Reset the tasks array when switching workspaces to prevent stale task data from persisting. Wrap TasksScreen in a keyed block to force remounting when the current workspace changes, ensuring a clean state for each workspace. Configure line endings to use LF across all files for consistency. --- .gitattributes | 1 + apps/tauri/src/App.svelte | 4 +++- apps/tauri/src/lib/screens/TasksScreen.svelte | 1 + apps/tauri/src/lib/stores/app.svelte.ts | 1 + 4 files changed, 6 insertions(+), 1 deletion(-) create mode 100644 .gitattributes diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..6313b56 --- /dev/null +++ b/.gitattributes @@ -0,0 +1 @@ +* text=auto eol=lf diff --git a/apps/tauri/src/App.svelte b/apps/tauri/src/App.svelte index 6ce797f..5e29705 100644 --- a/apps/tauri/src/App.svelte +++ b/apps/tauri/src/App.svelte @@ -60,7 +60,9 @@ {:else if app.screen === "setup"} {:else} - + {#key app.config?.current_workspace} + + {/key} {/if} diff --git a/apps/tauri/src/lib/screens/TasksScreen.svelte b/apps/tauri/src/lib/screens/TasksScreen.svelte index bc84859..f05d2b1 100644 --- a/apps/tauri/src/lib/screens/TasksScreen.svelte +++ b/apps/tauri/src/lib/screens/TasksScreen.svelte @@ -25,6 +25,7 @@ } }); + function openTask(task: Task) { taskStack = [task.id]; } diff --git a/apps/tauri/src/lib/stores/app.svelte.ts b/apps/tauri/src/lib/stores/app.svelte.ts index 0bcdc81..c3859cb 100644 --- a/apps/tauri/src/lib/stores/app.svelte.ts +++ b/apps/tauri/src/lib/stores/app.svelte.ts @@ -133,6 +133,7 @@ async function switchWorkspace(id: string) { await invoke("set_current_workspace", { id }); config = await invoke("get_config"); activeListId = null; + tasks = []; await loadLists(); const ws = config?.workspaces[id]; if (ws) invoke("watch_workspace", { path: ws.path }).catch((e) => console.warn("File watcher failed:", e));