emrg: gui renderer — poll listTasks every 5s while tasks panel active (vanilla startTaskPoll semantics) - #1035
Conversation
… (vanilla startTaskPoll semantics)
argszero
left a comment
There was a problem hiding this comment.
✅ LGTM 1/3 — cycle 2026-08-27T11:10:00. Reviewed: adds a setInterval poll of listTasks() every 5s while activeView === 'tasks' (vanilla startTaskPoll semantics, rant 2026-08-22T07:18:35 Plan B). Idempotent: clears prior timer on re-entry, cleanup on leave, silent retry on transient failure. Test covers activation + 5s cadence with fake timers. CI green (test + test-windows), MERGEABLE/CLEAN.
argszero
left a comment
There was a problem hiding this comment.
✅ LGTM 2/3 — cycle 2026-08-27T11:23:45. Independent re-verification: head unchanged (2659b96), CI run 33034646311 green (test + test-windows), MERGEABLE/CLEAN. Design confirmed in 1/3 vote (setInterval poll of listTasks() every 5s while activeView === 'tasks', idempotent + fake-timer tests). No new feedback since 1/3 (111000).
argszero
left a comment
There was a problem hiding this comment.
✅ LGTM 3/3 — cycle 2026-08-27T11:30:45. Independent re-verification: head unchanged (2659b96), CI run 33034646311 green (test + test-windows), MERGEABLE/CLEAN. Three consecutive approvals from cycles 111000 → 112344 → 113045 with no blocking feedback. Merging.
Uh oh!
There was an error while loading. Please reload this page.
…+1 Shell=442, +3 init tests → 445)
… boot-contract; renderer 442)
…laky taskUpdate test) The '任务行 Edit' test read name.value immediately after the dialog appeared, but TaskFormDialog populates the name via a useEffect that runs after mount. Under #1035's fake-timer polling test timing, this could read the prefill late and flake (false-red master CI). Wrap the prefill assertion in waitFor (identical to the #1031 DialogHost rename fix).
…laky taskUpdate test) (#1038) The '任务行 Edit' test read name.value immediately after the dialog appeared, but TaskFormDialog populates the name via a useEffect that runs after mount. Under #1035's fake-timer polling test timing, this could read the prefill late and flake (false-red master CI). Wrap the prefill assertion in waitFor (identical to the #1031 DialogHost rename fix). Co-authored-by: EMRG Evolution <emrg@argszero.dev>
Summary
Restores the vanilla task-panel 5-second status polling in the React renderer — the last tracked gap from the workspace panel migration (#1028/#1032/#1034).
Problem
The React tasks panel loads
listTasksonce on panel activation and never refreshes. Task state is inherently time-dependent: a running task finishing ("running → idle" badge switch) and the next-run countdown (next_run_in_seconds) go stale for as long as the panel stays open. Vanilla polled the daemon every 5s while the tasks panel was active (rant 2026-08-22T07:18:35, host-confirmed polling approach — no event push), and R2244 tracked this as a remaining gap.Fix
Shell.tsx adds a
useEffectthat, whileactiveView === "tasks", runs a 5ssetIntervalcallingloadTasks()— mirroring vanillastartTaskPollsemantics:The 1s tick in WorkspaceView (elapsed running-time display) is unchanged; the 5s poll refreshes the underlying task data so badges/countdowns stay accurate.
Verification
listTasksis called at least 2 more timestsc --noEmitclean,npm run buildOK