commit fd0db8b48694eefa2bdbf66e4f6d8833f541aa97
parent 9f1bb6795ef5bf6dba9d2681ac4e087abee89ebb
Author: I Mean I'm Just Saying <imeanimjustsaying@kiwifarms.st>
Date: Mon, 9 Nov 2026 14:15:05 -0500
umtool: the intro plays -- in Play, as Present's first slide, first on the walk, edited on the Cut tab
IntroCardPlayer (TeaserCardPlayer's iframe and ready handshake) plays the build's
own intro page, seeked on the stage's clock, its sound (the stand-in, or
render.intro.sound) slaved beside it. Play mounts it where the intro's card
placeholder stood; Present opens the deck on an intro slide (present.mjs, before
any divider; a posts reel that opens on one keeps its days); the walk lists the
intro first (walkOf's `intro` and `stops`, the take walk's first row, `umtool
walk`), watched, not judged.
The Cut tab's first row is the intro: Edit opens its knobs -- style, seconds,
mark, ground, sound, site, title, lines -- beside a live preview of the unsaved
value (playable with its sound), Save through the look writer, and each
version's on/off (its patch's render.intro: null).
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Diffstat:
11 files changed, 773 insertions(+), 8 deletions(-)
diff --git a/umtool/components/projects/TakeWalkPage.tsx b/umtool/components/projects/TakeWalkPage.tsx
@@ -111,6 +111,22 @@ export default async function TakeWalkPage({
</tr>
</thead>
<tbody>
+ {/* The intro the take opens on, first: watched in Play, not judged (it has no verdict). */}
+ {w.intro && (
+ <tr data-take-walk-intro={w.intro.style} className="border-t border-seam align-top">
+ <td className="num py-1 pr-2 text-[var(--color-dim)]">0</td>
+ <td className="py-1 pr-2">
+ <span className="font-mono text-text-2">intro</span>
+ <PlayLink project={project.id} take={take} clip={w.intro.id} where="walk-row" variant="icon" />
+ </td>
+ <td className="py-1 pr-2 whitespace-nowrap text-text-2">{w.intro.style}</td>
+ <td className="num py-1 pr-2 text-right">{w.intro.seconds.toFixed(1)}</td>
+ <td className="py-1 pr-2">
+ <span className={badgeVariants({ variant: "state", size: "sm" })}>watched, not judged</span>
+ </td>
+ <td className="py-1 pr-2 text-text-2">{[w.intro.title, ...w.intro.lines].filter(Boolean).join(" · ")}</td>
+ </tr>
+ )}
{w.clips.map((c) => (
<tr key={c.id} data-take-walk-clip={c.id} data-on-walk={c.onWalk ? "1" : "0"} className="border-t border-seam align-top">
<td className="num py-1 pr-2 text-[var(--color-dim)]">{c.cut}</td>
diff --git a/umtool/components/projects/present/PresentView.tsx b/umtool/components/projects/present/PresentView.tsx
@@ -5,6 +5,7 @@ import { useCallback, useEffect, useMemo, useRef, useState } from "react";
import PostItemPlayer, { postItemAssets, type CardView, type PostPlan, type ProgressPlan } from "../review/PostItemPlayer";
import ComboBadge, { type ComboInfo } from "../review/ComboBadge";
import { postPreload } from "../review/playEngine/postPreload";
+import IntroCardPlayer, { type IntroPage } from "../review/IntroCardPlayer";
// ---------------------------------------------------------------------------
// PRESENT MODE, THE VIEWER (umtool/docs/knobs.md, "Present mode"; operator, 8 Nov 2026): the cut as slides, one at
@@ -14,7 +15,8 @@ import { postPreload } from "../review/playEngine/postPreload";
//
// A POST slide is drawn by Play's own player (PostItemPlayer: the card page the build screenshots, its attachments,
// its narration's mix, its read-follow) on the slide's own clock from 0 as it arrives; a CLIP slide plays its spans
-// (its cut minus its gaps) from the cached window Play plays; a section, a day, a teaser are text.
+// (its cut minus its gaps) from the cached window Play plays; the INTRO plays the build's own page and its sound
+// (IntroCardPlayer, as Play does); a section, a day, a teaser are text.
//
// THE SETTINGS (key s): what the card censors, kind by kind (only when the payload can uncensor), the narration,
// auto-advance after the read and a linger, the attachments' sound -- each viewer's own, in this browser
@@ -51,7 +53,8 @@ type ClipSlide = SlideBase & {
};
type TextSlide = SlideBase & { kind: "section" | "day" | "teaser" | "card"; lines?: string[]; tail?: string | null; seconds?: number | null; heading?: string; within?: string | null };
type VideoSlide = SlideBase & { kind: "video"; src: string; from: number; to: number; seconds: number };
-export type Slide = PostSlide | ClipSlide | TextSlide | VideoSlide;
+type IntroSlide = SlideBase & { kind: "intro"; style: string; seconds: number | null; title?: string; lines?: string[] };
+export type Slide = PostSlide | ClipSlide | TextSlide | VideoSlide | IntroSlide;
type CensorKind = "names" | "slurs" | "authors" | "pictures";
export type PresentSettings = { censor: Record<CensorKind, boolean>; narration: boolean; autoAdvance: boolean; linger: number; sound: boolean };
export type PresentPayload = {
@@ -76,7 +79,7 @@ const CENSOR_WORDS: Record<CensorKind, string> = {
pictures: "Censored pictures",
};
/** How long a text slide stands before it counts as read (auto-advance), seconds. */
-const TEXT_SECONDS = { section: 2.5, day: 2, teaser: 4, card: 3 } as const;
+const TEXT_SECONDS = { section: 2.5, day: 2, teaser: 4, card: 3, intro: 4.18 } as const;
/** A slide id in the address: readable (`#postchan-x/1`), never ambiguous. */
const hashOf = (id: string) => `#${encodeURIComponent(id).replace(/%2F/g, "/").replace(/%40/g, "@")}`;
@@ -262,6 +265,7 @@ export default function PresentView({ payload, back, playHref }: { payload: Pres
if (!slide) return null;
if (slide.kind === "post") return slide.plan.total;
if (slide.kind === "clip" || slide.kind === "video") return clipDoneAt?.id === slide.id ? clipDoneAt.s : null;
+ if (slide.kind === "intro" && slide.seconds) return slide.seconds;
return slide.kind === "teaser" && slide.seconds ? slide.seconds : TEXT_SECONDS[slide.kind as keyof typeof TEXT_SECONDS] ?? 3;
}, [slide, clipDoneAt]);
const read = readEnd !== null && clock >= readEnd;
@@ -441,6 +445,7 @@ function SlideView({
}
if (slide.kind === "clip") return <ClipView slide={slide} project={project} take={take} playing={playing} sound censor={view.pictures && blurRendered} onDone={onDone} />;
if (slide.kind === "video") return <VideoView slide={slide} project={project} playing={playing} onDone={onDone} />;
+ if (slide.kind === "intro") return <IntroView slide={slide} project={project} take={take} s={s} playing={playing} sound={settings.sound} />;
return <TextView slide={slide} section={section} sections={sections} slides={slides} />;
}
@@ -558,9 +563,52 @@ function VideoView({ slide, project, playing, onDone }: { slide: VideoSlide; pro
);
}
+/**
+ * THE INTRO: the build's own page (POST /api/report/chrome/intro, composed for the cut played) on the slide's clock,
+ * its sound with it when the viewer's sound is on; its style and words in text until the page has composed.
+ */
+function IntroView({ slide, project, take, s, playing, sound }: { slide: IntroSlide; project: string; take: string | null; s: number; playing: boolean; sound: boolean }) {
+ const [page, setPage] = useState<IntroPage | { error: string } | null>(null);
+ useEffect(() => {
+ let live = true;
+ void (async () => {
+ try {
+ const r = await fetch("/api/report/chrome/intro", {
+ method: "POST",
+ headers: { "content-type": "application/json" },
+ body: JSON.stringify({ project, ...(take ? { take } : {}) }),
+ });
+ const j = (await r.json().catch(() => ({}))) as { intro?: IntroPage | null; error?: string };
+ if (live) setPage(r.ok && j.intro ? j.intro : { error: String(j.error ?? (r.ok ? "no intro" : `HTTP ${r.status}`)) });
+ } catch (e) {
+ if (live) setPage({ error: e instanceof Error ? e.message : String(e) });
+ }
+ })();
+ return () => {
+ live = false;
+ };
+ }, [project, take]);
+ return (
+ <div data-present-intro={slide.id} data-present-intro-style={slide.style} className="absolute inset-0 bg-black" style={{ containerType: "size" }}>
+ {page && "src" in page ? (
+ <IntroCardPlayer page={page} s={s} playing={playing} sound={sound} testid="present-intro" />
+ ) : (
+ <div className="absolute inset-0 flex flex-col items-center justify-center gap-[1.6cqh] text-center">
+ <div className="font-mono text-[2.4cqh] uppercase tracking-[0.2em] text-white/50">intro · {slide.style}</div>
+ {slide.title && <div className="font-display text-[6cqh] font-semibold leading-tight">{slide.title}</div>}
+ {(slide.lines ?? []).map((l, i) => (
+ <div key={i} className="text-[3cqh] text-white/70">{l}</div>
+ ))}
+ <div className="text-[2cqh] text-white/40" data-present-intro-state="">{page && "error" in page ? `the intro did not compose: ${page.error}` : "composing the intro…"}</div>
+ </div>
+ )}
+ </div>
+ );
+}
+
/** A SECTION or a DAY divider, a TEASER's lines, a card's heading: words on the stage. */
function TextView({ slide, section, sections, slides }: { slide: TextSlide; section: Section | null; sections: Section[]; slides: Slide[] }) {
- const count = slides.filter((x) => x.section === slide.section && x.kind !== "section" && x.kind !== "day").length;
+ const count = slides.filter((x) => x.section === slide.section && x.kind !== "section" && x.kind !== "day" && x.kind !== "intro").length;
const ordinal = sections.findIndex((x) => x.id === slide.section);
return (
<div data-present-text={slide.kind} className="absolute inset-0 flex flex-col items-center justify-center gap-[2.4cqh] px-[8cqw] text-center" style={{ containerType: "size" }}>
diff --git a/umtool/components/projects/report/CutTab.tsx b/umtool/components/projects/report/CutTab.tsx
@@ -37,6 +37,7 @@ import { lastStartedRun, projectFetchBody, readFetchRuns } from "@/lib/report/fe
import { readVoiceMatch, voiceMatchSummary } from "yt-dlp-transcript-common/lib/montage/voiceMatch.mjs";
import { clipMomentKey } from "umtool-report-to-video/montage-rulings";
import { trailerCandidates } from "@/lib/report/trailerCandidates.mjs";
+import IntroRow from "./IntroEditor";
// The Cut tab: the timeline, read back -- the walk into it, its takes, every
// entry with what is wrong with it, and the corrections the walk collected.
@@ -542,6 +543,8 @@ export default async function CutTab({ project, detail, search, tabHref }: Repor
/>
</div>
)}
+ {/* The intro the cut opens on (render.intro), first, and its editor with a live preview (lane intro-play). */}
+ <IntroRow project={project.id} written={m?.render?.intro ?? null} open={search.intro === "1"} />
<TimelineList project={project.id} count={entries.length} groupCount={groupBars.list.length}>
{sectionBars.opening && <SectionBar section={sectionBars.opening} />}
{entries.map((e, at) => (
diff --git a/umtool/components/projects/report/IntroEditor.tsx b/umtool/components/projects/report/IntroEditor.tsx
@@ -0,0 +1,437 @@
+"use client";
+
+import { useCallback, useEffect, useMemo, useRef, useState } from "react";
+import { Button } from "@/components/ui/button";
+import { Field, Input, Select, Textarea } from "@/components/ui/field";
+import IntroCardPlayer, { type IntroPage } from "../review/IntroCardPlayer";
+
+// THE INTRO ROW of the Cut tab, and its editor (lane intro-play; operator, 8 Nov 2026: "more first-class intro support
+// (view in play the cut)"): the intro the cut opens on (`render.intro`) as the first row of the cut, and -- Edit -- its
+// knobs beside a LIVE PREVIEW of the page the build renders (POST /api/report/chrome/intro with the unsaved value: the
+// editor's draft page), playable with its sound. Save writes the project's render.intro through the look writer (PUT
+// /api/report/render, the build's own checks, the manifest's token). Each VERSION (a made take) has its own on/off: off
+// is its patch's `render.intro: null` (PUT /api/report/chrome/intro). The CLI twin is `umtool intro`. No AI anywhere.
+
+type Choices = {
+ styles: string[];
+ styleDefault: string;
+ marks: string[];
+ grounds: string[];
+ seconds: { min: number; max: number; default: number };
+ titleMax: number;
+ linesMax: number;
+ lineMax: number;
+};
+type Version = { id: string; label: string; draft: boolean; intro: "cut" | "off" | "own" };
+type Entry = { style: string; ground: string; mark: string; seconds: number; title?: string; lines?: string[]; site?: { name: string }; sound?: unknown };
+type State = {
+ token: string | null;
+ title: string | null;
+ generatedOn: string | null;
+ intro: unknown;
+ errors: string[];
+ entry: Entry | null;
+ entryError: string | null;
+ versions: Version[];
+ choices: Choices;
+};
+
+/** The editor's fields, as typed. */
+type Draft = {
+ on: boolean;
+ style: string;
+ seconds: string;
+ mark: string;
+ ground: string;
+ sound: "standin" | "silent" | "file";
+ soundFile: string;
+ site: string;
+ title: string;
+ lines: string;
+};
+
+const isObj = (v: unknown): v is Record<string, unknown> => !!v && typeof v === "object" && !Array.isArray(v);
+const objectOf = (v: unknown): Record<string, unknown> | null => (typeof v === "string" ? { style: v } : isObj(v) ? { ...v } : null);
+
+function draftOf(written: unknown, styleDefault: string): Draft {
+ const o = objectOf(written);
+ return {
+ on: !!o,
+ style: typeof o?.style === "string" ? o.style : styleDefault,
+ seconds: typeof o?.seconds === "number" ? String(o.seconds) : "",
+ mark: typeof o?.mark === "string" ? o.mark : "",
+ ground: typeof o?.ground === "string" ? o.ground : "",
+ sound: o?.sound === false ? "silent" : typeof o?.sound === "string" ? "file" : "standin",
+ soundFile: typeof o?.sound === "string" ? o.sound : "",
+ site: typeof o?.site === "string" ? o.site : isObj(o?.site) ? JSON.stringify(o.site) : "",
+ title: typeof o?.title === "string" ? o.title : "",
+ lines: Array.isArray(o?.lines) ? (o.lines as unknown[]).filter((l) => typeof l === "string").join("\n") : "",
+ };
+}
+
+/** The value to write: the intro as written with the editor's keys over it (a key it does not show is kept). */
+function valueOf(d: Draft, written: unknown): unknown {
+ if (!d.on) return null;
+ const o: Record<string, unknown> = objectOf(written) ?? {};
+ o.style = d.style;
+ const set = (k: string, v: unknown) => {
+ if (v === undefined) delete o[k];
+ else o[k] = v;
+ };
+ const n = d.seconds.trim() ? Number(d.seconds) : undefined;
+ set("seconds", n === undefined ? undefined : Number.isFinite(n) ? n : d.seconds.trim());
+ set("mark", d.mark || undefined);
+ set("ground", d.ground || undefined);
+ set("sound", d.sound === "silent" ? false : d.sound === "file" ? d.soundFile.trim() || undefined : undefined);
+ const site = d.site.trim();
+ let siteValue: unknown = site || undefined;
+ if (site.startsWith("{")) {
+ try {
+ siteValue = JSON.parse(site);
+ } catch {
+ siteValue = site;
+ }
+ }
+ set("site", siteValue);
+ set("title", d.title.trim() || undefined);
+ const lines = d.lines.split("\n").map((l) => l.trim()).filter(Boolean);
+ set("lines", lines.length ? lines : undefined);
+ const keys = Object.keys(o);
+ return keys.length === 1 && keys[0] === "style" ? o.style : o;
+}
+
+/** One line for the row: what the cut opens on. */
+function summaryOf(state: State | null, written: unknown): string {
+ const e = state?.entry;
+ if (e) {
+ const words = [e.title, ...(e.lines ?? [])].filter(Boolean).join(" · ");
+ return `${e.style} · ${e.seconds} s · mark ${e.mark}${e.site ? ` · ${e.site.name}` : ""}${words ? ` · ${words}` : ""}`;
+ }
+ const o = objectOf(written);
+ return o ? `${String(o.style ?? "")}` : "none: the cut opens on its first entry";
+}
+
+export default function IntroRow({ project, written: initial, open: openInitially = false }: { project: string; written: unknown; open?: boolean }) {
+ const [state, setState] = useState<State | null>(null);
+ const [open, setOpen] = useState(openInitially);
+ const load = useCallback(async () => {
+ const r = await fetch(`/api/report/chrome/intro?${new URLSearchParams({ project }).toString()}`, { cache: "no-store" });
+ const j = (await r.json().catch(() => ({}))) as State & { error?: string };
+ if (r.ok && !j.error) setState(j);
+ return r.ok && !j.error ? j : null;
+ }, [project]);
+ useEffect(() => {
+ void load();
+ }, [load]);
+ const written = state ? state.intro : initial;
+ const has = written !== null && written !== undefined;
+ return (
+ <div data-intro-row={has ? "on" : "off"} className="mb-1.5 rounded border border-dashed border-[var(--color-line)] px-3 py-1.5 text-[12px]">
+ <div className="flex flex-wrap items-baseline gap-2">
+ <span className="font-mono text-[var(--color-dim)]">intro</span>
+ <span data-intro-summary="" className={has ? "text-[var(--color-text)]" : "text-[var(--color-dim)]"}>
+ {summaryOf(state, written)}
+ </span>
+ {state?.versions.some((v) => v.intro === "off") && (
+ <span className="text-[11px] text-[var(--color-dim)]" data-intro-versions-off="">
+ off in {state.versions.filter((v) => v.intro === "off").map((v) => v.id).join(", ")}
+ </span>
+ )}
+ <Button type="button" size="sm" variant={open ? "pressed" : "outline"} className="ml-auto" data-intro-edit="" aria-expanded={open} onClick={() => setOpen((o) => !o)}>
+ {open ? "Close" : has ? "Edit intro" : "Add an intro"}
+ </Button>
+ </div>
+ {open && state && <IntroEditor project={project} state={state} reload={load} />}
+ {open && !state && <p className="mt-1 text-[var(--color-dim)]">reading the intro…</p>}
+ </div>
+ );
+}
+
+function IntroEditor({ project, state, reload }: { project: string; state: State; reload: () => Promise<State | null> }) {
+ const c = state.choices;
+ const [draft, setDraft] = useState<Draft>(() => draftOf(state.intro, c.styleDefault));
+ const [token, setToken] = useState(state.token);
+ const [busy, setBusy] = useState(false);
+ const [said, setSaid] = useState<{ ok: boolean; text: string } | null>(null);
+ useEffect(() => setToken(state.token), [state.token]);
+ const value = useMemo(() => valueOf(draft, state.intro), [draft, state.intro]);
+ const key = JSON.stringify(value);
+ const dirty = key !== JSON.stringify(valueOf(draftOf(state.intro, c.styleDefault), state.intro)) || draft.on !== (state.intro !== null && state.intro !== undefined);
+ const set = (patch: Partial<Draft>) => {
+ setSaid(null);
+ setDraft((d) => ({ ...d, ...patch }));
+ };
+
+ // ---- the live preview: the draft composed as the build draws it, a beat after the last keystroke ----
+ const [page, setPage] = useState<IntroPage | null>(null);
+ const [problems, setProblems] = useState<string[]>([]);
+ const [composing, setComposing] = useState(false);
+ const seq = useRef(0);
+ useEffect(() => {
+ const mine = ++seq.current;
+ const t = setTimeout(async () => {
+ if (value === null) {
+ setPage(null);
+ setProblems([]);
+ return;
+ }
+ setComposing(true);
+ try {
+ const r = await fetch("/api/report/chrome/intro", {
+ method: "POST",
+ headers: { "content-type": "application/json" },
+ body: JSON.stringify({ project, intro: value }),
+ });
+ const j = (await r.json().catch(() => ({}))) as { intro?: IntroPage | null; error?: string; errors?: string[] };
+ if (mine !== seq.current) return;
+ if (r.ok) {
+ setPage(j.intro ?? null);
+ setProblems([]);
+ } else setProblems(j.errors ?? [String(j.error ?? `HTTP ${r.status}`)]);
+ } catch (e) {
+ if (mine === seq.current) setProblems([e instanceof Error ? e.message : String(e)]);
+ } finally {
+ if (mine === seq.current) setComposing(false);
+ }
+ }, 350);
+ return () => clearTimeout(t);
+ // `key` is the value, serialised: a new object with the same knobs composes nothing.
+ // eslint-disable-next-line react-hooks/exhaustive-deps
+ }, [project, key]);
+
+ const save = async () => {
+ setBusy(true);
+ setSaid(null);
+ try {
+ const r = await fetch("/api/report/render", {
+ method: "PUT",
+ headers: { "content-type": "application/json" },
+ body: JSON.stringify({ project, token, patch: { intro: value } }),
+ });
+ const j = (await r.json().catch(() => ({}))) as { token?: string; error?: string; errors?: string[]; stale?: boolean };
+ if (!r.ok) {
+ setSaid({ ok: false, text: j.stale ? "The manifest changed since this page read it — Revert reads it again." : (j.errors ?? [j.error ?? `HTTP ${r.status}`]).join("; ") });
+ return;
+ }
+ const next = await reload();
+ if (next) setDraft(draftOf(next.intro, c.styleDefault));
+ setSaid({ ok: true, text: value === null ? "Saved: the cut opens on no intro." : "Saved to the manifest." });
+ } finally {
+ setBusy(false);
+ }
+ };
+ const revert = async () => {
+ const next = await reload();
+ setDraft(draftOf((next ?? state).intro, c.styleDefault));
+ setSaid(null);
+ };
+ const setVersion = async (take: string, on: boolean) => {
+ setBusy(true);
+ setSaid(null);
+ try {
+ const r = await fetch("/api/report/chrome/intro", {
+ method: "PUT",
+ headers: { "content-type": "application/json" },
+ body: JSON.stringify({ project, take, on }),
+ });
+ const j = (await r.json().catch(() => ({}))) as { error?: string };
+ if (!r.ok) setSaid({ ok: false, text: String(j.error ?? `HTTP ${r.status}`) });
+ await reload();
+ } finally {
+ setBusy(false);
+ }
+ };
+
+ const card = draft.style === "title-card";
+ const savedHas = state.intro !== null && state.intro !== undefined;
+ return (
+ <div data-intro-editor="" className="mt-2 grid gap-3 md:grid-cols-[minmax(0,340px)_minmax(0,1fr)]">
+ <div className="flex flex-col gap-2">
+ <label className="inline-flex items-center gap-1.5 text-[12.5px] text-text">
+ <input type="checkbox" data-intro-on="" checked={draft.on} onChange={(e) => set({ on: e.target.checked })} />
+ Open the cut on an intro
+ </label>
+ <div className="grid grid-cols-2 gap-2">
+ <Field label="Style">
+ <Select data-intro-field="style" value={draft.style} disabled={!draft.on} onChange={(e) => set({ style: e.target.value })}>
+ {c.styles.map((s) => (
+ <option key={s} value={s}>
+ {s === c.styleDefault ? `${s} (the brand sting)` : s}
+ </option>
+ ))}
+ </Select>
+ </Field>
+ <Field label="Seconds" hint={`${c.seconds.min}–${c.seconds.max}`}>
+ <Input
+ data-intro-field="seconds"
+ type="number"
+ min={c.seconds.min}
+ max={c.seconds.max}
+ step={0.05}
+ placeholder={String(c.seconds.default)}
+ value={draft.seconds}
+ disabled={!draft.on}
+ onChange={(e) => set({ seconds: e.target.value })}
+ />
+ </Field>
+ <Field label="Mark">
+ <Select data-intro-field="mark" value={draft.mark} disabled={!draft.on} onChange={(e) => set({ mark: e.target.value })}>
+ <option value="">the style’s</option>
+ {c.marks.map((m) => (
+ <option key={m} value={m}>
+ {m}
+ </option>
+ ))}
+ </Select>
+ </Field>
+ <Field label="Ground">
+ <Select data-intro-field="ground" value={draft.ground} disabled={!draft.on} onChange={(e) => set({ ground: e.target.value })}>
+ <option value="">the style’s</option>
+ {c.grounds.map((g) => (
+ <option key={g} value={g}>
+ {g}
+ </option>
+ ))}
+ </Select>
+ </Field>
+ <Field label="Sound">
+ <Select data-intro-field="sound" value={draft.sound} disabled={!draft.on} onChange={(e) => set({ sound: e.target.value as Draft["sound"] })}>
+ <option value="standin">the stand-in</option>
+ <option value="silent">silent</option>
+ <option value="file">a file of the project</option>
+ </Select>
+ </Field>
+ <Field label="Site" hint="auto · a site id · none">
+ <Input data-intro-field="site" value={draft.site} placeholder="none" disabled={!draft.on} onChange={(e) => set({ site: e.target.value })} />
+ </Field>
+ </div>
+ {draft.sound === "file" && (
+ <Field label="Sound file" hint="relative to the manifest">
+ <Input data-intro-field="soundFile" value={draft.soundFile} placeholder="intro.wav" disabled={!draft.on} onChange={(e) => set({ soundFile: e.target.value })} />
+ </Field>
+ )}
+ <Field label="Title" hint={card ? `blank: the project's title${state.title ? ` (“${state.title}”)` : ""}` : "blank: none; written, under the wordmark"}>
+ <Input data-intro-field="title" value={draft.title} maxLength={c.titleMax} disabled={!draft.on} onChange={(e) => set({ title: e.target.value })} />
+ </Field>
+ <Field label="Lines" hint={`one per line, at most ${c.linesMax}${card ? "; blank: the project's date" : ""}`}>
+ <Textarea data-intro-field="lines" rows={2} value={draft.lines} disabled={!draft.on} onChange={(e) => set({ lines: e.target.value })} />
+ </Field>
+ <div className="flex flex-wrap items-center gap-2">
+ <Button type="button" variant="go" size="sm" data-intro-save="" disabled={busy || !dirty || problems.length > 0} onClick={() => void save()}>
+ Save intro
+ </Button>
+ <Button type="button" variant="quiet" size="sm" data-intro-revert="" disabled={busy || !dirty} onClick={() => void revert()}>
+ Revert
+ </Button>
+ {said && (
+ <span data-intro-said={said.ok ? "ok" : "error"} className={said.ok ? "text-[11.5px] text-kept-text" : "text-[11.5px] text-reject-text"}>
+ {said.text}
+ </span>
+ )}
+ </div>
+ {problems.length > 0 && (
+ <ul data-intro-problems="" className="m-0 list-disc pl-4 text-[11.5px] text-reject-text">
+ {problems.map((p) => (
+ <li key={p}>{p}</li>
+ ))}
+ </ul>
+ )}
+ {state.versions.length > 0 && (
+ <div data-intro-versions="" className="flex flex-col gap-1 border-t border-seam pt-2">
+ <span className="micro">versions</span>
+ {state.versions.map((v) => (
+ <label key={v.id} className="inline-flex items-center gap-1.5 text-[12px]" title={v.intro === "own" ? "its patch sets an intro of its own" : undefined}>
+ <input
+ type="checkbox"
+ data-intro-version={v.id}
+ checked={v.intro !== "off"}
+ disabled={busy || (!savedHas && v.intro === "off") || v.intro === "own"}
+ onChange={(e) => void setVersion(v.id, e.target.checked)}
+ />
+ <span className="font-mono">{v.id}</span>
+ <span className="text-[var(--color-dim)]">{v.intro === "off" ? "no intro" : v.intro === "own" ? "its own intro" : "opens on the cut's intro"}</span>
+ </label>
+ ))}
+ </div>
+ )}
+ </div>
+ <IntroPreview page={page} on={draft.on} composing={composing} />
+ </div>
+ );
+}
+
+/** The draft's page on a clock of its own: Play from the top with its sound, a scrubber, parked on the landed frame. */
+function IntroPreview({ page, on, composing }: { page: IntroPage | null; on: boolean; composing: boolean }) {
+ const seconds = page?.seconds ?? 0;
+ const [t, setT] = useState(3.6);
+ const [playing, setPlaying] = useState(false);
+ const from = useRef({ t: 0, at: 0 });
+ useEffect(() => {
+ if (!playing) return;
+ from.current = { t, at: performance.now() };
+ let raf = 0;
+ const tick = () => {
+ const now = from.current.t + (performance.now() - from.current.at) / 1000;
+ if (now >= seconds) {
+ setT(seconds);
+ setPlaying(false);
+ return;
+ }
+ setT(now);
+ raf = requestAnimationFrame(tick);
+ };
+ raf = requestAnimationFrame(tick);
+ return () => cancelAnimationFrame(raf);
+ // The clock restarts only on play; `t` is where it starts from.
+ // eslint-disable-next-line react-hooks/exhaustive-deps
+ }, [playing, seconds]);
+ const at = Math.min(t, seconds || t);
+ return (
+ <div className="flex min-w-0 flex-col gap-1.5" data-intro-preview={page ? page.style : on ? "composing" : "none"}>
+ <div className="relative w-full max-w-[560px] overflow-hidden rounded border border-seam bg-black" style={{ aspectRatio: page ? `${page.width} / ${page.height}` : "16 / 9" }}>
+ {page ? (
+ <IntroCardPlayer page={page} s={at} playing={playing} testid="intro-editor-preview" />
+ ) : (
+ <div className="absolute inset-0 flex items-center justify-center p-4 text-center text-[12px] text-white/60">
+ {on ? "composing the intro…" : "No intro: the cut opens on its first entry."}
+ </div>
+ )}
+ </div>
+ {page && (
+ <div className="flex max-w-[560px] items-center gap-2 text-[12px]">
+ <Button
+ type="button"
+ size="sm"
+ data-intro-play=""
+ onClick={() => {
+ if (playing) setPlaying(false);
+ else {
+ if (t >= seconds - 0.05) setT(0);
+ setPlaying(true);
+ }
+ }}
+ >
+ {playing ? "Pause" : t >= seconds - 0.05 ? "Play again" : "Play"}
+ </Button>
+ <input
+ type="range"
+ aria-label="intro time"
+ data-intro-scrub=""
+ min={0}
+ max={seconds}
+ step={0.01}
+ value={at}
+ onChange={(e) => {
+ setPlaying(false);
+ setT(Number(e.target.value));
+ }}
+ className="min-w-0 flex-1"
+ />
+ <span className="num font-mono text-[11.5px] text-muted">
+ {at.toFixed(2)} / {seconds.toFixed(2)} s{composing ? " · composing…" : ""}
+ </span>
+ </div>
+ )}
+ </div>
+ );
+}
diff --git a/umtool/components/projects/review/IntroCardPlayer.tsx b/umtool/components/projects/review/IntroCardPlayer.tsx
@@ -0,0 +1,131 @@
+"use client";
+
+import { useEffect, useRef, useState } from "react";
+
+// THE INTRO on a stage (lane intro-play; operator, 8 Nov 2026: "more first-class intro support (view in play the
+// cut)"): the page the build renders (report-to-video intro.mjs introPageHtml, composed for preview by POST
+// /api/report/chrome/intro) full frame, seeked to `s`, the seconds into the intro -- TeaserCardPlayer's handshake:
+// the page says `intro:ready` once its words are fitted, and nothing is sent before it. Its SOUND (the boot build and
+// the chime the mark lands on: the stand-in, or render.intro.sound) plays beside it while `playing` and `sound` are
+// on, slaved to `s` as a video entry's element is (re-seeked past a drift). Used by Play, Present and the Cut tab's
+// intro editor.
+
+export type IntroPage = {
+ id: string;
+ style: string;
+ seconds: number;
+ width: number;
+ height: number;
+ src: string;
+ /** The intro's sound (GET /api/report/chrome/intro?sound=1…), or null: a silent intro. */
+ sound: string | null;
+ title?: string;
+ lines?: string[];
+};
+
+/** How far the sound may drift from the clock before it is re-seeked, seconds. */
+const DRIFT = 0.25;
+
+export default function IntroCardPlayer({
+ page,
+ s,
+ playing = false,
+ sound = true,
+ speed = 1,
+ testid = "play-intro",
+}: {
+ page: IntroPage;
+ s: number;
+ /** The clock is running (and inside the intro). */
+ playing?: boolean;
+ /** Its sound plays while playing (Present's "sound" setting; Play's always). */
+ sound?: boolean;
+ speed?: number;
+ testid?: string;
+}) {
+ const box = useRef<HTMLDivElement | null>(null);
+ const el = useRef<HTMLIFrameElement | null>(null);
+ const audio = useRef<HTMLAudioElement | null>(null);
+ const [width, setWidth] = useState(0);
+ const [readySrc, setReadySrc] = useState<string | null>(null);
+ const src = `${page.src}${page.src.includes("?") ? "&" : "?"}preview=1`;
+
+ useEffect(() => {
+ const node = box.current;
+ if (!node) return;
+ const ro = new ResizeObserver(([e]) => setWidth(e.contentRect.width));
+ ro.observe(node);
+ return () => ro.disconnect();
+ }, []);
+
+ useEffect(() => {
+ const onMsg = (e: MessageEvent) => {
+ if (e.source !== el.current?.contentWindow || e.origin !== window.location.origin) return;
+ if ((e.data as { type?: string } | null)?.type === "intro:ready") setReadySrc(src);
+ };
+ window.addEventListener("message", onMsg);
+ return () => window.removeEventListener("message", onMsg);
+ }, [src]);
+
+ const live = readySrc === src;
+ // Clamped into the intro: past its end it holds its last frame (the ground).
+ const at = Math.max(0, Math.min(page.seconds, s));
+ useEffect(() => {
+ if (live) el.current?.contentWindow?.postMessage({ type: "deck:seek", t: at }, window.location.origin);
+ }, [live, at]);
+
+ // The sound, slaved to the clock: playing only while the clock runs inside the intro.
+ const run = playing && sound && !!page.sound && s >= 0 && s < page.seconds;
+ useEffect(() => {
+ const a = audio.current;
+ if (!a) return;
+ const want = Number.isFinite(speed) && speed > 0 ? speed : 1;
+ if (Math.abs(a.playbackRate - want) > 1e-3) a.playbackRate = want;
+ if (run) {
+ if (Math.abs(a.currentTime - at) > DRIFT * Math.max(1, want)) {
+ try {
+ a.currentTime = at;
+ } catch {
+ // not seekable yet: the next tick tries again
+ }
+ }
+ if (a.paused) void a.play().catch(() => {});
+ } else if (!a.paused) a.pause();
+ }, [run, at, speed]);
+
+ const scale = width > 0 ? width / page.width : 0;
+ return (
+ <div
+ ref={box}
+ data-testid={testid}
+ data-play-intro={page.id}
+ data-play-intro-style={page.style}
+ data-play-intro-ready={live ? "1" : "0"}
+ data-play-intro-at={at.toFixed(2)}
+ data-play-intro-sound={!page.sound ? "none" : run ? "playing" : sound ? "on" : "off"}
+ className="pointer-events-none absolute inset-0 overflow-hidden bg-black"
+ >
+ <iframe
+ ref={el}
+ key={src}
+ src={src}
+ title={`intro ${page.style}`}
+ data-testid={`${testid}-iframe`}
+ tabIndex={-1}
+ aria-hidden
+ style={{
+ position: "absolute",
+ left: 0,
+ top: 0,
+ width: page.width,
+ height: page.height,
+ border: 0,
+ transform: `scale(${scale})`,
+ transformOrigin: "0 0",
+ visibility: live ? "visible" : "hidden",
+ }}
+ />
+ {page.sound && <audio ref={audio} src={page.sound} preload="auto" data-play-intro-audio="" />}
+ </div>
+ );
+}
diff --git a/umtool/components/projects/review/PlayCut.tsx b/umtool/components/projects/review/PlayCut.tsx
@@ -35,6 +35,8 @@ import PostItemPlayer, { postItemAssets, type PostPlan } from "./PostItemPlayer"
import SidePostOverlay from "./SidePostOverlay";
import VideoEntryPlayer from "./VideoEntryPlayer";
import TeaserCardPlayer, { type TeaserPage } from "./TeaserCardPlayer";
+import IntroCardPlayer from "./IntroCardPlayer";
+import { useIntroPage } from "./useIntroPage";
import { videoStageAt, type VideoEntryPlay } from "@/lib/report/playVideo.mjs";
import ComboBadge, { type ComboInfo } from "./ComboBadge";
@@ -247,7 +249,7 @@ function approximateLine(edges: RenderCuts, info: EngineInfo | null) {
const picture = !info ? "" : info.picture === "webcodecs" ? "picture: WebCodecs" : info.picture === "mixed" ? "picture: WebCodecs, some clips on <video>" : "picture: <video>";
const silent = info ? Object.keys(info.silent) : [];
return [
- "Approximate: cards are placeholders (a teaser plays the build's own card, silent; a post item plays its card and attachments, its sound from its own element), a push or a wipe is drawn as a dissolve, the chrome is composed on the estimate's clock;",
+ "Approximate: cards are placeholders (the intro plays the build's own page and its sound; a teaser plays the build's own card, silent; a post item plays its card and attachments, its sound from its own element), a push or a wipe is drawn as a dissolve, the chrome is composed on the estimate's clock;",
`${edge};`,
`${sound}${picture ? `; ${picture}` : ""}.`,
silent.length ? `No sound decoded for ${silent.join(", ")}.` : "",
@@ -389,6 +391,8 @@ export default function PlayCut({
// /api/report/chrome/teasers) and laid full frame while it is on screen -- the build's card, not a placeholder.
// Composed again whenever the manifest moved (its token), with or without a deck.
const teaserKey = useMemo(() => view.entries.filter((e) => e.type === "teaser").map((e) => e.id).join("\n"), [view.entries]);
+ // THE INTRO (lane intro-play): its page composed for preview (POST /api/report/chrome/intro), again when the manifest moved.
+ const introPage = useIntroPage(project, take, view.entries.some((e) => e.type === "intro"), view.token);
const [teaserPages, setTeaserPages] = useState<Record<string, TeaserPage | { id: string; error: string }>>({});
useEffect(() => {
if (!teaserKey) {
@@ -926,7 +930,10 @@ export default function PlayCut({
// A teaser plays its own page (TeaserCardPlayer), once composed; until then -- or if it did not compose -- a placeholder.
const teaserPage = item && entry?.type === "teaser" ? teaserPages[item.id] : undefined;
const teaserNow = item && teaserPage && "src" in teaserPage ? { item, page: teaserPage } : null;
- const placeholder = item && !postNow && !videoNow && !teaserNow && (!item.clip || missing || broken) ? { kind: !item.clip ? "card" : "missing", item, entry } : null;
+ // THE INTRO (lane intro-play): the build's own page and its sound (IntroCardPlayer), once composed; until then -- or if
+ // it did not compose -- a placeholder that says so.
+ const introNow = item && entry?.type === "intro" && introPage && "src" in introPage ? { item, page: introPage } : null;
+ const placeholder = item && !postNow && !videoNow && !teaserNow && !introNow && (!item.clip || missing || broken) ? { kind: !item.clip ? "card" : "missing", item, entry } : null;
// The clips' sound fades with the picture into a video entry and is off over it (its element plays its own).
const duck = vstage ? vstage.duck : 1;
useEffect(() => {
@@ -1047,6 +1054,8 @@ export default function PlayCut({
const dipVeil = vstage && vstage.dark > 0 ? <div data-play-dip={vstage.id} className="pointer-events-none absolute inset-0 z-30 bg-black" style={{ opacity: vstage.dark }} /> : null;
// A teaser on screen: its page, seeked to the seconds into the card (the item's own clock, as a post item's).
const teaserCard = teaserNow ? <TeaserCardPlayer key={teaserNow.item.id} page={teaserNow.page} s={t - teaserNow.item.start} /> : null;
+ // The intro on screen: its page seeked to the seconds into it, its sound on Play's clock.
+ const introCard = introNow ? <IntroCardPlayer key={introNow.page.src} page={introNow.page} s={t - introNow.item.start} playing={ui.playing && !ui.waiting} speed={rate} /> : null;
const placeholderCard = placeholder ? (
<div
data-play-placeholder={placeholder.kind}
@@ -1059,7 +1068,15 @@ export default function PlayCut({
<span className="micro text-white/60">{placeholder.item.type}</span>
<span className="max-w-[80%] font-display text-[clamp(15px,2.6vw,32px)] font-semibold text-white">{placeholder.entry?.heading ?? placeholder.item.id}</span>
<span className="text-[11px] text-white/55">
- {teaserPage && "error" in teaserPage ? `the card did not compose: ${teaserPage.error}` : placeholder.item.type === "teaser" ? "composing the card…" : "a placeholder: the build draws it"}
+ {teaserPage && "error" in teaserPage
+ ? `the card did not compose: ${teaserPage.error}`
+ : placeholder.item.type === "teaser"
+ ? "composing the card…"
+ : placeholder.item.type === "intro"
+ ? introPage && "error" in introPage
+ ? `the intro did not compose: ${introPage.error}`
+ : "composing the intro…"
+ : "a placeholder: the build draws it"}
</span>
</>
) : (
@@ -1215,6 +1232,7 @@ export default function PlayCut({
</div>
)}
{teaserCard}
+ {introCard}
{placeholderCard}
{sideNow && rect && <div className="pointer-events-none absolute" style={{ left: pct(rect.x, g.W), top: pct(rect.y, g.H), width: pct(rect.width, g.W), height: pct(rect.height, g.H) }}>{sideNow}</div>}
{doc.feed && <FeedOverlay key={doc.feed.src ?? "none"} feed={doc.feed} frame={g} t={tc} testid="play-feed" />}
@@ -1234,6 +1252,7 @@ export default function PlayCut({
{postNow && <div className="absolute inset-0" style={{ background: bg }}>{postPlayer({ width: 1920, height: 1080 })}{comboBadge({ width: 1920, height: 1080 })}</div>}
{videoUnder}
{teaserCard}
+ {introCard}
{placeholderCard}
{sideNow}
</div>
diff --git a/umtool/components/projects/review/useIntroPage.ts b/umtool/components/projects/review/useIntroPage.ts
@@ -0,0 +1,39 @@
+"use client";
+
+import { useEffect, useState } from "react";
+import type { IntroPage } from "./IntroCardPlayer";
+
+// The cut's INTRO page for a stage (Play's): composed by POST /api/report/chrome/intro -- the build's own page, Play's
+// seek appended -- again whenever the manifest moved (`token`), for the project's cut or a take's. Null while there
+// is no intro (or before it composed); `{ error }` when it did not compose, said where the placeholder stands.
+
+export type IntroPageState = IntroPage | { error: string } | null;
+
+export function useIntroPage(project: string, take: string | null, hasIntro: boolean, token: string | null | undefined): IntroPageState {
+ const [page, setPage] = useState<IntroPageState>(null);
+ useEffect(() => {
+ if (!hasIntro) {
+ setPage(null);
+ return;
+ }
+ let live = true;
+ void (async () => {
+ try {
+ const r = await fetch("/api/report/chrome/intro", {
+ method: "POST",
+ headers: { "content-type": "application/json" },
+ body: JSON.stringify({ project, ...(take ? { take } : {}) }),
+ });
+ const j = (await r.json().catch(() => ({}))) as { intro?: IntroPage | null; error?: string };
+ if (!live) return;
+ setPage(!r.ok ? { error: String(j.error ?? `HTTP ${r.status}`) } : (j.intro ?? null));
+ } catch (e) {
+ if (live) setPage({ error: e instanceof Error ? e.message : String(e) });
+ }
+ })();
+ return () => {
+ live = false;
+ };
+ }, [project, take, hasIntro, token]);
+ return page;
+}
diff --git a/umtool/lib/report/present.mjs b/umtool/lib/report/present.mjs
@@ -15,6 +15,8 @@
// would apply, by kind, so the viewer can show what it hides and toggle it;
// - a CLIP slide per clip the walk did not reject: the spans it plays (its cut minus its gaps) from the cached
// window Play plays, the deck's title, source line and QR link, its quote and its picture's blur;
+// - the INTRO (render.intro) as the first slide, before any divider: its style, length and words -- the viewer plays
+// the build's own page (POST /api/report/chrome/intro) and its sound;
// - a TEASER slide (its lines), and any other entry as a text slide (its heading);
// - SECTION divider slides where the cut's markers open a section -- or, when the cut is a chronological reel of
// posts with no markers, a DAY divider per calendar day in the posts' clock zone (post-clock.mjs).
@@ -287,7 +289,8 @@ export function presentFrom({ view, manifest, red, canUncensor = true }) {
const model = sectionModel(manifest);
const indexOf = new Map(timeline.map((e, i) => [e.id, i]));
const marked = model.placed.length > 0;
- const days = !marked && isPostReel(played);
+ // (The intro is not a post: a posts reel that opens on one is still a posts reel.)
+ const days = !marked && isPostReel(played.filter((e) => e.type !== "intro"));
/** @type {Array<{ id: string, kind: "section"|"day"|"cut", label: string, date?: string, level?: number, color?: string | null }>} */
const sections = [];
const sectionIdOf = (e) => {
@@ -305,7 +308,19 @@ export function presentFrom({ view, manifest, red, canUncensor = true }) {
return out;
};
let lastSection = null;
+ // THE INTRO opens the deck, before the first divider, in the first section's band of the outline.
+ const firstReal = played.find((e) => e.type !== "intro");
for (const e of played) {
+ if (e.type === "intro") {
+ const src = byId.get(e.id) ?? {};
+ slides.push({
+ id: unique(e.id), kind: "intro", section: firstReal ? sectionIdOf(firstReal) : "cut", entry: e.id, label: "Intro", date: null, dateLabel: null,
+ style: str(src.style), seconds: fin(src.seconds) ? src.seconds : null,
+ ...(typeof src.title === "string" ? { title: src.title } : {}),
+ ...(Array.isArray(src.lines) ? { lines: src.lines.filter((l) => typeof l === "string") } : {}),
+ });
+ continue;
+ }
const sec = sectionIdOf(e);
if (sec !== lastSection) {
lastSection = sec;
diff --git a/umtool/lib/report/present.test.mjs b/umtool/lib/report/present.test.mjs
@@ -215,3 +215,27 @@ test("umtool present: the address, the slides, --json the payload, --public cens
assert.equal(presentPath("a/b c", { take: "t1", slide: "subj-x/1" }), "/projects/a/b%20c/present?take=t1#subj-x/1");
assert.equal(presentPath("a", { bare: true }), "/projects/a/present?cut=1");
});
+
+test("the intro (render.intro) is the first slide, before any divider, in the first section's band; its words ride along", async () => {
+ const p = await project("intro-mixed", MIXED, { ...MIXED_RENDER, intro: { style: "title-card", lines: ["29 October 2026"] } });
+ const pl = await presentPayload(p);
+ assert.deepEqual(
+ pl.slides.map((s) => [s.kind, s.id]).slice(0, 3),
+ [["intro", "brand-intro"], ["section", "section-0"], ["clip", "c01"]],
+ );
+ const intro = pl.slides[0];
+ assert.equal(intro.section, "section-0");
+ assert.equal(intro.style, "title-card");
+ assert.equal(intro.title, "The intro-mixed cut", "title-card: the project's title");
+ assert.deepEqual(intro.lines, ["29 October 2026"]);
+ assert.equal(intro.seconds, 4.18);
+ assert.equal(intro.label, "Intro");
+ // A chronological posts reel that opens on an intro is still a posts reel: the intro, then its days.
+ const reel = await project("intro-reel", [post("1"), post("2", { date: "2026-10-31T10:00:00.000Z" })], { intro: "boot-dark" });
+ const r = await presentPayload(reel);
+ assert.deepEqual(r.slides.map((s) => s.kind), ["intro", "day", "post", "day", "post"]);
+ assert.equal(r.slides[0].section, "day-2026-10-30");
+ // No render.intro, no intro slide.
+ const none = await presentPayload(await project("intro-none", MIXED, MIXED_RENDER));
+ assert.ok(!none.slides.some((s) => s.kind === "intro"));
+});
diff --git a/umtool/lib/report/walkCli.mjs b/umtool/lib/report/walkCli.mjs
@@ -58,6 +58,11 @@ export async function walkCommand(args, { root = REPORTS_ROOT, out = (s) => cons
out(`${project.id} · ${what} · ${w.total} clip(s) · ${hms(w.seconds)} · ${w.reviewed} reviewed · ${w.needing} need a verdict, ${w.ready} of them fetched`);
if (w.note) out(` ${w.note}`);
const idW = Math.max(2, ...w.clips.map((c) => c.id.length));
+ // The intro first: watched, not judged (Play the cut, or the Cut tab's intro editor).
+ if (w.intro) {
+ const words = [w.intro.title, ...w.intro.lines].filter(Boolean).map((x) => `"${x}"`).join(" / ");
+ out(` 0 ${w.intro.id.padEnd(idW)} intro · ${w.intro.style} · ${w.intro.seconds}s${words ? ` · ${words}` : ""} (watch it in Play; umtool intro ${project.id})`);
+ }
for (const c of w.clips) {
const win = `${hms(c.start)}–${hms(c.end)}`;
const cut = c.cutStart != null ? ` cut ${hms(c.cutStart)}–${hms(c.cutEnd)}` : "";
diff --git a/umtool/lib/report/walkData.mjs b/umtool/lib/report/walkData.mjs
@@ -15,6 +15,9 @@
// of the clip they were cut from, and "watch the tight version through" is a
// walk of all of them.
//
+// THE INTRO (lane intro-play): a cut that opens on a brand intro (render.intro) lists it FIRST -- `intro`, the
+// walk's first stop (`stops`), watched in Play (it has no verdict to give, so `p`/`n` and `first` stay on clips).
+//
// Plain ESM: `umtool walk` runs it under bare node.
import { clipVerdict, readClipDetail, readManifest, walkOrder, walkReadiness } from "../projects/report.mjs";
import { rejectionOf } from "./rejectReasons.mjs";
@@ -74,6 +77,26 @@ export function walkNeighbours(order, onWalk, clipId) {
}
/**
+ * The intro a cut opens on, as the walk lists it: its id, style, length and words -- or null (none, or one the
+ * build would refuse, which the check says). Read through the build's own entry (introEntry), so a title-card's
+ * words are the project's title and date.
+ *
+ * @param {Record<string, any>} manifest
+ * @returns {Promise<null | { id: string, style: string, seconds: number, title: string | null, lines: string[] }>}
+ */
+export async function walkIntroOf(manifest) {
+ if (manifest?.render?.intro === undefined || manifest?.render?.intro === null) return null;
+ try {
+ const { introEntry } = await import("umtool-report-to-video/intro");
+ const e = introEntry(manifest.render, { provenance: manifest.provenance ?? null, manifest });
+ if (!e) return null;
+ return { id: e.id, style: e.style, seconds: e.seconds, title: typeof e.title === "string" ? e.title : null, lines: Array.isArray(e.lines) ? e.lines : [] };
+ } catch {
+ return null;
+ }
+}
+
+/**
* @typedef {{
* id: string, cut: number | null, channel: string | null, video: string, start: number, end: number,
* seconds: number, cutStart: number | null, cutEnd: number | null,
@@ -124,6 +147,7 @@ export async function walkOf(project, { take = null, all = false } = {}) {
}));
const order = clips.map((c) => c.id);
const first = order.find((id) => onWalk.has(id)) ?? null;
+ const intro = await walkIntroOf(base.manifest);
const reviewed = clips.filter((c) => c.verdict !== "unreviewed").length;
return {
project: project.id,
@@ -137,6 +161,10 @@ export async function walkOf(project, { take = null, all = false } = {}) {
order,
onWalk,
first,
+ /** The intro the cut opens on, listed first (null: none). */
+ intro,
+ /** What the walk lists, in order: the intro (when there is one), then the clips in walk order. */
+ stops: [...(intro ? [intro.id] : []), ...order],
/** Clips that need an answer, and how many of them can be judged today (fetched). */
needing: readiness.needing,
ready: readiness.ready,