Skip to content

Commit e8d8e98

Browse files
xmapclaude
andauthored
docs(scrubber): label science projections and fix hidden in-flight #3 (#491)
Add per-projection index labels (1..6) under the Acquire-lane triangles so the audience can count the sequence and read the interrupted-then-restarted #3 as a retry, mirroring the i# caps on the iteration bands. Atomic marks get labels only, not verdict bands; the Scan phase bar carries the grouping. Fix the in-flight #3 triangle vanishing for earlier cursor positions: it was bundled with the dashed open interval and toggled via display:none across the whole pre-flight span. Separate the triangle so it future-fades like every other projection before the cursor reaches it, and hide it only after re-acquire when the solid #3 takes over. Co-authored-by: Claude <noreply@anthropic.com>
1 parent 1741174 commit e8d8e98

2 files changed

Lines changed: 29 additions & 4 deletions

File tree

docs/javascripts/scrubber-demo.js

Lines changed: 23 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -386,12 +386,25 @@
386386
projs.forEach((a) => {
387387
if (a.result !== "ok") return;
388388
const x = X(parseT(a.sampled_at) - run.t0);
389+
const tt = parseT(a.sampled_at) - run.t0;
389390
const tri = svg("polygon", {
390391
points: `${x},${yA - 5} ${x - 5},${yA + 4} ${x + 5},${yA + 4}`,
391392
class: "cs-mark cs-mark--projection",
392393
});
393394
g.appendChild(tri);
394-
timed.push({ el: tri, t: parseT(a.sampled_at) - run.t0 });
395+
timed.push({ el: tri, t: tt });
396+
// Index label under each projection: the count makes the interrupted #3
397+
// legible as a retry (its number reappears after the hold), mirroring the
398+
// i# caps on the iteration bands above.
399+
const lab = svg("text", {
400+
x,
401+
y: yA + 16,
402+
class: "cs-projlabel",
403+
"text-anchor": "middle",
404+
});
405+
lab.textContent = String(a.payload.params.index);
406+
g.appendChild(lab);
407+
timed.push({ el: lab, t: tt });
395408
});
396409

397410
// Open interval for the in-flight projection (drawn dynamically on fold).
@@ -479,12 +492,18 @@
479492
el.classList.toggle("cs-future", et > t + 1e-6);
480493
}
481494

482-
// The in-flight open interval: visible only while #3 is open at the cursor.
483-
const open = folded.inflightIdx !== null && t >= scene.inflightT && t < scene.reacq;
495+
// The in-flight open interval: the dashed line and label appear only while
496+
// #3 is open at the cursor. The triangle itself stays on the lane as a
497+
// future-faded mark before the cursor reaches it (like every other
498+
// projection), and is hidden only after re-acquire, when the solid #3 takes
499+
// over. Toggling it via cs-hidden for the whole pre-flight span was the bug:
500+
// it vanished instead of dimming for earlier cursor positions.
484501
const showOpen = t >= scene.inflightT && t < scene.reacq;
485-
[scene.openLine, scene.openTip, scene.openLab].forEach((el) =>
502+
[scene.openLine, scene.openLab].forEach((el) =>
486503
el.classList.toggle("cs-hidden", !showOpen),
487504
);
505+
scene.openTip.classList.toggle("cs-hidden", t >= scene.reacq);
506+
scene.openTip.classList.toggle("cs-future", t < scene.inflightT - 1e-6);
488507
if (showOpen) {
489508
scene.openLine.setAttribute("x2", X(t));
490509
scene.openLab.setAttribute("x", (X(scene.inflightT) + X(t)) / 2);

docs/stylesheets/extra.css

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1028,6 +1028,12 @@ body::before {
10281028
.cs-mark--check { fill: var(--cs-state); }
10291029
.cs-mark--projection { fill: var(--cs-sub); }
10301030
.cs-mark--inflight { fill: var(--cs-alarm); }
1031+
.cs-projlabel {
1032+
fill: var(--cs-sub);
1033+
font-family: "JetBrains Mono", monospace;
1034+
font-size: 9.5px;
1035+
text-anchor: middle;
1036+
}
10311037
.cs-mark--save { fill: var(--cs-mute); }
10321038

10331039
.cs-future { opacity: 0.22; }

0 commit comments

Comments
 (0)