From 3101469b4db6d5c1858ee1754824f0e05ae83e83 Mon Sep 17 00:00:00 2001 From: Flux Labs Date: Sun, 15 Mar 2026 19:12:48 -0500 Subject: [PATCH] fix(auto): refresh progress widget from disk every 5s during unit execution (#549) (#552) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The progress bar in the auto-mode widget was snapshot-based — only updated at dispatch time via updateSliceProgressCache(). During long-running units (especially after the worktree architecture in PR #506), the bar appeared frozen even as tasks completed on disk. Add a 5-second interval inside the widget that re-reads the roadmap and plan files from disk, so slice/task progress reflects reality without waiting for the next unit dispatch. Closes #549 --- src/resources/extensions/gsd/auto-dashboard.ts | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/resources/extensions/gsd/auto-dashboard.ts b/src/resources/extensions/gsd/auto-dashboard.ts index 2131f3a7f..a31843876 100644 --- a/src/resources/extensions/gsd/auto-dashboard.ts +++ b/src/resources/extensions/gsd/auto-dashboard.ts @@ -265,6 +265,16 @@ export function updateProgressWidget( tui.requestRender(); }, 800); + // Refresh progress cache from disk every 5s so the widget reflects + // task/slice completion mid-unit. Without this, the progress bar only + // updates at dispatch time, appearing frozen during long-running units. + const progressRefreshTimer = mid ? setInterval(() => { + try { + updateSliceProgressCache(accessors.getBasePath(), mid.id, slice?.id); + cachedLines = undefined; + } catch { /* non-fatal */ } + }, 5_000) : null; + return { render(width: number): string[] { if (cachedLines && cachedWidth === width) return cachedLines; @@ -416,6 +426,7 @@ export function updateProgressWidget( }, dispose() { clearInterval(pulseTimer); + if (progressRefreshTimer) clearInterval(progressRefreshTimer); }, }; });