commit 240a86fd4abb003888c9cfba6e48c6df4d80ed5a
parent c86fa096b0b0219386468026738d7c9bd8285117
Author: I Mean I'm Just Saying <imeanimjustsaying@kiwifarms.st>
Date: Sat, 24 Oct 2026 04:29:17 -0400
deck claim checks: the band and the spans go by membership (the rail's dates are not monotonic); the finale's marker labels stagger into three rows and honour markerLayout
A count's band runs from the first pip in his window (its clip's day, or a
stamp dated inside it) to the last, every pip outside the window dimmed,
inside the band too; a span is a bar over each run of its own pips. On the
finale's large rail the dimming is the track and each pip as a dot, so a
playing clip's ring stays whole. railMarkerLayout tried two rows and one
side, so a third crowded label drew over the others: it now tries three
rows and both sides, cuts a label only to the room it is laid in, and keeps
one row under markerLayout truncate, as the footer does.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Diffstat:
5 files changed, 144 insertions(+), 40 deletions(-)
diff --git a/umtool/report-to-video/chrome-claims.mjs b/umtool/report-to-video/chrome-claims.mjs
@@ -100,8 +100,8 @@ export function claimsCues(cl, { put, add, segIndex, W }) {
}
(it.spans ?? []).forEach((sp, k) => {
const lit = at + 0.25 + (m.spans * k) / Math.max(1, it.spans.length);
- put(`c${j}.s${k}`, { autoAlpha: 0, scaleX: 0, transformOrigin: "0% 50%" });
- add(`c${j}.s${k}`, lit, 0.3, { autoAlpha: 1, scaleX: 1, transformOrigin: "0% 50%" }, "power2.out", `${why} span`);
+ put(`c${j}.s${k}`, { autoAlpha: 0, scaleY: 0.2 });
+ add(`c${j}.s${k}`, lit, 0.3, { autoAlpha: 1, scaleY: 1 }, "back.out(2)", `${why} span`);
out(`c${j}.s${k}`);
put(`c${j}.sl${k}`, { autoAlpha: 0, y: 6 });
add(`c${j}.sl${k}`, lit + 0.1, 0.25, { autoAlpha: 1, y: 0 }, "power2.out", `${why} span`);
@@ -166,7 +166,7 @@ export function claimsMarkup(cl, { lay, pal, ground, pipSize }) {
});
}
(it.spans ?? []).forEach((sp, k) => {
- track.push(`<div class="cspan" data-k="c${j}.s${k}" style="left:${sp.a}px; width:${r4(sp.b - sp.a)}px"></div>`);
+ track.push(`<div class="cspan-set" data-k="c${j}.s${k}">${sp.bars.map((bar) => `<div class="cspan" style="left:${bar.a}px; width:${r4(bar.b - bar.a)}px"></div>`).join("")}</div>`);
track.push(`<div class="ctag cspl" data-k="c${j}.sl${k}" style="left:${r4(sp.cx - 110)}px; width:220px">${esc(sp.label)}</div>`);
});
// His words, and the record under them.
@@ -211,6 +211,7 @@ export function claimsMarkup(cl, { lay, pal, ground, pipSize }) {
box-shadow: inset 0 0 0 1px rgba(229, 83, 75, 0.55); }
.cveil { position: absolute; top: -13px; height: 26px; }
.cring { position: absolute; border-radius: 50%; box-shadow: 0 0 0 3px ${red}, 0 0 16px 4px rgba(229, 83, 75, 0.55); }
+ .cspan-set { position: absolute; left: 0; top: 0; width: 0; height: 0; }
.cspan { position: absolute; top: -5px; height: 10px; border-radius: 5px; background: ${red};
box-shadow: 0 0 14px 3px rgba(229, 83, 75, 0.5); }
.ctag { position: absolute; top: 12px; width: 100px; height: 22px; text-align: center; white-space: nowrap;
@@ -258,7 +259,7 @@ export function claimsMarkup(cl, { lay, pal, ground, pipSize }) {
*
* @returns {{ items: any[], rowTops: number[] }}
*/
-export function finaleClaims(fcl, { toBig, Y, top, markerRows = 0, bigX, size, textWidth, ringSize }) {
+export function finaleClaims(fcl, { toBig, Y, top, markerRows = 0, bigX, size, textWidth, ringSize, pips = [] }) {
const r2 = (v) => Math.round(v * 100) / 100;
const rowTops = [];
for (let r = Math.max(1, markerRows); ; r += 1) {
@@ -284,16 +285,22 @@ export function finaleClaims(fcl, { toBig, Y, top, markerRows = 0, bigX, size, t
const items = fcl.items.map((it, j) => {
if (it.kind === "count") {
const band = it.band ? { a: r2(toBig(it.band.a)), b: r2(toBig(it.band.b)) } : null;
+ // Dimmed: the track under each veil, and each pip under one as a dot of
+ // its own size -- a finale pip's ring (it is playing) stays whole.
const veils = (it.veils ?? []).map(([a, b]) => [r2(toBig(a)), r2(toBig(b))]);
+ const dots = pips.filter((p) => veils.some(([a, b]) => p.x > a && p.x < b)).map((p) => ({ x: p.x, size: p.size + 4 }));
const rings = it.band ? it.tags.map((t) => ({ x: bigX(t.k), size: ringSize })) : [];
- const spans = (it.spans ?? []).map((sp) => ({ a: r2(toBig(sp.a)), b: r2(toBig(sp.b)), cx: r2(toBig(sp.cx)), label: sp.label }));
+ const spans = (it.spans ?? []).map((sp) => ({
+ a: r2(toBig(sp.a)), b: r2(toBig(sp.b)), cx: r2(toBig(sp.cx)), label: sp.label,
+ bars: sp.bars.map((bar) => ({ a: r2(toBig(bar.a)), b: r2(toBig(bar.b)) })),
+ }));
const record = it.band ? `${it.total} ${it.noun} on camera` : spans.map((sp) => sp.label).join(" · ") || "none on camera";
const w = words(it.said, record);
const left = band ? band.a : spans.length ? spans[0].a : bigX(0);
// A band's words hang from its left edge; a per claim's from nothing (its spans carry their counts).
const label = { ...w, left: r2(left), stickX: band ? r2(left + 1) : null, j };
labels.push(label);
- return { kind: "count", j, band, veils, rings, spans, label };
+ return { kind: "count", j, band, veils, dots, rings, spans, label };
}
const steps = it.steps.map((st, s) => {
const a = r2(toBig(st.a)), b = r2(toBig(st.b));
@@ -337,10 +344,13 @@ export function finaleClaimsMarkup(fc, { Y, ground, size, pal }) {
const parts = [];
if (it.kind === "count") {
if (it.band) parts.push(`<div class="fqband" style="left:${it.band.a}px; width:${r4(it.band.b - it.band.a)}px; top:${Y - 46}px; height:${66}px"></div>`);
- for (const [a, b] of it.veils) parts.push(`<div class="fqveil" style="left:${a}px; width:${r4(b - a)}px; top:${Y - 18}px; background:${ground}"></div>`);
+ for (const [a, b] of it.veils) parts.push(`<div class="fqveil" style="left:${a}px; width:${r4(b - a)}px; top:${Y - 4}px; background:${ground}"></div>`);
+ for (const d of it.dots) {
+ parts.push(`<div class="fqveil dot" style="left:${r4(d.x - d.size / 2)}px; top:${r4(Y - d.size / 2)}px; width:${d.size}px; height:${d.size}px; background:${ground}"></div>`);
+ }
for (const rg of it.rings) parts.push(`<div class="fqring" style="left:${r4(rg.x - rg.size / 2)}px; top:${r4(Y - rg.size / 2)}px; width:${rg.size}px; height:${rg.size}px"></div>`);
for (const sp of it.spans) {
- parts.push(`<div class="fqspan" style="left:${sp.a}px; width:${r4(sp.b - sp.a)}px; top:${Y - 7}px"></div>`);
+ for (const bar of sp.bars) parts.push(`<div class="fqspan" style="left:${bar.a}px; width:${r4(bar.b - bar.a)}px; top:${Y - 7}px"></div>`);
parts.push(`<div class="fqspl" style="left:${r4(sp.cx - 120)}px; top:${Y - 42}px">${esc(sp.label)}</div>`);
}
parts.push(labelHtml(it.label));
@@ -359,7 +369,8 @@ export function finaleClaimsMarkup(fc, { Y, ground, size, pal }) {
/* The claim checks' final state (deck.claims). */
.fq { position: absolute; left: 0; top: 0; width: 0; height: 0; }
.fqband { position: absolute; border-radius: 8px; background: rgba(229, 83, 75, 0.12); box-shadow: inset 0 0 0 1.5px rgba(229, 83, 75, 0.55); }
- .fqveil { position: absolute; height: 36px; opacity: 0.72; }
+ .fqveil { position: absolute; height: 8px; opacity: 0.72; }
+ .fqveil.dot { border-radius: 50%; }
.fqring { position: absolute; border-radius: 50%; box-shadow: 0 0 0 3px ${red}, 0 0 18px 5px rgba(229, 83, 75, 0.5); }
.fqspan { position: absolute; height: 14px; border-radius: 7px; background: ${red}; box-shadow: 0 0 16px 4px rgba(229, 83, 75, 0.5); }
.fqspl { position: absolute; width: 240px; text-align: center; white-space: nowrap; font-family: 'DeckSansBold', sans-serif;
diff --git a/umtool/report-to-video/chrome-finale.mjs b/umtool/report-to-video/chrome-finale.mjs
@@ -111,7 +111,7 @@ export function finaleLayout(schedule, render) {
const span = lay.pipTrack.x1 - lay.pipTrack.x0;
const toBig = (x) => r2(x0 + ((x - lay.pipTrack.x0) * (rail.x1 - x0)) / (span || 1));
const footMarks = deckMarkers(schedule, render, fxs, pipped, lay);
- const marks = railMarkerLayout(footMarks.map((mk) => ({ x: toBig(mk.x), label: mk.label, color: mk.color })), geo)
+ const marks = railMarkerLayout(footMarks.map((mk) => ({ x: toBig(mk.x), label: mk.label, color: mk.color })), geo, { layout: deck.markerLayout })
.map((mk, j) => ({ ...mk, foot: { x: r2(footMarks[j].x) } }));
// The totals: the tally's verdicts, each at its final count.
@@ -158,7 +158,7 @@ export function finaleLayout(schedule, render) {
const claims = fcl
? finaleClaims(fcl, {
toBig, Y: rail.y + shift, top: rail.top, markerRows: marks.length ? Math.max(...marks.map((mk) => mk.row)) + 1 : 0,
- bigX: (k) => r2(xs[k]), size: rail.markerSize, textWidth, ringSize: bigSize + 14,
+ bigX: (k) => r2(xs[k]), size: rail.markerSize, textWidth, ringSize: bigSize + 14, pips,
})
: null;
return {
@@ -422,7 +422,7 @@ export function finaleHtml(schedule, render, window, opts = {}) {
})
.join("");
- const rowTop = [Y - 72, Y - 112];
+ const rowTop = [Y - 72, Y - 112, Y - 152];
const markHtml = L.marks
.map((mk, j) => {
const top = rowTop[mk.row] ?? rowTop[0];
diff --git a/umtool/report-to-video/deck-claims.test.mjs b/umtool/report-to-video/deck-claims.test.mjs
@@ -18,6 +18,7 @@ import {
} from "./deck.mjs";
import { deckCues, deckHtml } from "./chrome-deck.mjs";
import { finaleHtml } from "./chrome-finale.mjs";
+import { finaleGeometry, railMarkerLayout } from "./finale.mjs";
import { normalizeClaim, resolveFactcheck, stampSchedule } from "./factcheck.mjs";
const PALETTE = { bg: "#101219", fg: "#f2f0ea", muted: "#979caa", accent: "#e5534b", amber: "#ffc860" };
@@ -264,6 +265,51 @@ test("the finale's large rail draws every claim's final state", () => {
assert.match(html, /“6–8 weeks”/);
});
+test("claimsLayout: the band and the spans go by membership -- an old clip inside the band is dimmed, the outro outside it", () => {
+ // An old clip (2019) moved between dozen and ten-k: inside the band's reach, outside his window.
+ const m = manifest();
+ const old = m.timeline.findIndex((e) => e.id === "tism");
+ const [tism] = m.timeline.splice(old, 1);
+ m.timeline.splice(m.timeline.findIndex((e) => e.id === "ten-k"), 0, tism);
+ const order = m.timeline.map((e) => e.id);
+ const md = CLIPS.map(([id, up]) => ({ id, up }));
+ const s = estimateSchedule(m, { metas: order.map((id) => ({ title: "T", uploadDate: md.find((x) => x.id === id).up, channel: "C", webpageUrl: null })) });
+ const render = renderWith({ claims: CLAIMS });
+ const lay = deckLayout(render, { schedule: s });
+ const pipped = pipSegments(s);
+ const xs = pipXs(pipped.length, lay.pipTrack.x0, lay.pipTrack.x1, "even");
+ const x = (id) => xs[pipped.findIndex((p) => p.id === id)];
+ const [week, year] = claimsLayout(s, render, xs, pipped, lay).items;
+ assert.ok(year.band.a < x("neuro") && year.band.b > x("blend") && year.band.b < x("heartstrings"), JSON.stringify(year.band));
+ // The 2019 clip inside the band is veiled; heartstrings (2021, the outro) is outside it, veiled too.
+ assert.ok(year.veils.some(([a, b]) => a < x("tism") && b > x("tism")), JSON.stringify(year.veils));
+ assert.ok(year.veils.some(([a, b]) => a < x("heartstrings") && b > x("heartstrings")), JSON.stringify(year.veils));
+ assert.ok(!year.veils.some(([a, b]) => a < x("dozen") && b > x("dozen")));
+ // "4 in a week": on-stream-b and blind-oct with screenshot between -- not one pip of another day: two bars.
+ const wk = week.spans.find((sp) => sp.label === "4 in a week");
+ assert.equal(wk.bars.length, 2);
+});
+
+test("the finale's marker labels stagger into three rows and never meet; markerLayout truncate keeps one row", () => {
+ const geo = finaleGeometry({ width: 1920, height: 1080, palette: PALETTE, chrome: { deck: { finale: {} } } });
+ const marks = [
+ { x: 1105, label: "Pill test: “3–5 weeks”", color: "#e5534b" },
+ { x: 1240, label: "Pill test: “6–8 weeks”", color: "#e5534b" },
+ { x: 1305, label: "No results after 8 wks", color: "#e5534b" },
+ ];
+ const laid = railMarkerLayout(marks, geo);
+ const span = (mk) => (mk.side === "right" ? [mk.x, mk.x + 18 + mk.max] : [mk.x - 18 - mk.max, mk.x]);
+ for (let i = 0; i < laid.length; i += 1) {
+ for (let j = i + 1; j < laid.length; j += 1) {
+ if (laid[i].row !== laid[j].row) continue;
+ const [a, b] = span(laid[i]), [c, d] = span(laid[j]);
+ assert.ok(b < c || d < a, `${laid[i].label} and ${laid[j].label} meet in row ${laid[i].row}`);
+ }
+ }
+ assert.equal(new Set(laid.map((mk) => mk.row)).size, 3);
+ assert.deepEqual(railMarkerLayout(marks, geo, { layout: "truncate" }).map((mk) => mk.row), [0, 0, 0]);
+});
+
// ---- no claims: the page it always was ------------------------------------------
test("absent claims: the schedule, the deck's page and the finale's are byte-identical to before claims existed", () => {
diff --git a/umtool/report-to-video/deck.mjs b/umtool/report-to-video/deck.mjs
@@ -1393,15 +1393,28 @@ export function claimsLayout(schedule, render, xs, pipped, lay = deckLayout(rend
let band = null;
let veils = [];
if (!it.per) {
- const r = rangeX(it.window.from, it.window.to);
- if (r && !r.off) {
- band = { a: r.a, b: r.b };
- if (r.a > x0 - 10) veils.push([x0 - 10, r.a]);
- if (r.b < end) veils.push([r.b, end + 4]);
- for (const p of P) {
- if (p.x > r.a && p.x < r.b && p.day !== null && (p.day < A || p.day > B)) veils.push([p.x - pad, p.x + pad]);
- }
- veils = veils.map(([a, b]) => [r2(a), r2(b)]).filter(([a, b]) => b - a > 1);
+ // By MEMBERSHIP, not position: the rail's dates are not monotonic (a
+ // flash-forward among older clips, an outro of old clips at the end).
+ // A pip is in his window when its clip's day is, or when it carries a
+ // stamp dated inside it; the band runs from the first such pip to the
+ // last, its edges eased to the date between it and its neighbour
+ // where the dates run forward there, and every pip outside the
+ // window -- inside the band too -- is dimmed.
+ const stamped = new Set(it.stamps.map((st) => st.segment));
+ const inWin = (p) => (p.day !== null && p.day >= A && p.day <= B) || stamped.has(p.id);
+ const members = P.filter(inWin);
+ if (members.length) {
+ const first = members[0], last = members[members.length - 1];
+ const prev = P[first.k - 1], next = P[last.k + 1];
+ const a = prev && prev.day !== null && first.day !== null && prev.day < A && first.day >= A
+ ? Math.min(lerp(prev, first, A), first.x - pad) : first.x - pad;
+ const b = next && next.day !== null && last.day !== null && next.day > B && last.day <= B
+ ? Math.max(lerp(last, next, B), last.x + pad) : last.x + pad;
+ band = { a: r2(a), b: r2(b) };
+ if (a > x0 - 10) veils.push([x0 - 10, a]);
+ if (b < end) veils.push([b, end + 4]);
+ for (const p of P) if (p.x > a && p.x < b && p.day !== null && !inWin(p)) veils.push([p.x - pad, p.x + pad]);
+ veils = veils.map(([va, vb]) => [r2(va), r2(vb)]).filter(([va, vb]) => vb - va > 1);
}
}
const byPip = new Map();
@@ -1413,11 +1426,21 @@ export function claimsLayout(schedule, render, xs, pipped, lay = deckLayout(rend
byPip.set(p.k, t);
});
const tags = [...byPip.values()].sort((a, b) => a.order - b.order).map((t) => ({ ...t, covered: covered.has(P[t.k].id) }));
+ // A span is its stamps' own pips (by membership): a bar over each run
+ // of them that stand side by side, its count over them all.
const spans = (it.spans ?? []).map((sp) => {
- const ks = sp.segments.map((id) => pipOf.get(id)).filter(Boolean);
+ const ks = sp.segments.map((id) => pipOf.get(id)).filter(Boolean).sort((p, q) => p.k - q.k);
if (!ks.length) return null;
- const a = Math.min(...ks.map((p) => p.x)) - 7, b = Math.max(...ks.map((p) => p.x)) + 7;
- return { a: r2(a), b: r2(b), cx: r2((a + b) / 2), label: sp.label, count: sp.count };
+ const bars = [];
+ for (const p of ks) {
+ const lastBar = bars[bars.length - 1];
+ if (lastBar && lastBar.k === p.k - 1) { lastBar.b = p.x + 7; lastBar.k = p.k; } else bars.push({ a: p.x - 7, b: p.x + 7, k: p.k });
+ }
+ const a = bars[0].a, b = bars[bars.length - 1].b;
+ return {
+ a: r2(a), b: r2(b), cx: r2((a + b) / 2), label: sp.label, count: sp.count,
+ bars: bars.map((bar) => ({ a: r2(bar.a), b: r2(bar.b) })),
+ };
}).filter(Boolean);
if (it.per) lit.set(it.segment, [...(lit.get(it.segment) ?? []), { at: it.at, segments: it.spans.flatMap((sp) => sp.segments) }]);
return { ...it, band, veils, tags, spans: it.per ? spans : undefined };
diff --git a/umtool/report-to-video/finale.mjs b/umtool/report-to-video/finale.mjs
@@ -426,36 +426,60 @@ export function railLabelLayout(pips, geo, { dates = true } = {}) {
/**
* The large rail's markers: each flag's x (mapped from its x on the footer's
- * track), its label's row (0 just over the track's band, 1 above it) and
- * side -- reading right from the flag, or left when it would run off the
- * frame. A label that clears neither row is cut to the room it has.
+ * track), its label's row (0 just over the track's band, 1 above it, 2 above
+ * that) and side -- reading right from the flag, or left when it would run
+ * off the frame. A label takes the first row where it clears every label
+ * already laid there, on its side or, failing that, the other; one that
+ * clears no row is laid in the row that leaves it the most room and cut to
+ * that room. `layout` is the deck's `markerLayout`: "stagger" (the default)
+ * lays them in up to three rows, "truncate" keeps one row and cuts them, as
+ * the footer does.
*
* `marks` are `{ x, label, color }` (frame px on the large track).
*
* @returns {Array<{ x: number, label: string, color: string, row: number, side: "right" | "left", max: number }>}
*/
-export function railMarkerLayout(marks, geo) {
+export function railMarkerLayout(marks, geo, { layout = "stagger" } = {}) {
const size = geo.rail.markerSize;
const W = geo.W, m = geo.margin;
- const rows = [[], []];
+ const rows = Array.from({ length: layout === "truncate" ? 1 : RAIL_MARKER_ROWS }, () => []);
+ const GAP = 12;
+ const spanOf = (x, side, w) => (side === "right" ? [x, x + 18 + w] : [x - 18 - w, x]);
+ const clears = (r, [a, b]) => r.every(([c, d]) => a > d + GAP || b < c - GAP);
return [...marks]
.map((mk, j) => ({ mk, j }))
.sort((a, b) => a.mk.x - b.mk.x)
.map(({ mk, j }) => {
const w = textWidth(String(mk.label).toUpperCase(), size) + Math.round(size * 0.04 * String(mk.label).length);
- const side = mk.x + 18 + w > W - m ? "left" : "right";
- const span = side === "right" ? [mk.x, mk.x + 18 + w] : [mk.x - 18 - w, mk.x];
- let row = rows.findIndex((r) => r.every(([a, b]) => span[0] > b + 12 || span[1] < a - 12));
- let max = w;
- if (row < 0) {
- // Neither row clears it: the row with the most room, the label cut to it.
- row = 1;
- const blockers = rows[1].map(([a, b]) => (side === "right" ? a - mk.x - 30 : mk.x - b - 30)).filter((v) => v > 0);
- max = Math.max(60, Math.min(w, ...blockers));
+ const fitsRight = mk.x + 18 + w <= W - m;
+ const fitsLeft = mk.x - 18 - w >= m / 2;
+ const sides = fitsRight ? ["right", ...(fitsLeft ? ["left"] : [])] : ["left"];
+ for (let row = 0; row < rows.length; row += 1) {
+ for (const side of sides) {
+ const span = spanOf(mk.x, side, w);
+ if (clears(rows[row], span)) {
+ rows[row].push(span);
+ return { j, x: mk.x, label: mk.label, color: mk.color, row, side, max: w };
+ }
+ }
}
- rows[row].push(side === "right" ? [mk.x, mk.x + 18 + max] : [mk.x - 18 - max, mk.x]);
- return { j, x: mk.x, label: mk.label, color: mk.color, row, side, max };
+ // No row clears it: the row (and side) that leaves it the most room, the label cut to it.
+ let best = { row: rows.length - 1, side: sides[0], room: -Infinity };
+ rows.forEach((r, row) => {
+ for (const side of sides) {
+ const room = side === "right"
+ ? Math.min(W - m - mk.x - 18, ...r.filter(([a, b]) => b > mk.x - GAP).map(([a]) => a - mk.x - 18 - GAP))
+ : Math.min(mk.x - 18 - m / 2, ...r.filter(([a, b]) => a < mk.x + GAP).map(([, b]) => mk.x - 18 - b - GAP));
+ if (room > best.room) best = { row, side, room };
+ }
+ });
+ const max = Math.max(60, Math.min(w, Math.floor(best.room)));
+ rows[best.row].push(spanOf(mk.x, best.side, max));
+ return { j, x: mk.x, label: mk.label, color: mk.color, row: best.row, side: best.side, max };
})
.sort((a, b) => a.j - b.j)
.map(({ j: _j, ...rest }) => rest);
}
+
+/** How many rows the large rail's marker labels may take when they stagger. */
+export const RAIL_MARKER_ROWS = 3;