From 435be4302e3252519fbc51cf6f93373411ddbd3e Mon Sep 17 00:00:00 2001 From: iris Date: Fri, 5 Jun 2026 10:55:30 +0200 Subject: [PATCH] fix(dashboard): init_config kind label in approval history + remove dead ticker loop MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Two small fixes in tabs.js: 1. renderApprovalHistory showed 'spawn' for init_config approvals. The pending-approvals path already handles the three kinds correctly (apply / init / spawn); history used a two-branch ternary that fell through to 'spawn' for init_config. Fixed to match the pending path. 2. The 1s interval that ticks rebuild-queue elapsed badges contained a second loop polling '.build-logs-runtime[data-bl-elapsed]'. No code in tabs.js ever sets that attribute — the logs page manages its own elapsed timers inside logs.js. Removed the dead loop. --- frontend/packages/dashboard/src/tabs.js | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/frontend/packages/dashboard/src/tabs.js b/frontend/packages/dashboard/src/tabs.js index ab4974b0..f8fb9bd8 100644 --- a/frontend/packages/dashboard/src/tabs.js +++ b/frontend/packages/dashboard/src/tabs.js @@ -2087,7 +2087,7 @@ window.marked = marked; el('span', { class: 'glyph glyph-' + a.status }, glyph), ' ', el('span', { class: 'id' }, '#' + a.id), ' ', el('span', { class: 'agent' }, a.agent), ' ', - el('span', { class: 'kind' }, a.kind === 'apply_commit' ? 'apply' : 'spawn'), ' ', + el('span', { class: 'kind' }, a.kind === 'apply_commit' ? 'apply' : a.kind === 'init_config' ? 'init' : 'spawn'), ' ', ); if (a.sha_short) row.append(el('code', {}, a.sha_short), ' '); row.append( @@ -2374,6 +2374,10 @@ window.marked = marked; // Tick once per second to refresh "running Xs" badges in place // (mirrors the question-TTL ticker pattern above). + // Tick rebuild-queue elapsed-time badges once per second. + // `.rqe-when[data-rqe-elapsed]` is set on running queue entries by + // `renderQueueEntry`; the ticker avoids a full re-render just for the + // wall-clock update. setInterval(() => { for (const span of document.querySelectorAll('.rqe-when[data-rqe-elapsed]')) { const started = parseInt(span.dataset.rqeElapsed, 10); @@ -2381,12 +2385,6 @@ window.marked = marked; const elapsed = Math.max(0, Math.floor(Date.now() / 1000 - started)); span.textContent = '· ' + fmtElapsed(elapsed); } - for (const span of document.querySelectorAll('.build-logs-runtime[data-bl-elapsed]')) { - const started = parseInt(span.dataset.blElapsed, 10); - if (!started) continue; - const elapsed = Math.max(0, Math.floor(Date.now() / 1000 - started)); - span.textContent = fmtElapsed(elapsed); - } }, 1000); // ─── reminders ──────────────────────────────────────────────────────────