diff --git a/internal/web/static/app.css b/internal/web/static/app.css index ea4bf6e..12bc281 100644 --- a/internal/web/static/app.css +++ b/internal/web/static/app.css @@ -98,7 +98,6 @@ input:focus { outline: 0; border-color: var(--accent); } display: flex; justify-content: space-between; padding: 2px 0; font-family: ui-monospace, monospace; font-variant-numeric: tabular-nums; } -.switches { font-size: 12px; color: var(--ink-dim); margin-top: 8px; } /* Review summary band */ .summary { font-size: 14px; } diff --git a/internal/web/static/app.js b/internal/web/static/app.js index fe6cae3..98adf5a 100644 --- a/internal/web/static/app.js +++ b/internal/web/static/app.js @@ -35,7 +35,7 @@ function setStateAttr(state) { } function evidenceBlock(ev) { - if (!ev) return ''; + if (!ev) return ``; const health = ev.available ? `tracking` : `evidence unavailable: ${ev.reason || 'unknown'}`; @@ -43,13 +43,20 @@ function evidenceBlock(ev) { ? `${ev.current.class || '?'} · ${ev.current.title || ''}` : '—'; const rows = (ev.buckets || []).map(b => `
  • ${(b.class || '?')} · ${b.title || ''}${fmt(b.seconds)}
  • `).join(''); - return `
    + return `
    now ${now}   ${health}
    -
    context switches: ${ev.switch_count || 0}
    `; } +// updateActiveEvidence repaints the live evidence band (current window, per-window +// buckets, switch count) on every active tick. The band carries no event listeners, +// so swapping outerHTML wholesale is safe and keeps a single render source. +function updateActiveEvidence(state) { + const el = document.getElementById('evidence'); + if (el) el.outerHTML = evidenceBlock(state.evidence); +} + // reviewSummary renders a presentational recap from already-available state: // the commitment plus the per-window evidence buckets. No new backend data. function reviewSummary(ev) { @@ -213,6 +220,7 @@ function render(state) { } if (rs === 'active' && renderedState === 'active') { updateActiveDrift(state); + updateActiveEvidence(state); return; } if (countdownTimer) { clearInterval(countdownTimer); countdownTimer = null; }