From c3d70dfbfa9a9ed8c137597301574e87951ceed9 Mon Sep 17 00:00:00 2001 From: Matt Van Horn <455140+mvanhorn@users.noreply.github.com> Date: Sun, 15 Mar 2026 20:49:15 -0700 Subject: [PATCH] fix(dashboard): stop auto-archiving Done/Cancelled tasks in UI filter The isArchived() function treated all Done/Cancelled tasks as archived, hiding them from the active view immediately on completion. This caused tasks with incomplete progress to appear archived prematurely. Change isArchived() to only check the explicit archived flag, matching the server-side archival logic. Done tasks now stay visible until the user explicitly archives them. Fixed in both dashboard/dashboard.html and edict/frontend/src/store.ts. Note: dashboard/dist/ needs a rebuild (npm run build) to pick up the React source change. Closes #54 Co-Authored-By: Claude Opus 4.6 --- dashboard/dashboard.html | 4 ++-- edict/frontend/src/store.ts | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/dashboard/dashboard.html b/dashboard/dashboard.html index 49eb28d..ef8336f 100644 --- a/dashboard/dashboard.html +++ b/dashboard/dashboard.html @@ -940,8 +940,8 @@ function isEdict(t){ return /^JJC-/i.test(t.id||'') } // 系统会话:OC-* / MC-* 开头 function isSession(t){ return /^(OC-|MC-)/i.test(t.id||'') } -// 归档判定:Done/Cancelled 或手动标记 archived -function isArchived(t){ return t.archived || ['Done','Cancelled'].includes(t.state) } +// 归档判定:仅检查显式 archived 标记(Done/Cancelled 留在活跃视图,等用户手动归档) +function isArchived(t){ return !!t.archived } let edictFilter = 'active'; // 'active' | 'archived' | 'all' function setEdictFilter(f){ edictFilter = f; diff --git a/edict/frontend/src/store.ts b/edict/frontend/src/store.ts index 092ef92..6c0d89e 100644 --- a/edict/frontend/src/store.ts +++ b/edict/frontend/src/store.ts @@ -66,7 +66,7 @@ export function isSession(t: Task): boolean { } export function isArchived(t: Task): boolean { - return t.archived || ['Done', 'Cancelled'].includes(t.state); + return !!t.archived; } export type PipeStatus = { key: string; dept: string; icon: string; action: string; status: 'done' | 'active' | 'pending' };