Archilyzer · Source

archilyzer

Archilyzer
git clone https://archilyzer.pages.dev/source/archilyzer.git
Log | Files | Refs | README | LICENSE

commit 0a2d76732513ae372746acfa6ae2a4ddf2027c5c
parent d2f09bc5d15523691e76c997ae27d5495ba25add
Author: I Mean I'm Just Saying <imeanimjustsaying@kiwifarms.st>
Date:   Mon,  2 Nov 2026 11:53:12 -0500

umtool fx: a receipt can carry a label -- a line of at most 80 characters in a band under its screenshot (when it was taken, what it is), the card that much taller and its marker kept on the shot

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

Diffstat:
Mumtool/docs/knobs.md | 4++--
Mumtool/report-to-video/chrome-fx.mjs | 16+++++++++++-----
Mumtool/report-to-video/chrome-fx.test.mjs | 15+++++++++++++++
Mumtool/report-to-video/fx.mjs | 13+++++++++----
Mumtool/report-to-video/modules/fx.mjs | 2+-
5 files changed, 38 insertions(+), 12 deletions(-)

diff --git a/umtool/docs/knobs.md b/umtool/docs/knobs.md @@ -36,7 +36,7 @@ that generates it ([notes.md](notes.md)). | `layout` — `finale`: the deck's finale layout for this clip (`render.chrome.deck.finale`); `clip` is the default | — | `umtool set <p> <clip> layout=finale` | — | | `chat` — `on`: the clip's live chat (its video's `live_chat.cues.json`, for the clip's source span, timed through its gaps) in a column beside the footage; `off` or `chat=` (the default): none. A video with no chat draws nothing and the build log says so ([Live chat](#live-chat)) | — | `umtool set <p> <clip> chat=on` (`chat=` clears it) | — | | `fx.zoom` — `{shot, focus, at?, hold?}`: a screenshot (a file in the project; a bare name under its `shots/` is written as `shots/<name>`) that comes up over the footage and pushes in on `focus` (`[left, top, right, bottom]`, fractions of the shot) — drawn once `render.chrome.fx.zoom` is on ([Effects](#effects)). **How long it stays**: up 0.2 s into the clip's clean span (rising in over 0.38 s), its focus box drawn 0.55 s later, the push at `at` (seconds into the clip; default as soon as the box has drawn) over 1 s, then a slow drift on the detail; it leaves with a 0.3 s fade 0.3 s before the clip's clean span ends — or, with `hold` (0.5–10 s), that long after the push lands (never past the clip's own leave) | — | `umtool set <p> <clip> fx.zoom='{"shot":"shots/x.png","focus":[0.1,0.2,0.9,0.4],"at":5.9,"hold":4}'` (`fx.zoom=` clears it) | `PUT /api/report/window {project, clip, "fx.zoom": {…} \| null}` | -| `fx.receipts`, `fx.punch`, `fx.quote`, `fx.punchIn`, `fx.speakers` — the clip's other effect fields (`[{shot, mark?, at?, hold?}]` 1–4, `at` the source second a receipt flies in at (default: as the clip comes up), `hold` 0.5–10 s it stays once landed (on every one: they leave then, not with the clip); the words to punch; `false`: no line; 1–8 source seconds inside the clip; `[{at, who: 0\|1}]`), each inert until its effect is on; `fx` is all of them at once. Checked by the build's own `validateFxEntries` | — | `fx.punch="the words"` `fx.punchIn='[231.4]'` · `fx='{…}'` sets them all, `fx=` clears every one | `PUT /api/report/window {project, clip, fx}` (or one `"fx.<field>"`) | +| `fx.receipts`, `fx.punch`, `fx.quote`, `fx.punchIn`, `fx.speakers` — the clip's other effect fields (`[{shot, mark?, at?, hold?, label?}]` 1–4, `at` the source second a receipt flies in at (default: as the clip comes up), `hold` 0.5–10 s it stays once landed (on every one: they leave then, not with the clip), `label` a line of at most 80 characters in a band under the screenshot (when it was taken, what it is); the words to punch; `false`: no line; 1–8 source seconds inside the clip; `[{at, who: 0\|1}]`), each inert until its effect is on; `fx` is all of them at once. Checked by the build's own `validateFxEntries` | — | `fx.punch="the words"` `fx.punchIn='[231.4]'` · `fx='{…}'` sets them all, `fx=` clears every one | `PUT /api/report/window {project, clip, fx}` (or one `"fx.<field>"`) | | `gaps` — `[{from, to}]`, SOURCE seconds cut out of the clip's middle: it renders as ONE segment of jump cuts (one pip, one card), not two clips with a crossfade ([below](#gaps-inside-a-clip)) | clip bench (Edit this clip), the waveform: **Select a gap** (`g`) or Alt + drag a span, **Cut gap** (`g`), **Hear it**; a click on a gap's band puts it back (`G`: the one at the playhead); **Undo** | `umtool window <p> <clip> --gap 12.3-15.1` (repeatable) · `--gap-remove 12.3` · `--gaps '12.3-15.1,20-20.6'` (`--gaps ''` clears) · `umtool set <p> <clip> gap.add=12.3-15.1 gap.remove=12.3 gaps=` | `PUT /api/report/window {project, clip, token, gapAdd \| gapRemove \| gaps}` | `key=` (nothing after the `=`) clears a knob; in umtool, **Clear** beside a field (Audio: **Clear all**). A @@ -1064,7 +1064,7 @@ Overlays on the picture -- receipts, a zoom, the scrubber, a kinetic quote, punc |---|---|---| | `render.chrome.fx.<effect>` | scrubber · receipts · zoom · kineticQuote · redact · odometer · punchIn · thenNow · whip · glitch | a take: `umtool take <p> --effect <name>` | | `render.chrome.fx.glitch.on`, `.clips` | `year` (a tear at each cut between years) · `every` (each cut between clips) · `clips` (only the cut INTO each clip `clips` names: 1–60 ids, each with a clip right before it) · default `year`; `clips` only with `on: "clips"`. `.seconds` 0.2–1.5 · 0.5, `.stamp` (the `PLAY ▶` date) · `true`, `.year` (the new year big over the tear; `false` with `stamp: false` is a bare tear, no text) · `true` | manifest | -| a clip's `fx` — what an effect draws on it, inert until that effect is on: `zoom` `{shot, focus, at?, hold?}`, `receipts` `[{shot, mark?, at?, hold?}]` (1–4; `at` a source second inside the clip, gap-aware, `hold` 0.5–10 s once landed), `punch` (the words), `quote` (false: no line), `punchIn` `[source s…]` (1–8, inside the clip), `speakers` `[{at, who: 0|1}]`. A `shot` is a file in the project (a bare name under its `shots/` is written as `shots/<name>`); `focus`/`mark` are `[left, top, right, bottom]` fractions of it | `fx.<field>=<json>` sets one and keeps the rest · `fx=<json>` all · `fx=` none; checked by the build's own `validateFxEntries` | `umtool set <p> <clip> fx.zoom='{"shot":"shots/x.png","focus":[0.1,0.2,0.9,0.4],"at":5.9}'` · `PUT /api/report/window {project, clip, fx}` (or `"fx.zoom"`, …) | +| a clip's `fx` — what an effect draws on it, inert until that effect is on: `zoom` `{shot, focus, at?, hold?}`, `receipts` `[{shot, mark?, at?, hold?, label?}]` (1–4; `at` a source second inside the clip, gap-aware, `hold` 0.5–10 s once landed, `label` ≤ 80 characters in a band under the shot), `punch` (the words), `quote` (false: no line), `punchIn` `[source s…]` (1–8, inside the clip), `speakers` `[{at, who: 0|1}]`. A `shot` is a file in the project (a bare name under its `shots/` is written as `shots/<name>`); `focus`/`mark` are `[left, top, right, bottom]` fractions of it | `fx.<field>=<json>` sets one and keeps the rest · `fx=<json>` all · `fx=` none; checked by the build's own `validateFxEntries` | `umtool set <p> <clip> fx.zoom='{"shot":"shots/x.png","focus":[0.1,0.2,0.9,0.4],"at":5.9}'` · `PUT /api/report/window {project, clip, fx}` (or `"fx.zoom"`, …) | | beside popup posts that move the footage (`deck.posts.shift`) | the effects are drawn over the footage box where it stays, so an effect on screen WHILE the posts hold the footage aside is refused, naming both and their seconds — a zoom, receipts, a quote or a punch-in on its own clip's span; a whip, glitch or THEN/NOW wipe around its cut; the scrubber and the odometer over every clip (so beside any shift). A persisting bar holds it aside from its first post to its glide back. Apart in time, both are drawn. `umtool check` reads the estimated schedule; the build checks again on the measured one before any chrome is drawn | `deck.posts.shift=false`, the feed, or move one of them | | the zoom's timing (`fx.zoom.at`, `.hold`) | up 0.2 s into the clip's clean span (the card rises in over 0.38 s, `back.out`); its focus box draws 0.55 s later (0.45 s); it pushes in on the box at `at` — seconds into the clip, default as soon as the box has drawn — over 1 s (`power2.inOut`), then drifts slowly on the detail. It leaves with a 0.3 s fade 0.3 s before the clip's clean span ends, or with `hold` (0.5–10 s) that long after the push lands (never past the clip's own leave) | `fx.zoom='{…,"hold":4}'` | diff --git a/umtool/report-to-video/chrome-fx.mjs b/umtool/report-to-video/chrome-fx.mjs @@ -169,12 +169,14 @@ export function fxPlan(schedule, render, assets = {}) { const cardsHtml = row.cards.map((c, j) => { const key = `rc${r}_${j}`; const dims = shots[c.shot] ?? null; - const { w, h } = cardSize(dims, baseW, H * 0.74); + // A label is a band under the screenshot, the card that much taller. + const band = c.label ? px(40) : 0; + const { w, h } = cardSize(dims, baseW, H * 0.74 - band); const rot = FX_FAN[j % FX_FAN.length]; const restX = (right ? -1 : 1) * j * px(22); const restY = j * px(26) - ((n - 1) * px(26)) / 2; const left = right ? W - px(48) - w : px(48); - const top = Math.round((H - h) / 2); + const top = Math.round((H - h - band) / 2); const off = (right ? 1 : -1) * (w + px(140) + (right ? W - left - w : left)); init[key] = { x: r2(restX + off), y: r2(restY + px(40)), rotation: rot + (right ? 14 : -14), autoAlpha: 1 }; add(key, c.at, FX_MOTION.fan, { x: r2(restX), y: r2(restY), rotation: rot }, "power3.out"); @@ -185,11 +187,12 @@ export function fxPlan(schedule, render, assets = {}) { const [a, b, cc, d] = c.mark; init[mk] = { scaleX: 0 }; add(mk, row.markAt + j * 0.12, FX_MOTION.marker, { scaleX: 1 }, "power2.inOut"); - marker = `<div class="rc-mark" data-k="${mk}" style="left:${r2(a * 100)}%; top:${r2(b * 100)}%; width:${r2((cc - a) * 100)}%; height:${r2((d - b) * 100)}%"></div>`; + marker = `<div class="rc-mark" data-k="${mk}" style="left:${r2(a * 100)}%; ${band ? `top:${r2(b * h)}px; height:${r2((d - b) * h)}px` : `top:${r2(b * 100)}%; height:${r2((d - b) * 100)}%`}; width:${r2((cc - a) * 100)}%"></div>`; } const src = dims?.src ?? ""; - return `<div class="rc-card" data-k="${key}" style="left:${left}px; top:${top}px; width:${w}px; height:${h}px">` + - (src ? `<img src="${esc(src)}" width="${w}" height="${h}" alt="">` : "") + marker + `</div>`; + return `<div class="rc-card" data-k="${key}" style="left:${left}px; top:${top}px; width:${w}px; height:${h + band}px">` + + (src ? `<img src="${esc(src)}" width="${w}" height="${h}" alt="">` : "") + marker + + (c.label ? `<div class="rc-label" style="height:${band}px; line-height:${band}px">${esc(c.label)}</div>` : "") + `</div>`; }).join(""); html.push(`<div class="fx-receipts" data-segment="${esc(row.segment)}">${cardsHtml}</div>`); }); @@ -578,6 +581,9 @@ export function fxHtml(schedule, render, opts = {}) { .rc-card { position: absolute; border-radius: ${px(10)}px; overflow: hidden; background: #fff; box-shadow: 0 0 0 ${px(3)}px ${rgba("#ffffff", 0.95)}, 0 ${px(18)}px ${px(40)}px rgba(0, 0, 0, 0.55); } .rc-card img { display: block; } + .rc-label { padding: 0 ${px(14)}px; background: ${pal.bg}; color: ${pal.fg}; font-family: 'DeckSansBold', sans-serif; + font-size: ${px(19)}px; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; + font-variant-numeric: tabular-nums; } .rc-mark { position: absolute; transform-origin: 0 50%; border-radius: ${px(4)}px; background: ${amber}; mix-blend-mode: multiply; opacity: 0.9; } diff --git a/umtool/report-to-video/chrome-fx.test.mjs b/umtool/report-to-video/chrome-fx.test.mjs @@ -16,6 +16,7 @@ import { fileURLToPath } from "node:url"; import { cardSize, fxHtml, fxPlan, odoCells, railX, zoomPush } from "./chrome-fx.mjs"; import { deckSchedule, fxGeometry } from "./deck.mjs"; +import { validateFxEntries } from "./fx.mjs"; import { frameKeys } from "./frame-keys.mjs"; const HERE = path.dirname(fileURLToPath(import.meta.url)); @@ -287,6 +288,20 @@ test("pixels: a redaction bar is black until its word is said, then the paper sh } }); +test("a receipt's label: a band under its screenshot, escaped, the card that much taller, the marker still on the shot", () => { + const timeline = TIMELINE.map((e) => e.id !== "c2" ? e : { ...e, fx: { receipts: [{ shot: "shots/b.png", mark: [0.04, 0.3, 0.9, 0.5], label: "X profile, captured 30 Oct <2026>" }] } }); + const s = deckSchedule({ entries: timeline, durs: [6.4, 6.4, 6.4, 6.4], D: 0.5, render: render({ receipts: {} }), fxWords: WORDS }); + assert.equal(s.fx.receipts.clips[0].cards[0].label, "X profile, captured 30 Oct <2026>"); + assert.equal(schedule({ receipts: {} }).fx.receipts.clips[0].cards[0].label, undefined, "no label, no key"); + const html = fxHtml(s, render({ receipts: {} }), { fonts: FONTS, assets: { shots: SHOTS } }); + const band = /<div class="rc-label" style="height:(\d+)px[^"]*">X profile, captured 30 Oct &lt;2026&gt;<\/div>/.exec(html); + assert.ok(band, "the label, escaped"); + const card = /<div class="rc-card"[^>]*height:(\d+)px"><img src="assets\/fxshot01.png" width="\d+" height="(\d+)"/.exec(html); + assert.equal(Number(card[1]), Number(card[2]) + Number(band[1]), "the card is the shot plus the band"); + assert.match(html, /class="rc-mark"[^>]*top:[\d.]+px; height:[\d.]+px/, "the marker in the shot's pixels, not the card's"); + assert.match(validateFxEntries({ render: render({}), timeline: [clip("c9", "2020-01-01", { fx: { receipts: [{ shot: "shots/a.png", label: "x".repeat(81) }] } })] }).join(), /label must be a line of at most 80 characters/); +}); + test("pixels: the receipts fly in to the right side and the marker paints the cited line amber", { skip: !haveChromium }, async () => { const { dir, sched, still } = await project({ receipts: {} }); try { diff --git a/umtool/report-to-video/fx.mjs b/umtool/report-to-video/fx.mjs @@ -18,7 +18,7 @@ // } // timeline entry: "fx": { "punch": "…", "quote": false, "punchIn": [<source s>, …], // "speakers": [{ "at": <source s>, "who": 0 | 1 }], -// "receipts": [{ "shot": "shots/a.png", "mark": [x0, y0, x1, y1], "at"?: <source s>, "hold"?: s }], +// "receipts": [{ "shot": "shots/a.png", "mark": [x0, y0, x1, y1], "at"?: <source s>, "hold"?: s, "label"?: "captured 30 Oct" }], // "zoom": { "shot": "shots/b.png", "focus": [x0, y0, x1, y1], "at": 1.2, "hold": 4 } } // (a zoom is up from 0.2 s into its clip's clean span -- the card rising in // over 0.38 s, its focus box drawing at +0.55 s -- pushes in at `at` (seconds @@ -55,6 +55,8 @@ export const FX_DATES = Object.freeze(["date", "year"]); export const FX_ODOMETER_AT = Object.freeze(["phrase", "start"]); export const FX_SHOT_EXTS = Object.freeze([".png", ".jpg", ".jpeg", ".webp"]); export const FX_RECEIPTS_MAX = 4; +/** The longest caption a receipt carries under its screenshot (when it was taken, what it is). */ +export const FX_RECEIPT_LABEL_MAX = 80; export const FX_ANCHORS = Object.freeze(["upper", "center"]); export const FX_WHIP_ON = Object.freeze(["every", "year"]); /** A kinetic line's two voices when the manifest names none: the palette's fg, then THEN's blue. */ @@ -325,8 +327,11 @@ export function validateFxEntries(manifest, { schedule = undefined } = {}) { errors.push(`${w}.receipts must be a list of 1 to ${FX_RECEIPTS_MAX} screenshots`); } else { r.forEach((c, i) => { - if (!isObj(c)) { errors.push(`${w}.receipts[${i}] must be { shot, mark?, at?, hold? }`); return; } - for (const k of Object.keys(c)) if (!["shot", "mark", "at", "hold"].includes(k)) errors.push(`${w}.receipts[${i}].${k} is not a receipt field`); + if (!isObj(c)) { errors.push(`${w}.receipts[${i}] must be { shot, mark?, at?, hold?, label? }`); return; } + for (const k of Object.keys(c)) if (!["shot", "mark", "at", "hold", "label"].includes(k)) errors.push(`${w}.receipts[${i}].${k} is not a receipt field`); + if (c.label !== undefined && !(typeof c.label === "string" && c.label.trim() && c.label.length <= FX_RECEIPT_LABEL_MAX)) { + errors.push(`${w}.receipts[${i}].label must be a line of at most ${FX_RECEIPT_LABEL_MAX} characters`); + } if (c.at !== undefined) { if (!(typeof c.at === "number" && Number.isFinite(c.at))) errors.push(`${w}.receipts[${i}].at must be a source second`); else if (e.type === "clip" && Number.isFinite(e.start) && Number.isFinite(e.end) && (c.at < e.start || c.at > e.end)) { @@ -897,7 +902,7 @@ export function fxSchedule({ segments, entries, metas = [], render, D, total, wo // long after the last lands, not as the clip goes. const f0 = sourceFrom(c.entry), g = gapsOf(c.entry); const cards = list.map((x, j) => ({ - shot: x.shot, mark: x.mark ?? null, + shot: x.shot, mark: x.mark ?? null, ...(typeof x.label === "string" && x.label.trim() ? { label: x.label.trim() } : {}), at: r3(Number.isFinite(x.at) ? Math.min(outT - 1, Math.max(inn, c.start + offsetIn(x.at, f0, g))) : inn + j * FX_MOTION.fanGap), })); const timed = list.some((x) => Number.isFinite(x.at)); diff --git a/umtool/report-to-video/modules/fx.mjs b/umtool/report-to-video/modules/fx.mjs @@ -22,7 +22,7 @@ export default defineModule({ rows: [ ["`render.chrome.fx.<effect>`", "scrubber · receipts · zoom · kineticQuote · redact · odometer · punchIn · thenNow · whip · glitch", "a take: `umtool take <p> --effect <name>`"], ["`render.chrome.fx.glitch.on`, `.clips`", "`year` (a tear at each cut between years) · `every` (each cut between clips) · `clips` (only the cut INTO each clip `clips` names: 1–60 ids, each with a clip right before it) · default `year`; `clips` only with `on: \"clips\"`. `.seconds` 0.2–1.5 · 0.5, `.stamp` (the `PLAY ▶` date) · `true`, `.year` (the new year big over the tear; `false` with `stamp: false` is a bare tear, no text) · `true`", "manifest"], - ["a clip's `fx` — what an effect draws on it, inert until that effect is on: `zoom` `{shot, focus, at?, hold?}`, `receipts` `[{shot, mark?, at?, hold?}]` (1–4; `at` a source second inside the clip, gap-aware, `hold` 0.5–10 s once landed), `punch` (the words), `quote` (false: no line), `punchIn` `[source s…]` (1–8, inside the clip), `speakers` `[{at, who: 0|1}]`. A `shot` is a file in the project (a bare name under its `shots/` is written as `shots/<name>`); `focus`/`mark` are `[left, top, right, bottom]` fractions of it", "`fx.<field>=<json>` sets one and keeps the rest · `fx=<json>` all · `fx=` none; checked by the build's own `validateFxEntries`", "`umtool set <p> <clip> fx.zoom='{\"shot\":\"shots/x.png\",\"focus\":[0.1,0.2,0.9,0.4],\"at\":5.9}'` · `PUT /api/report/window {project, clip, fx}` (or `\"fx.zoom\"`, …)"], + ["a clip's `fx` — what an effect draws on it, inert until that effect is on: `zoom` `{shot, focus, at?, hold?}`, `receipts` `[{shot, mark?, at?, hold?, label?}]` (1–4; `at` a source second inside the clip, gap-aware, `hold` 0.5–10 s once landed, `label` ≤ 80 characters in a band under the shot), `punch` (the words), `quote` (false: no line), `punchIn` `[source s…]` (1–8, inside the clip), `speakers` `[{at, who: 0|1}]`. A `shot` is a file in the project (a bare name under its `shots/` is written as `shots/<name>`); `focus`/`mark` are `[left, top, right, bottom]` fractions of it", "`fx.<field>=<json>` sets one and keeps the rest · `fx=<json>` all · `fx=` none; checked by the build's own `validateFxEntries`", "`umtool set <p> <clip> fx.zoom='{\"shot\":\"shots/x.png\",\"focus\":[0.1,0.2,0.9,0.4],\"at\":5.9}'` · `PUT /api/report/window {project, clip, fx}` (or `\"fx.zoom\"`, …)"], ["beside popup posts that move the footage (`deck.posts.shift`)", "the effects are drawn over the footage box where it stays, so an effect on screen WHILE the posts hold the footage aside is refused, naming both and their seconds — a zoom, receipts, a quote or a punch-in on its own clip's span; a whip, glitch or THEN/NOW wipe around its cut; the scrubber and the odometer over every clip (so beside any shift). A persisting bar holds it aside from its first post to its glide back. Apart in time, both are drawn. `umtool check` reads the estimated schedule; the build checks again on the measured one before any chrome is drawn", "`deck.posts.shift=false`, the feed, or move one of them"], ["the zoom's timing (`fx.zoom.at`, `.hold`)", "up 0.2 s into the clip's clean span (the card rises in over 0.38 s, `back.out`); its focus box draws 0.55 s later (0.45 s); it pushes in on the box at `at` — seconds into the clip, default as soon as the box has drawn — over 1 s (`power2.inOut`), then drifts slowly on the detail. It leaves with a 0.3 s fade 0.3 s before the clip's clean span ends, or with `hold` (0.5–10 s) that long after the push lands (never past the clip's own leave)", "`fx.zoom='{…,\"hold\":4}'`"], ],