From 35ab8aadb9c624db67fc406257d80e80e4b325d8 Mon Sep 17 00:00:00 2001 From: xmap <16776958+xmap@users.noreply.github.com> Date: Fri, 28 Aug 2026 18:53:14 -0500 Subject: [PATCH] Make the rewind scrubber render a subject-neutral timeline document The scrubber read a Run-shaped payload directly (history.events, history.observations, five hardcoded Run event-type strings), so every future lens over a different kind of subject would have meant new frontend branching. It now renders a generic document -- a time domain plus marker/series lanes, each marker optionally carrying the state it puts its subject into -- so adding a lens later is a server-side change with no frontend work. A small bridge adapter in page.html converts today's unchanged run_history wire payload into that document shape; it is expected to move server-side and disappear once the producer emits documents directly. Also fixes three defects found while reading the code for this: the whole --cs-* color palette was defined on a class (.cora-scrubber) that nothing ever applied to the mount root, so the scrubber has been rendering unstyled; backToLive() never called the mount's own cleanup, leaking a running requestAnimationFrame loop against detached DOM; and scaffold() interpolated a run's name/status into innerHTML unescaped, the one injection hole on an otherwise textContent-only page. Verified against a real browser (Playwright) driving a fake relay: palette resolves, XSS payload renders as escaped text, and the folded readout correctly walks active -> paused -> active -> ended across a Started/Held/Resumed/Completed sequence with per-lane readings. Co-Authored-By: Claude Sonnet 5 --- docs/stack/frontend.md | 16 +- infra/status-relay/page.html | 76 +++++++- infra/status-relay/scrubber.js | 319 +++++++++++++++++++-------------- 3 files changed, 267 insertions(+), 144 deletions(-) diff --git a/docs/stack/frontend.md b/docs/stack/frontend.md index 82734e990f2..6cdb69a5f3b 100644 --- a/docs/stack/frontend.md +++ b/docs/stack/frontend.md @@ -10,10 +10,18 @@ static HTML file with a `