diff --git a/docs/web-ui/dashboard.md b/docs/web-ui/dashboard.md index 75fe842b..d46f953c 100644 --- a/docs/web-ui/dashboard.md +++ b/docs/web-ui/dashboard.md @@ -657,12 +657,8 @@ renderApprovals`) with three stacked sections: - **identity header** — glyph, `#id`, agent, kind chip, (for `apply_commit`) the short proposal sha as ``, and a right-aligned `requested ago` relative time from - `ApprovalView.requested_at`. The chip ticks live every second - via a `data-requested-at` attribute + client-side interval (no - re-render). Turns amber once the request has been pending ≥ 1h - so a stale approval stands out; the `.stale` class flips - precisely at the 3600s boundary rather than at the next - `renderApprovals` call. + `ApprovalView.requested_at` — amber once the request has been + pending ≥ 1h so a stale approval stands out. - **what-changed body** — the manager's description, then drill-in triggers: `↳ view diff` opens the diff in the side panel; `↳ commit on forge ↗` deep-links the proposal commit diff --git a/frontend/packages/dashboard/src/tabs.js b/frontend/packages/dashboard/src/tabs.js index 54325005..3f4ad6a3 100644 --- a/frontend/packages/dashboard/src/tabs.js +++ b/frontend/packages/dashboard/src/tabs.js @@ -1994,22 +1994,6 @@ window.marked = marked; }); }, 30_000); - // Live ticker for approval request-age chips. Approval cards only - // re-render on `approval_added`/`approval_resolved` SSE events, so - // a request pending for an hour could still show "0s ago" without - // this ticker. Also flips `.stale` (amber highlight) at exactly 1h - // rather than only at the next re-render. - setInterval(() => { - const now = Math.floor(Date.now() / 1000); - document.querySelectorAll('.approval-ts[data-requested-at]').forEach((node) => { - const requestedAt = Number(node.getAttribute('data-requested-at')); - if (!Number.isFinite(requestedAt)) return; - const ageSec = Math.max(0, now - requestedAt); - node.textContent = 'requested ' + fmtAgo(requestedAt); - node.classList.toggle('stale', ageSec >= 3600); - }); - }, 1000); - const APPROVAL_TAB_KEY = 'hyperhive:approvals:tab'; // Derived approval state — cold-loaded from /api/state, then mutated // live by `approval_added` / `approval_resolved` dashboard events. @@ -2264,7 +2248,6 @@ window.marked = marked; head.append(el('span', { class: 'approval-ts' + (ageSec >= 3600 ? ' stale' : ''), title: 'requested ' + new Date(a.requested_at * 1000).toLocaleString(), - 'data-requested-at': String(a.requested_at), }, 'requested ' + fmtAgo(a.requested_at))); } li.append(head);