Archilyzer · Source

archilyzer

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

commit 6b9c06c191898ca8bd239a28815fd8f8dc236b12
parent 6c92066953222ff946a9d26489ace951256264b9
Author: I Mean I'm Just Saying <imeanimjustsaying@kiwifarms.st>
Date:   Fri,  6 Nov 2026 04:22:34 -0500

Merge lane/rev9-fixes: a lower chapter band never covers a post item's card (it stands in the card's free margin, or no bumper); an entry hides chosen modules over its span (hideModules, umtool set … --take) (operator, 5 Nov: "Make variants for me to judge")

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

Diffstat:
Mumtool/bin/umtool.mjs | 2++
Mumtool/docs/knobs.md | 8+++++++-
Mumtool/lib/report/knobsCli.mjs | 28++++++++++++++++++++++++----
Mumtool/lib/report/knobsCli.test.mjs | 28++++++++++++++++++++++++++++
Mumtool/lib/report/manifest.mjs | 22+++++++++++++++++++++-
Mumtool/report-to-video/chrome-story.mjs | 70+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-------
Mumtool/report-to-video/deck.mjs | 51+++++++++++++++++++++++++++++++++++++++++++++++++++
Mumtool/report-to-video/measure-extras.mjs | 26+++++++++++++++++++++++++-
Mumtool/report-to-video/measure-extras.test.mjs | 28+++++++++++++++++++++++++++-
Mumtool/report-to-video/modules/chapter.mjs | 4++--
Mumtool/report-to-video/modules/measure-extras-module.mjs | 1+
Mumtool/report-to-video/modules/story.test.mjs | 39++++++++++++++++++++++++++++++++++++++-
12 files changed, 289 insertions(+), 18 deletions(-)

diff --git a/umtool/bin/umtool.mjs b/umtool/bin/umtool.mjs @@ -909,6 +909,8 @@ function usage() { " claim.count claim.label (the first mark's, or --mark <id>'s) · marks: mark.add=<verdict>[@<sec>]", " mark.remove=<id> mark.verdict=<verdict> marks=<json> (≤ 8, each its own stamp and count)", " · audio.offset (ms, + later) audio.gain (dB) audio.fadeIn audio.fadeOut", + " · hideModules=diet,streak (those modules hidden over the entry's span; any entry)", + " --take <t>: the entry knobs into the take's patch, the project's manifest untouched", " umtool look <project> key=value … the cut's knobs: factcheck.stamp.scale|motion|opacity|seconds,", " factcheck.verdicts.<V>.stampLabel|label|color, deck.markers=<json>, deck.markerLayout,", " variants=<json>, and the look's keys (transition=0.3, …)", diff --git a/umtool/docs/knobs.md b/umtool/docs/knobs.md @@ -35,6 +35,7 @@ that generates it ([notes.md](notes.md)). | `blur.from`, `blur.to` — source seconds inside the clip's window: blur only that span (either alone runs to the clip's edge; default the whole clip) | Blur, **From playhead** / **To playhead**, **Whole clip** | `blur.from=231.5 blur.to=262` | same | | `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) | — | +| `hideModules` — `["diet","streak",…]`: the measure extras (`goals` `peak` `promise` `diet` `streak`) hidden over THIS entry's span, each with its own fade, whatever it would otherwise do there -- for text in the footage no dodge can know of (a DM screenshot's refund email under the diet badge). Any entry, a post item too; an id no entry can hide is refused | — | `umtool set <p> <entry> hideModules=diet,streak` (`hideModules=` clears it; `--take <t>` writes the take's patch, the project's manifest untouched) | — | | `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?, 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}` | @@ -1751,6 +1752,7 @@ A chain per run along a time axis by in-record date (`render.chrome.deck.streak` | `deck.streak.hold`, `.finale` | 0 (up from the first run on) or 2–600 s · `hide` `show` · default 0, `hide` | `umtool look <p> deck.streak.hold=15` | | `deck.streak.title`, `.color`, `.colors`, `.labels` | ≤40 · #hex · `{<regime>: #hex}` · `{<regime>: words}` · default the source's word, the accent, the regimes' inks and names | `umtool look <p> deck.streak.title='Every diet'` | | `deck.streak.onPosts`, `.onChapters` | `dodge` `hide` `show` · default `dodge`: while a post item's card (its card, slot and strip as postLayout lays them: the schedule's `covers`) or a chapter band is up where it stands, it moves to a free anchor of the footage box -- a size down to half if it must, never onto another measure extra that is up -- and hides when none fits; `hide` hides, `show` stays over it | `umtool look <p> deck.streak.onPosts=hide` | +| a timeline entry's `hideModules` | `["streak", …]` on an entry hides it over that entry's span, with its own fade, whatever it would otherwise do there (text in the footage no dodge can know of) · any entry, a post item too | `umtool set <p> <entry> hideModules=streak` (`--take <t>` for a take) | ### Diet badge @@ -1763,6 +1765,7 @@ The diet he names as a rubber stamp in a corner of the footage box (`render.chro | `deck.diet.hold`, `.finale` | 0 (up from the first diet on) or 2–600 s · `hide` `show` · default 0, `hide` | `umtool look <p> deck.diet.hold=15` | | `deck.diet.colors`, `.labels` | `{<regime>: #hex}` · `{<regime>: words ≤40}` · default the regimes' inks and names | `umtool look <p> deck.diet.labels='{"glp1":"Ozempic"}'` | | `deck.diet.onPosts`, `.onChapters` | `dodge` `hide` `show` · default `dodge`: while a post item's card (its card, slot and strip as postLayout lays them: the schedule's `covers`) or a chapter band is up where it stands, it moves to a free anchor of the footage box -- a size down to half if it must, never onto another measure extra that is up -- and hides when none fits; `hide` hides, `show` stays over it | `umtool look <p> deck.diet.onPosts=hide` | +| a timeline entry's `hideModules` | `["diet", …]` on an entry hides it over that entry's span, with its own fade, whatever it would otherwise do there (text in the footage no dodge can know of) · any entry, a post item too | `umtool set <p> <entry> hideModules=diet` (`--take <t>` for a take) | ### Moving start @@ -1775,6 +1778,7 @@ The weight he says he started at, as he retells it (`render.chrome.deck.peak`, m | `deck.peak.hold`, `.finale` | 0 (stays up) or 2–600 s · `hide` `show` · default 12, `hide` | `umtool look <p> deck.peak.hold=0` | | `deck.peak.title`, `.values`, `.color` | ≤40 · `drift` `all` · #hex · default "The start keeps moving", `drift`, #FF5A4E | `umtool look <p> deck.peak.values=all` | | `deck.peak.onPosts`, `.onChapters` | `dodge` `hide` `show` · default `dodge`: while a post item's card (its card, slot and strip as postLayout lays them: the schedule's `covers`) or a chapter band is up where it stands, it moves to a free anchor of the footage box -- a size down to half if it must, never onto another measure extra that is up -- and hides when none fits; `hide` hides, `show` stays over it | `umtool look <p> deck.peak.onPosts=hide` | +| a timeline entry's `hideModules` | `["peak", …]` on an entry hides it over that entry's span, with its own fade, whatever it would otherwise do there (text in the footage no dodge can know of) · any entry, a post item too | `umtool set <p> <entry> hideModules=peak` (`--take <t>` for a take) | ### Goal stack @@ -1787,6 +1791,7 @@ A sticky note per goal on a pile in a corner of the footage box, read off the sc | `deck.goals.max`, `.color`, `.countdown` | 1–8 notes · #hex paper · bool · default 4, the palette's amber, `true` | `umtool look <p> deck.goals.max=6` | | `deck.goals.hold`, `.finale` | 0 (up from the first goal on) or 2–600 s after each · `hide` `show` · default 20, `hide` | `umtool look <p> deck.goals.hold=0` | | `deck.goals.onPosts`, `.onChapters` | `dodge` `hide` `show` · default `dodge`: while a post item's card (its card, slot and strip as postLayout lays them: the schedule's `covers`) or a chapter band is up where it stands, it moves to a free anchor of the footage box -- a size down to half if it must, never onto another measure extra that is up -- and hides when none fits; `hide` hides, `show` stays over it | `umtool look <p> deck.goals.onPosts=hide` | +| a timeline entry's `hideModules` | `["goals", …]` on an entry hides it over that entry's span, with its own fade, whatever it would otherwise do there (text in the footage no dodge can know of) · any entry, a post item too | `umtool set <p> <entry> hideModules=goals` (`--take <t>` for a take) | ### Thread rail @@ -1850,7 +1855,7 @@ A section bumper -- per dog, per crisis, per lawsuit -- over the first `seconds` | Knob | Range · default | From a terminal | |---|---|---| | `chrome.chapter.list[]` | 1–40 `{at, title ≤48, subtitle? ≤90, date?}` -- `at` the clip it opens, once each | `umtool modules apply <p> --config module-config.json` · `umtool look <p> chapter='{…}'` | -| `chrome.chapter.style` | `card` (the footage box covered) · `lower` (a band at its foot) · default `card` | `umtool look <p> chapter.style=lower` | +| `chrome.chapter.style` | `card` (the footage box covered) · `lower` (a band at its foot -- except over a POST item, whose card it never covers: it stands in the card's wider free side margin, its words fitted to it; a card with no margin 180 px wide gets no bumper, the rail's section label still marks it) · default `card` | `umtool look <p> chapter.style=lower` | | `chrome.chapter.seconds` | 1–8 s, never past the clip · default 3 | `umtool look <p> chapter.seconds=2.5` | ### Finale @@ -1882,5 +1887,6 @@ A days-since counter for a promise (`render.chrome.deck.promise`, measure-extras | `deck.promise.label`, `.verb`, `.kept`, `.broken`, `.checks` | ≤40 each · `label` `quote` · default the row's display, "offered", "Posted", "None posted", `label` | `umtool look <p> deck.promise.label='scale video'` | | `deck.promise.speakers`, `.claimVerb`, `.claimColor` | `{<speaker>: {handle, color}}` · ≤40 · #hex · default `{}` (the postAvatars handle), "paid", #E37AB8 | `umtool look <p> deck.promise.speakers='{"madamsavvy":{"handle":"MadamSavvy"}}'` | | `deck.promise.onPosts`, `.onChapters` | `dodge` `hide` `show` · default `dodge`: while a post item's card (its card, slot and strip as postLayout lays them: the schedule's `covers`) or a chapter band is up where it stands, it moves to a free anchor of the footage box -- a size down to half if it must, never onto another measure extra that is up -- and hides when none fits; `hide` hides, `show` stays over it | `umtool look <p> deck.promise.onPosts=hide` | +| a timeline entry's `hideModules` | `["promise", …]` on an entry hides it over that entry's span, with its own fade, whatever it would otherwise do there (text in the footage no dodge can know of) · any entry, a post item too | `umtool set <p> <entry> hideModules=promise` (`--take <t>` for a take) | <!-- modules:end --> diff --git a/umtool/lib/report/knobsCli.mjs b/umtool/lib/report/knobsCli.mjs @@ -59,13 +59,13 @@ export const VERTICAL_SET_KEYS = Object.freeze(["vertical", "vertical.crop", "ve export const SIDE_SET_KEYS = Object.freeze(["side", "side.item", "side.post", "side.from", "side.to", "side.place"]); const SET_KEYS = [ ...CLAIM_KNOBS.map((k) => `claim.${k}`), ...MARK_KEYS, ...AUDIO_KNOBS.map((k) => `audio.${k}`), ...BLUR_KNOBS.map((k) => `blur.${k}`), "layout", ...REVIEW_KEYS, - ...FX_KEYS, ...GAP_KEYS, "chat", + ...FX_KEYS, ...GAP_KEYS, "chat", "hideModules", // The vertical format (lane vertical): the clip's 9:16 crop and layout, and its side post. ...VERTICAL_SET_KEYS, ...SIDE_SET_KEYS, ]; export const SET_USAGE = [ - "usage: umtool set <project> <clip> key=value … [--mark <id>] [--json]", + "usage: umtool set <project> <clip> key=value … [--mark <id>] [--take <t>] [--json]", ` keys: ${SET_KEYS.join(" ")}`, " claim.at is a SOURCE second inside the clip's window: the stamp lands and the count steps there", " (read from the last clip carrying the claim); claim.hold s (0.5–10); claim.stamp true|false;", @@ -97,6 +97,10 @@ export const SET_USAGE = [ " chat=on shows the clip's live chat (its video's live_chat.cues.json, for the clip's source span) in a column", " beside the footage; chat=off, or `chat=` (the default), does not. A video with no chat draws nothing and the", " build log says so. The column's look: umtool look <p> chat.position=left (docs/knobs.md \"Live chat\").", + " hideModules=diet,streak hides those modules over this entry's span, each with its own fade (text in the", + " footage no dodge can know of; any entry, a post item too): goals peak promise diet streak; `hideModules=` none.", + " --take <t>: the entry knobs (not claim.* or marks) land in takes/<t>/take.json's patch, an undo point first", + " (`umtool timeline <p> --take <t> undo`); the project's manifest is untouched.", " vertical.crop='[x,y,w,h]' (fractions of the source: the 9:16 box a vertical render cuts; vertical.aspect the", " source's w/h when not 16:9); vertical.layout=full|framed|quote (this clip's layout in a vertical cut).", " side.item=<post item id> | side.post='{\"author\",\"handle\",\"date\",\"text\",…}' -- a post shown BESIDE the", @@ -228,6 +232,11 @@ export async function setCommand(args, { root = REPORTS_ROOT, out = (s) => conso entryPatch[key] = key === "side.item" && value !== null ? String(value) : value; continue; } + if (key === "hideModules") { + // The modules hidden over this entry's span (deck.mjs parseHideModules checks the ids); `hideModules=` none. + entryPatch.hideModules = value === null || value === undefined ? null : value; + continue; + } if (key === "chat") { // The live-chat column beside this clip (report-to-video chat.mjs): on|off|true|false; `chat=` clears it. entryPatch.chat = chatFlag(value); @@ -263,6 +272,10 @@ export async function setCommand(args, { root = REPORTS_ROOT, out = (s) => conso else (group === "claim" ? claim : audio)[k] = value; } if (Object.keys(audio).length) entryPatch.audio = audio; + const takeFlag = flags.get("--take"); + const take = typeof takeFlag === "string" && takeFlag ? takeFlag : null; + if (flags.has("--take") && !take) throw new CliError("--take needs a take id"); + if (take && (markChanges.length || Object.keys(claim).length)) throw new CliError("--take sets a take's entry knobs; claim.* and marks are the project's (set them without --take)"); // `blur.on=` (or false): no blur at all, whatever else was given. if (Object.keys(blur).length) entryPatch.blur = "on" in blur && (blur.on === null || blur.on === false) ? null : blur; const results = {}; @@ -284,8 +297,13 @@ export async function setCommand(args, { root = REPORTS_ROOT, out = (s) => conso notes = editNotes; } if (Object.keys(entryPatch).length) { - const token = await manifestToken(project.dir); - const { result, editNotes } = await withEditNotes(project, () => updateClip(project.dir, clipId, entryPatch, { token, edit: "trim" })); + // A take's entry (--take): through the take's writer (takeEdit.mjs updateTakeClip -- the same rules, an undo + // point of the take's first), never the project's manifest; no edit notes (the patch is not the generated manifest). + const { result, editNotes } = take + ? { result: await (await import("./takeEdit.mjs")).updateTakeClip(project.dir, take, clipId, entryPatch), editNotes: null } + : await withEditNotes(project, async () => updateClip(project.dir, clipId, entryPatch, { token: await manifestToken(project.dir), edit: "trim" })); + if (take) results.take = { id: take, undo: result.revision?.rel ? `takes/${take}/${result.revision.rel}` : null }; + if ("hideModules" in entryPatch) results.hideModules = result.entry.hideModules ?? null; if ("audio" in entryPatch) results.audio = result.entry.audio ?? null; if ("blur" in entryPatch) results.blur = result.entry.blur ?? null; if ("layout" in entryPatch) results.layout = result.entry.layout ?? "clip"; @@ -321,6 +339,8 @@ export async function setCommand(args, { root = REPORTS_ROOT, out = (s) => conso if ("audio" in results) out(`${clipId}: audio ${results.audio ? JSON.stringify(results.audio) : "as recorded"}`); if ("blur" in results) out(`${clipId}: blur ${results.blur ? JSON.stringify(results.blur) : "none (the picture as recorded)"}`); if ("layout" in results) out(`${clipId}: layout ${results.layout}`); + if ("hideModules" in results) out(`${clipId}${results.take ? ` (take ${results.take.id})` : ""}: hideModules ${results.hideModules ? `${results.hideModules.join(", ")} (hidden over its span)` : "none"}`); + if (results.take?.undo) out(` undo point: ${results.take.undo} (umtool timeline ${project.id} --take ${results.take.id} undo)`); if ("chat" in results) out(`${clipId}: chat ${results.chat === true ? "on (its video's live_chat.cues.json beside the footage; the build says if there is none)" : results.chat === false ? "off" : "default (off)"}`); if ("fx" in results) out(`${clipId}: fx ${results.fx ? JSON.stringify(results.fx) : "none"}`); if ("vertical" in results) out(`${clipId}: vertical ${results.vertical ? JSON.stringify(results.vertical) : "the cut's (the centred crop)"}`); diff --git a/umtool/lib/report/knobsCli.test.mjs b/umtool/lib/report/knobsCli.test.mjs @@ -69,6 +69,34 @@ test("umtool set chat=on|off|true|false writes the clip's chat flag; chat= clear assert.deepEqual((await read(dir)).render.chrome.chat, { position: "left", lines: 8 }); }); +test("umtool set hideModules=diet,streak: the modules hidden over an entry's span, any entry; --take writes the take's patch", async () => { + const dir = await project("hide"); + const m = await read(dir); + m.timeline.push({ type: "post", id: "x01", item: "123" }); + await writeFile(path.join(dir, "video.manifest.json"), JSON.stringify(m, null, 2) + "\n"); + const { lines, run } = runner(setCommand); + assert.equal(await run("hide", "c02", "hideModules=streak,diet"), 0); + assert.deepEqual((await read(dir)).timeline[1].hideModules, ["diet", "streak"], "in the modules' order"); + assert.match(lines.at(-1), /hideModules diet, streak \(hidden over its span\)/); + assert.equal(await run("hide", "x01", 'hideModules=["promise"]'), 0, lines.join("\n")); + assert.deepEqual((await read(dir)).timeline[2].hideModules, ["promise"], "a post item too"); + assert.equal(await run("hide", "c02", "hideModules=dial"), 1); + assert.match(lines.at(-1), /dial cannot be hidden per entry/); + assert.equal(await run("hide", "c02", "hideModules="), 0); + assert.equal("hideModules" in (await read(dir)).timeline[1], false); + // --take: the take's patch, an undo point of the take's; the project's manifest untouched. + const { draftTake } = await import("./takeMaker.mjs"); + const { resolveTakeManifest } = await import("./takeManifest.mjs"); + await draftTake(dir, { id: "panel", label: "Panel", patch: {} }); + const before = await readFile(path.join(dir, "video.manifest.json"), "utf8"); + assert.equal(await run("hide", "c02", "hideModules=diet,streak", "--take", "panel"), 0, lines.join("\n")); + assert.match(lines.join("\n"), /c02 \(take panel\): hideModules diet, streak/); + assert.equal(await readFile(path.join(dir, "video.manifest.json"), "utf8"), before); + assert.deepEqual((await resolveTakeManifest(dir, "panel")).manifest.timeline[1].hideModules, ["diet", "streak"]); + assert.equal(await run("hide", "c02", "claim.count=2", "--take", "panel"), 2); + assert.match(lines.at(-1), /--take sets a take's entry knobs/); +}); + test("umtool set: claim and audio knobs through the writers; key= clears; a bad key or value is refused", async () => { const dir = await project("set"); const { lines, run } = runner(setCommand); diff --git a/umtool/lib/report/manifest.mjs b/umtool/lib/report/manifest.mjs @@ -32,7 +32,7 @@ import { } from "umtool-report-to-video/ledger-totals"; import { isCalendarDate } from "umtool-report-to-video/attribution"; import { - normalizeOnscreen, validateChrome, validateDeckClaims, validateDeckMarkers, validatePosts, validateTeaser, validateTeasers, + normalizeOnscreen, parseHideModules, validateChrome, validateDeckClaims, validateDeckMarkers, validatePosts, validateTeaser, validateTeasers, } from "umtool-report-to-video/deck"; import { validateThreadEntries } from "yt-dlp-transcript-common/lib/report/panels.mjs"; import { validateAssist } from "yt-dlp-transcript-common/lib/clips/assist.mjs"; @@ -298,6 +298,18 @@ export async function updateClip(dir, clipId, patch, { token = null, edit = "tri export const GAP_PATCH_KEYS = Object.freeze(["gaps", "gapAdd", "gapRemove"]); /** + * Set an entry's `hideModules` (deck.mjs parseHideModules: a list, or "diet,streak"); null, "" or [] removes it. + * @param {Record<string, unknown>} entry + * @param {unknown} value + */ +function applyHideModules(entry, value) { + const { value: ids, error } = parseHideModules(value); + if (error) throw new Error(error); + if (ids) entry.hideModules = ids; + else delete entry.hideModules; +} + +/** * updateClip's rules over a manifest held in memory: the ONE place a clip * patch is checked and applied. updateClip runs it on the project's file * inside its lock; a take's walk (takeEdit.mjs) runs it on the take's @@ -319,6 +331,12 @@ export function patchClipEntry(manifest, clipId, patch, { edit = "trim", now = n const original = patch.layout !== undefined ? (raw ?? JSON.stringify(manifest)) : null; const entry = (manifest.timeline ?? []).find((e) => e.id === clipId); if (!entry) throw new Error(`no timeline entry with id ${clipId}`); + // The modules this entry hides over its span (`hideModules`, deck.mjs entryHides): any entry may carry it -- a + // post item, a still, a clip -- so a patch of it alone is applied here, before the clip-only rules. + if (patch !== RESTORE_PATCH && Object.keys(patch).length && Object.keys(patch).every((k) => k === "hideModules")) { + applyHideModules(entry, patch.hideModules); + return { entry, before: { start: entry.start, end: entry.end } }; + } // `!== "clip"`, not `=== "card"`. The timeline's vocabulary is open -- one // real manifest carries `scroll` and `chart` entries -- and the card-only // check would have let a window be written onto one of those. @@ -727,6 +745,8 @@ export function patchClipEntry(manifest, clipId, patch, { edit = "trim", now = n if (bad.length) throw new Error(`layout: ${bad.join("; ")}`); } + if (patch.hideModules !== undefined) applyHideModules(entry, patch.hideModules); + // The live-chat column beside this clip (chat.mjs): true shows it, false is // the explicit no, null/"" removes the key (the default: off). if (patch.chat !== undefined) { diff --git a/umtool/report-to-video/chrome-story.mjs b/umtool/report-to-video/chrome-story.mjs @@ -196,11 +196,52 @@ export function chapterWindows(schedule, render) { if (!sp) return; const to = Math.min(sp.out, sp.in + C.seconds); if (!(to - sp.in > 0.2)) return; - out.push({ segment: c.at, from: sp.in, to, n, title: c.title, subtitle: c.subtitle ?? "", date: c.date ?? null }); + const w = { segment: c.at, from: sp.in, to, n, title: c.title, subtitle: c.subtitle ?? "", date: c.date ?? null }; + // Where it stands (chapterPlacement): a lower band that would cover a post card moves into the card's free side + // margin -- or, where neither margin can hold it, the cut has no bumper over that card. + const place = chapterPlacement(schedule, render, w); + if (place.mode === "none") return; + out.push({ ...w, place }); }); return out; } +/** The narrowest free margin beside a post card a lower chapter band moves into, design px (1920 wide). */ +export const CHAPTER_SIDE_MIN = 180; + +/** + * Where chapter window `w` stands, in frame px: `{ mode, rect, side? }`. + * + * - `card` (style card): the whole footage box -- a bumper that covers by design. + * - `band` (style lower): the band across the footage box's foot, as always. + * - `side`: a lower band whose window falls on a POST item (schedule.covers) and + * would touch its card stands instead in the card's wider free side margin + * (`side` "left" | "right": the footage box's height, a 16 px gap from the + * card), its words fitted to that width and set to its foot. The card stays + * whole: the post item's words are the evidence on screen. + * - `none`: neither margin is CHAPTER_SIDE_MIN wide -- no bumper over that card + * (the rail's section label and the section title still mark where it opens). + */ +export function chapterPlacement(schedule, render, w) { + const feed = schedule?.layout === "feed"; + const f = chapterGeometry(render, { feed }); + if (resolveChapter(render).style !== "lower") return { mode: "card", rect: { ...f } }; + const band = chapterCover(render, { feed }); + const covers = (Array.isArray(schedule?.covers) ? schedule.covers : []) + .filter((c) => Array.isArray(c?.rects) && c.rects.length && c.from < w.to && c.to > w.from); + const rects = covers.flatMap((c) => c.rects).filter((r) => r && [r.x, r.y, r.width, r.height].every(Number.isFinite)); + const touches = (a, b) => a.x < b.x + b.width && b.x < a.x + a.width && a.y < b.y + b.height && b.y < a.y + a.height; + if (!rects.some((r) => touches(r, band))) return { mode: "band", rect: band }; + const px = pxOf(render); + const gap = px(16); + const x0 = Math.min(...rects.map((r) => r.x)), x1 = Math.max(...rects.map((r) => r.x + r.width)); + const left = { x: f.x, y: f.y, width: Math.max(0, x0 - gap - f.x), height: f.height }; + const right = { x: x1 + gap, y: f.y, width: Math.max(0, f.x + f.width - (x1 + gap)), height: f.height }; + const [side, rect] = left.width >= right.width ? ["left", left] : ["right", right]; + if (rect.width < px(CHAPTER_SIDE_MIN)) return { mode: "none", rect: null }; + return { mode: "side", side, rect }; +} + /** The chapter bumper's region: the footage box. */ export function chapterGeometry(render, { feed = false } = {}) { return footageBox(render, { feed }); @@ -237,18 +278,33 @@ export function chapterHtml(schedule, render, window, opts = {}) { const { init, cues } = compileCues({ ch: { autoAlpha: 0 }, "ch.t": { y: px(18) } }, ev); const lower = C.style === "lower"; const date = ch.date ? dateText(ch.date) : ""; + // Beside a post card (chapterPlacement "side"): the band in the card's free margin, its words fitted to it -- + // scaled down until the longest word of each line fits the margin's width, then wrapped. + const side = ch.place?.mode === "side" ? ch.place : null; + let k = 1; + if (side) { + const room = side.rect.width - 2 * px(20); + const longest = (text, em) => Math.max(0, ...String(text ?? "").split(/\s+/).map((wd) => wd.length * em)); + const need = Math.max(longest(ch.title, 0.58) * px(54), longest(ch.subtitle, 0.52) * px(28), longest(date, 0.74) * px(26), 1); + k = Math.max(0.45, Math.min(1, room / need)); + } + const fs = (v) => Math.max(1, Math.round(px(v) * k)); const css = ` .chapter { position: absolute; visibility: hidden; opacity: 0; display: flex; flex-direction: column; - ${lower + ${side + ? `left: ${side.rect.x - geo.x}px; top: ${side.rect.y - geo.y}px; width: ${side.rect.width}px; height: ${side.rect.height}px; box-sizing: border-box; + padding: ${px(26)}px ${px(20)}px; justify-content: flex-end; ${side.side === "right" ? "text-align: right; align-items: flex-end;" : ""} + background: linear-gradient(to top, ${rgba(pal.bg, 0.94)}, ${rgba(pal.bg, 0.0)} 60%);` + : lower ? `left: 0; right: 0; bottom: 0; height: ${px(CHAPTER_LOWER_HEIGHT)}px; padding: ${px(26)}px ${px(48)}px; justify-content: center; background: linear-gradient(to top, ${rgba(pal.bg, 0.94)}, ${rgba(pal.bg, 0.0)});` : `inset: 0; align-items: center; justify-content: center; text-align: center; padding: ${px(60)}px; background: ${rgba(pal.bg, 0.92)};`} } - .ct { display: flex; flex-direction: column; gap: ${px(12)}px; ${lower ? "" : "align-items: center;"} } - .rule { width: ${px(96)}px; height: ${px(6)}px; background: ${pal.accent}; border-radius: ${px(3)}px; } - .title { font-family: 'DeckSansBold', sans-serif; font-size: ${px(lower ? 54 : 84)}px; line-height: 1.08; color: ${pal.fg}; } - .sub { font-size: ${px(lower ? 28 : 36)}px; line-height: 1.25; color: ${pal.muted}; max-width: ${px(1300)}px; } - .date { font-family: 'DeckSansBold', sans-serif; font-size: ${px(26)}px; letter-spacing: 0.12em; text-transform: uppercase; color: ${pal.accent}; }`; + .ct { display: flex; flex-direction: column; gap: ${fs(12)}px; ${lower ? (side?.side === "right" ? "align-items: flex-end;" : "") : "align-items: center;"} } + .rule { width: ${fs(96)}px; height: ${px(6)}px; background: ${pal.accent}; border-radius: ${px(3)}px; } + .title { font-family: 'DeckSansBold', sans-serif; font-size: ${lower ? fs(54) : px(84)}px; line-height: 1.08; color: ${pal.fg}; } + .sub { font-size: ${lower ? fs(28) : px(36)}px; line-height: 1.25; color: ${pal.muted}; max-width: ${px(1300)}px; } + .date { font-family: 'DeckSansBold', sans-serif; font-size: ${fs(26)}px; letter-spacing: 0.12em; text-transform: uppercase; color: ${pal.accent}; }`; const body = `<div class="chapter" data-k="ch"><div class="ct" data-k="ch.t"><div class="rule"></div>${date ? `<div class="date">${esc(date)}</div>` : ""}<div class="title">${esc(ch.title)}</div>${ch.subtitle ? `<div class="sub">${esc(ch.subtitle)}</div>` : ""}</div></div>`; return cuePageHtml({ id: "chapter", W: geo.width, H: geo.height, fps, fonts: opts.fonts, gsapSrc: opts.gsap, css, body, init, cues, diff --git a/umtool/report-to-video/deck.mjs b/umtool/report-to-video/deck.mjs @@ -1444,11 +1444,62 @@ export function deckSchedule({ // measure extras move clear of it (measure-extras.mjs measurePlacements). const covers = postCovers(entries, doc.segments, render, { feed: doc.layout === "feed" }); if (covers.length) doc.covers = covers; + // The entries that hide modules over their span (`hideModules`): text in the footage no dodge can know of. + const hides = entryHides(entries, doc.segments); + if (hides.length) doc.hides = hides; } return doc; } /** + * The modules a timeline entry may hide over its own span (`entry.hideModules`): + * the measure extras, which stand over the footage. The instruments' column and + * the deck never cover footage, so there is nothing to hide them for. + */ +export const HIDEABLE_MODULES = Object.freeze(["goals", "peak", "promise", "diet", "streak"]); + +/** + * An entry's `hideModules` as written: a list of HIDEABLE_MODULES ids, or a + * comma-separated string of them (`umtool set <p> <entry> hideModules=diet,streak`). + * Returns `{ value, error }`: `value` the ids, de-duplicated in HIDEABLE_MODULES + * order (null for none: the key removed), `error` a sentence when one is not a + * module an entry can hide. + * + * @param {unknown} v + * @returns {{ value: string[] | null, error: string | null }} + */ +export function parseHideModules(v) { + if (v === null || v === undefined || v === "" || v === false) return { value: null, error: null }; + const list = Array.isArray(v) ? v : typeof v === "string" ? v.split(",") : null; + if (!list) return { value: null, error: `hideModules is a list of module ids (${HIDEABLE_MODULES.join(", ")}), not ${JSON.stringify(v)}` }; + const ids = list.map((x) => String(x).trim()).filter(Boolean); + const bad = ids.filter((x) => !HIDEABLE_MODULES.includes(x)); + if (bad.length) return { value: null, error: `hideModules: ${bad.join(", ")} cannot be hidden per entry (${HIDEABLE_MODULES.join(", ")})` }; + const value = HIDEABLE_MODULES.filter((x) => ids.includes(x)); + return { value: value.length ? value : null, error: null }; +} + +/** + * The spans over which an entry hides modules: `[{ segment, from, to, modules }]` + * -- `from`/`to` its segment's span in the cut, `modules` its `hideModules` + * (unknown ids dropped). measure-extras.mjs measurePlacements hides each named + * module over the span with its own fade, as it does over a post card. + */ +export function entryHides(entries, segments) { + const byId = new Map((segments ?? []).map((s) => [s.id, s])); + const out = []; + for (const e of entries ?? []) { + if (!e?.hideModules) continue; + const ids = Array.isArray(e.hideModules) ? e.hideModules.filter((x) => HIDEABLE_MODULES.includes(x)) : e.hideModules; + const { value } = parseHideModules(ids); + const seg = byId.get(e.id); + if (!value || !seg || !Number.isFinite(seg.start) || !Number.isFinite(seg.duration)) continue; + out.push({ segment: e.id, from: seg.start, to: Math.round((seg.start + seg.duration) * 1000) / 1000, modules: value }); + } + return out; +} + +/** * The boxes each POST ITEM draws over the footage while it is up, in the * frame: `[{ segment, from, to, rects: [{x, y, width, height}] }]` -- its card, * and its attachments' slot and strip when it has them, as post-item.mjs diff --git a/umtool/report-to-video/measure-extras.mjs b/umtool/report-to-video/measure-extras.mjs @@ -837,11 +837,23 @@ export function measureCovers(schedule, render) { const chapters = render?.chrome?.chapter ? chapterWindows(schedule, render) : []; if (chapters.length) { const band = chapterCover(render, { feed }); - for (const w of chapters) out.push({ kind: "chapter", from: w.from, to: w.to, rects: [band] }); + // Where each bumper stands: its band, or beside a post card its side margin (chrome-story.mjs chapterPlacement). + for (const w of chapters) out.push({ kind: "chapter", from: w.from, to: w.to, rects: [w.place?.mode === "side" ? w.place.rect : band] }); } return out.sort((a, b) => a.from - b.from); } +/** `spans` (each `{ from, to, ... }`) with [from, to) cut out of them: a span across it is split in two. */ +function carveSpans(spans, from, to) { + const out = []; + for (const sp of spans) { + if (sp.to <= from || sp.from >= to) { out.push(sp); continue; } + if (sp.from < from) out.push({ ...sp, to: from }); + if (sp.to > to) out.push({ ...sp, from: to }); + } + return out; +} + /** * Every measure module's placement over the cut: `{ [id]: { home, region, * moves: [{ from, to, rect | null, size }] } }` -- `home` where it stands, @@ -942,6 +954,18 @@ export function measurePlacements(schedule, render, { finaleSlot = null } = {}) out.promise.moves.push({ from: finaleSlot.at, to: Number(schedule.total) || fin.to, rect: finaleSlot.rect, size: finaleSlot.size }); } else if (inColumn) out.promise.moves.push({ from: fin.from, to: Number(schedule.total) || fin.to, rect: null, size: 1 }); } + // An entry that hides modules over its span (`hideModules`, deck.mjs entryHides -- text in the footage no + // dodge can know of, rev 9: the refund email in v02): each named module hidden there with its own fade, whatever + // it would otherwise have done in that span. + for (const h of Array.isArray(schedule?.hides) ? schedule.hides : []) { + if (!(Number.isFinite(h?.from) && Number.isFinite(h?.to) && h.to > h.from) || !Array.isArray(h.modules)) continue; + for (const id of h.modules) { + if (!out[id] || !resolveMeasureExtra(id, render)) continue; + out[id].moves = carveSpans(out[id].moves, h.from, h.to); + out[id].moves.push({ from: h.from, to: h.to, rect: null, size: 1 }); + if (id === "promise") out.promise.strips = carveSpans(out.promise.strips, h.from, h.to); + } + } for (const id of MEASURE_EXTRAS) { const p = out[id]; // Two moves that meet, to the same place: one. diff --git a/umtool/report-to-video/measure-extras.test.mjs b/umtool/report-to-video/measure-extras.test.mjs @@ -11,7 +11,7 @@ import { fileURLToPath } from "node:url"; import { goalsHtml, dietHtml, moverCues, moverSteps, peakHtml, promiseHtml, spreadLabels, stampSize, streakHtml } from "./chrome-measure-extras.mjs"; import { cuePageHtml } from "./chrome-cues.mjs"; -import { estimateSchedule, validateChrome } from "./deck.mjs"; +import { entryHides, estimateSchedule, HIDEABLE_MODULES, parseHideModules, validateChrome } from "./deck.mjs"; import { frameKeys } from "./frame-keys.mjs"; import { daysBetween, deadlineDate, dietRuns, dietStates, goalStates, goalText, lostRunsRuns, measureExtraGeometry, measurePlacements, peakStates, pledgeRuns, @@ -175,6 +175,32 @@ test("promise: AS OF follows the playhead's in-record date in the rev9 order -- assert.deepEqual([states.at(-1).rows[0].to, states.at(-1).asOf], ["2026-11-06", true], "the render date from the finale on"); }); +test("hideModules: an entry hides the named extras over its span, with their own fade, whatever else they did there", () => { + // The entry's knob, read into the schedule (deck.mjs entryHides): its segment's span, the ids it names. + const segs = [{ id: "v01", start: 690, duration: 10 }, { id: "v02", start: 699.6, duration: 12.4 }]; + assert.deepEqual(entryHides([{ id: "v01" }, { id: "v02", hideModules: ["streak", "diet", "nope"] }], segs), [{ segment: "v02", from: 699.6, to: 712, modules: ["diet", "streak"] }]); + assert.deepEqual(parseHideModules("streak, diet"), { value: ["diet", "streak"], error: null }); + assert.match(parseHideModules("dial").error, /dial cannot be hidden per entry \(goals, peak, promise, diet, streak\)/); + assert.deepEqual(parseHideModules(""), { value: null, error: null }); + assert.deepEqual([...HIDEABLE_MODULES], ["goals", "peak", "promise", "diet", "streak"]); + // Over the span: hidden (rect null), each module's moves; a dodge across it is cut around it. + const r = withDeck({ diet: {}, streak: {} }); + // A card on the diet badge's home: it dodges to a slot over the card's span. + const card = { segment: "p1", from: 715, to: 725, rects: [measureExtraGeometry("diet", r)] }; + const plain = measurePlacements(schedule(MEASURE, { covers: [card] }), r); + const hid = measurePlacements(schedule(MEASURE, { covers: [card], hides: [{ segment: "v02", from: 718, to: 721, modules: ["diet"] }] }), r); + assert.ok(plain.diet.moves.some((m) => m.from === 715 && m.to === 725 && m.rect), "the card's own move: a dodge"); + const at = (moves, t) => moves.filter((m) => m.from <= t && t < m.to); + assert.deepEqual(at(hid.diet.moves, 719).map((m) => m.rect), [null], "hidden over v02, one move"); + assert.ok(hid.diet.moves.every((m) => !(m.from < 721 && m.to > 718) || (m.from === 718 && m.to === 721 && m.rect === null)), "nothing else in the span"); + assert.ok(at(hid.diet.moves, 716)[0].rect && at(hid.diet.moves, 723)[0].rect, "the dodge on either side of it"); + assert.deepEqual(hid.streak.moves, plain.streak.moves, "a module it does not name: as it was"); + // A clean span: just the hide. + const clean = measurePlacements(schedule(MEASURE, { hides: [{ segment: "v02", from: 600, to: 610, modules: ["diet", "streak"] }] }), r); + assert.deepEqual(clean.diet.moves, [{ from: 600, to: 610, rect: null, size: 1 }]); + assert.deepEqual(clean.streak.moves, [{ from: 600, to: 610, rect: null, size: 1 }]); +}); + test("diet: a stamp per change of regime or number, words alone not slammed, a null after one is No diet", () => { const states = dietStates(schedule(), RENDER); assert.equal(states[0].diet.label, "Some diet"); diff --git a/umtool/report-to-video/modules/chapter.mjs b/umtool/report-to-video/modules/chapter.mjs @@ -5,7 +5,7 @@ import path from "node:path"; import { snapWindow } from "../deck.mjs"; -import { chapterGeometry, chapterHtml, chapterWindows, resolveChapter } from "../chrome-story.mjs"; +import { CHAPTER_SIDE_MIN, chapterGeometry, chapterHtml, chapterWindows, resolveChapter } from "../chrome-story.mjs"; import { assertRegion, defineModule } from "./contract.mjs"; import { CHAPTER_DEFAULTS, CHAPTER_LIMITS, CHAPTER_STYLES, validateChapter } from "./story-settings.mjs"; @@ -38,7 +38,7 @@ export default defineModule({ intro: "A section bumper -- per dog, per crisis, per lawsuit -- over the first `seconds` of the clip it opens (`render.chrome.chapter`, chrome-story.mjs): a window of the cut laid at its own second, over the footage box (the deck stays). It does not insert time: the clip's sound plays under it.", rows: [ ["`chrome.chapter.list[]`", `1–${CHAPTER_LIMITS.list} \`{at, title ≤${CHAPTER_LIMITS.title}, subtitle? ≤${CHAPTER_LIMITS.subtitle}, date?}\` -- \`at\` the clip it opens, once each`, "`umtool modules apply <p> --config module-config.json` · `umtool look <p> chapter='{…}'`"], - ["`chrome.chapter.style`", "`card` (the footage box covered) · `lower` (a band at its foot) · default `card`", "`umtool look <p> chapter.style=lower`"], + ["`chrome.chapter.style`", `\`card\` (the footage box covered) · \`lower\` (a band at its foot -- except over a POST item, whose card it never covers: it stands in the card's wider free side margin, its words fitted to it; a card with no margin ${CHAPTER_SIDE_MIN} px wide gets no bumper, the rail's section label still marks it) · default \`card\``, "`umtool look <p> chapter.style=lower`"], ["`chrome.chapter.seconds`", `${CHAPTER_LIMITS.seconds[0]}–${CHAPTER_LIMITS.seconds[1]} s, never past the clip · default 3`, "`umtool look <p> chapter.seconds=2.5`"], ], }, diff --git a/umtool/report-to-video/modules/measure-extras-module.mjs b/umtool/report-to-video/modules/measure-extras-module.mjs @@ -57,6 +57,7 @@ export function measureExtraModule(spec) { rows: [ ...spec.docs.rows, [`\`deck.${id}.onPosts\`, \`.onChapters\``, "`dodge` `hide` `show` · default `dodge`: while a post item's card (its card, slot and strip as postLayout lays them: the schedule's `covers`) or a chapter band is up where it stands, it moves to a free anchor of the footage box -- a size down to half if it must, never onto another measure extra that is up -- and hides when none fits; `hide` hides, `show` stays over it", `\`umtool look <p> deck.${id}.onPosts=hide\``], + ["a timeline entry's `hideModules`", `\`["${id}", …]\` on an entry hides it over that entry's span, with its own fade, whatever it would otherwise do there (text in the footage no dodge can know of) · any entry, a post item too`, `\`umtool set <p> <entry> hideModules=${id}\` (\`--take <t>\` for a take)`], ], }, region: id, diff --git a/umtool/report-to-video/modules/story.test.mjs b/umtool/report-to-video/modules/story.test.mjs @@ -4,7 +4,7 @@ import { test } from "node:test"; import assert from "node:assert/strict"; import { frameKeys } from "../frame-keys.mjs"; -import { chapterHtml, chapterWindows, pairHtml, pairSchedule, statusHtml, statusRows, statusStates } from "../chrome-story.mjs"; +import { chapterCover, chapterHtml, chapterPlacement, chapterWindows, CHAPTER_SIDE_MIN, pairHtml, pairSchedule, statusHtml, statusRows, statusStates } from "../chrome-story.mjs"; import { validateChrome } from "../deck.mjs"; import { moduleById, moduleProblems } from "./index.mjs"; import { storyClipErrors, validateChapter, validatePair, validateStatus } from "./story-settings.mjs"; @@ -114,6 +114,43 @@ test("chapter: a window per chapter the cut plays, its page keyed from its offse assert.equal(mod.regions(schedule, { render: r, outDir: "/tmp/x", clip: { at: 15, dur: 10 }, shift: 15 })[0].offset, 5); }); +test("chapter: a lower band over a post item never covers its card -- it stands in the card's free side margin", () => { + // A section that opens on a post item: its card (schedule.covers, deck.mjs postCovers) in the middle of the footage box. + const r = render({ chapter: { style: "lower", list: [{ at: "c", title: "The scale video", subtitle: "23 Oct – 3 Nov 2026", date: "2026-10-23" }, { at: "a", title: "Indy" }] } }); + const band = chapterCover(r); + const card = { x: band.x + 520, y: band.y - 600, width: 767, height: band.height + 560 }; + const withCard = (c) => ({ ...schedule, covers: [{ segment: "c", from: 20, to: 30, rects: [c] }] }); + const ws = chapterWindows(withCard(card), r); + const wa = ws.find((w) => w.segment === "a"), wc = ws.find((w) => w.segment === "c"); + assert.equal(wa.place.mode, "band", "a clip's section: the band, as always"); + assert.equal(wc.place.mode, "side"); + const touches = (a, b) => a.x < b.x + b.width && b.x < a.x + a.width && a.y < b.y + b.height && b.y < a.y + a.height; + assert.ok(!touches(wc.place.rect, card), "the bumper never covers the card"); + assert.equal(wc.place.side, "left", "the wider margin"); + assert.equal(wc.place.rect.x + wc.place.rect.width + 16, card.x); + // Its page: the band laid in that margin (504 px: its words at full size). + const mod = moduleById("chapter"); + const page = (sch, rr) => chapterHtml(sch, rr, mod.window(sch, { segment: "c", fps: FPS, total: 45, render: rr }), {}); + const title = (h) => Number(/\.title \{[^}]*font-size: (\d+)px/.exec(h)[1]); + const html = page(withCard(card), r); + assert.match(html, new RegExp(`\\.chapter \\{[^}]*left: 0px; top: 0px; width: ${wc.place.rect.width}px;`)); + assert.equal(title(html), 54); + // A narrow margin (220 px) and a long word: the words scaled down until it fits, then wrapped. + const rl = render({ chapter: { style: "lower", list: [{ at: "c", title: "Unrefundable", date: "2026-10-23" }] } }); + const narrow = { ...card, x: band.x + 236, width: band.width - 336 }; + assert.equal(chapterWindows(withCard(narrow), rl)[0].place.rect.width, 220); + const t = title(page(withCard(narrow), rl)); + assert.ok(t < 54 && t >= Math.round(54 * 0.45) && 12 * 0.58 * t <= 220 - 40 + 1, `title ${t}px`); + // The measure extras move clear of where it stands, not of the band it left. + // A card on the right: the left margin; a card too wide for either margin to hold it: no bumper over it. + assert.equal(chapterPlacement(withCard({ ...card, x: band.x + band.width - 900 }), r, wc).side, "left"); + const wide = { ...card, x: band.x + 100, width: band.width - 200 }; + assert.ok(100 - 16 < CHAPTER_SIDE_MIN); + assert.deepEqual(chapterWindows(withCard(wide), r).map((w) => w.segment), ["a"]); + // A card clear of the band's rows (a short card up top): the band, as always. + assert.equal(chapterPlacement(withCard({ ...card, height: 200 }), r, wc).mode, "band"); +}); + test("status: rows come in on their first clip, outcomes fill on theirs", () => { const r = render({ status: STATUS }); const rows = statusRows(schedule, r);