// What live-preview.spec.ts walks (plans/live-preview.md): a deck cut of three // clips on vid1 (the fixture corpus's synthetic source, its 0-9 s window // cached in out/clips-raw) in the Huck video's shape -- a date as each clip's // deck title, verdict-coloured pips, a tally relabelled Episodes / Grift, a // claim stamped at a source second, the last clip the finale -- and never // built: the live preview draws the manifest's estimate. // // c01 1.0-3.5 "24 Oct 2020" // c02 4.0-6.5 marks k1 Grift at 5.0, k1b Episodes at 6.0 "2 Dec 2024" // c03 6.5-8.8 claim k2 Episodes, finale "27 Feb 2025" // // Synthetic, like every fixture. import { copyFileSync, mkdirSync, writeFileSync } from "node:fs"; import path from "node:path"; /** * @param {{ reports: string, deckManifest: Function, cachedWindow: string }} o */ export function makeLivePreviewFixture({ reports, deckManifest, cachedWindow }) { const dir = path.join(reports, "live-preview-fixture"); mkdirSync(dir, { recursive: true }); const m = deckManifest("live-preview-fixture", "The Live Preview Fixture", [ { type: "clip", id: "c01", video: "vid1", start: 1.0, end: 3.5, cite: 1, lock: true, quote: "This is a complete sentence.", onscreen: { title: "24 Oct 2020" } }, { type: "clip", id: "c02", video: "vid1", start: 4.0, end: 6.5, cite: 4, lock: true, quote: "And this one runs on", onscreen: { title: "2 Dec 2024" }, claims: [{ id: "k1", verdict: "CONTRADICTED", at: 5.0, hold: 0.8 }, { id: "k1b", verdict: "CORROBORATED", at: 6.0 }], }, { type: "clip", id: "c03", video: "vid1", start: 6.5, end: 8.8, cite: 6, lock: true, quote: "of that it finishes here.", onscreen: { title: "27 Feb 2025" }, claim: { id: "k2", verdict: "CORROBORATED" }, layout: "finale", }, ]); m.render.fetchPad = 0; m.render.chrome = { ...m.render.chrome, deck: { pip: { color: "verdict" }, finale: { statsTitle: "Seizures he reported", stats: [{ label: "2025", value: "5+" }] } }, factcheck: { verdicts: { CONTRADICTED: { label: "Grift", color: "#e3b23c" }, CORROBORATED: { label: "Episodes", tallyLabel: "Eps", color: "#6fa8dc", stampLabel: "Seizure" } }, stamp: { seconds: 1.5 }, }, }; writeFileSync(path.join(dir, "video.manifest.json"), JSON.stringify(m, null, 2) + "\n"); mkdirSync(path.join(dir, "out", "clips-raw"), { recursive: true }); copyFileSync(cachedWindow, path.join(dir, "out", "clips-raw", "vid1_0.00-9.00.mp4")); return { dir }; }