From f286609ec0377864a4245448d6c65f5ce8ab7650 Mon Sep 17 00:00:00 2001 From: Felix Martin Date: Sun, 31 May 2026 12:55:43 -0400 Subject: [PATCH] M1: render evidence (current window, buckets, switches) in UI Co-Authored-By: Claude Opus 4.8 --- internal/web/static/index.html | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/internal/web/static/index.html b/internal/web/static/index.html index bd7d4f3..3f511f4 100644 --- a/internal/web/static/index.html +++ b/internal/web/static/index.html @@ -21,6 +21,13 @@ .meta { color: #9aa0b4; } .pill { display: inline-block; font-size: 12px; letter-spacing: .15em; text-transform: uppercase; color: #7a8095; border: 1px solid #272b38; border-radius: 999px; padding: 3px 10px; } + .ev { margin-top: 18px; border-top: 1px solid #272b38; padding-top: 14px; } + .ev .now { font-size: 14px; color: #cdd2e0; } + .ev .health-ok { color: #5fd08a; } + .ev .health-bad { color: #e0b15f; } + .buckets { list-style: none; padding: 0; margin: 10px 0 0; font-size: 13px; color: #9aa0b4; } + .buckets li { display: flex; justify-content: space-between; padding: 2px 0; font-variant-numeric: tabular-nums; } + .switches { font-size: 13px; color: #7a8095; margin-top: 8px; } @@ -47,6 +54,22 @@ function fmt(secs) { return `${m}:${s}`; } +function evidenceBlock(ev) { + if (!ev) return ''; + const health = ev.available + ? `tracking` + : `evidence unavailable: ${ev.reason || 'unknown'}`; + const now = ev.current && (ev.current.class || ev.current.title) + ? `${ev.current.class || '?'} · ${ev.current.title || ''}` : '—'; + const rows = (ev.buckets || []).map(b => + `
  • ${(b.class || '?')} · ${b.title || ''}${fmt(b.seconds)}
  • `).join(''); + return `
    +
    Now: ${now}   ${health}
    +
      ${rows}
    +
    Context switches: ${ev.switch_count || 0}
    +
    `; +} + function render(state) { if (countdownTimer) { clearInterval(countdownTimer); countdownTimer = null; } const rs = state.runtime_state; @@ -76,6 +99,7 @@ function render(state) {
    --:--
    ${c.next_action || ''}

    Done when: ${c.success_condition || ''}

    + ${evidenceBlock(state.evidence)} `; document.getElementById('done').onclick = () => post('/complete'); const t = document.getElementById('t'); @@ -87,6 +111,7 @@ function render(state) { view.innerHTML = `Review

    Session ended

    ${c.next_action || ''}

    + ${evidenceBlock(state.evidence)} `; document.getElementById('end').onclick = () => post('/end'); } else {