From d0b038e17d611b373d123c86bdb01b2647fb631a Mon Sep 17 00:00:00 2001 From: iris Date: Fri, 5 Jun 2026 10:18:23 +0200 Subject: [PATCH] fix(dashboard): refresh reminders on SCH3DUL3S tab activation + update stale comments - activateTab('schedules') now calls both refreshSchedules() and refreshReminders() since both sections live on the same tab. (The previous SYST3M/system target was wrong.) - Update index.html comment to reflect schedules_changed SSE coverage - Update index.html reminders comment to mention reminders_changed SSE - Update tabs.js reminders section comment to reflect SSE coverage --- frontend/packages/dashboard/src/index.html | 12 +++++++----- frontend/packages/dashboard/src/tabs.js | 15 ++++++++------- 2 files changed, 15 insertions(+), 12 deletions(-) diff --git a/frontend/packages/dashboard/src/index.html b/frontend/packages/dashboard/src/index.html index 6584ea29..91ff3a94 100644 --- a/frontend/packages/dashboard/src/index.html +++ b/frontend/packages/dashboard/src/index.html @@ -229,9 +229,10 @@ toggle for existing schedules. Schedules list driven by GET /api/schedules; POST /api/schedules to create, PATCH /api/schedules/{id} to edit, POST /api/schedules/{id}/cancel - for per-target / whole-row cancel. No SchedulesChanged SSE - event yet, so the list re-fetches on tab activation + after - each submit / cancel. See docs/web-ui.md::SCH3DUL3S tab. --> + for per-target / whole-row cancel. Live updates via + `schedules_changed` SSE; tab activation re-fetches as a + safety net for disconnect windows. + See docs/web-ui.md::SCH3DUL3S tab. -->

◆ SCH3DUL3S ◆

@@ -245,8 +246,9 @@ on this tab so the operator has one place for everything that fires at a future time — operator-set schedules above, agent-self reminders here. Backed by GET - /api/reminders; refresh handled by refreshReminders() - (called from refreshState). --> + /api/reminders; live updates via `reminders_changed` SSE; + refreshReminders() called from refreshState + tab + activation as safety net for disconnect windows. -->

◆ QU3U3D R3M1ND3RS ◆

══════════════════════════════════════════════════════════════

reminders agents have queued for themselves but not yet delivered. cancel to drop a stuck or unwanted entry.

diff --git a/frontend/packages/dashboard/src/tabs.js b/frontend/packages/dashboard/src/tabs.js index 31e6b7a2..db49837f 100644 --- a/frontend/packages/dashboard/src/tabs.js +++ b/frontend/packages/dashboard/src/tabs.js @@ -2375,11 +2375,10 @@ window.marked = marked; // ─── reminders ────────────────────────────────────────────────────────── // Reminders aren't part of /api/state (separate sqlite table, separate - // mutation cadence). Refresh fires alongside refreshState() so a - // cancel POST or a cold load both reflect within the same tick. A - // periodic poll isn't necessary — new reminders are queued by the - // agents themselves and the operator already sees them next time - // they interact with the page. + // mutation cadence). refreshReminders() is called from refreshState() for + // cold-load and reconnect recovery. Live mutations are covered by the + // `reminders_changed` SSE event → `applyRemindersChanged` so no periodic + // poll is needed. async function refreshReminders() { const liveRoot = $('reminders-section'); if (!liveRoot) return; @@ -3664,8 +3663,10 @@ window.marked = marked; updateTabbarOverflow(); // Re-fetch schedules on activation as a safety net (SSE covers // live mutations but re-sync ensures consistency after disconnect - // windows or approval-path inserts that don't yet emit). - if (target === 'schedules') refreshSchedules(); + // windows or approval-path inserts that don't yet emit). Also + // re-fetch reminders on SCH3DUL3S activation since both sections + // live on the same tab. + if (target === 'schedules') { refreshSchedules(); refreshReminders(); } // Permissions tables (capabilities + tool-groups) have no SSE channel; // fetch both on each activation so the operator sees fresh data. if (target === 'permissions') {