commit 6a0467477a555e6d05e71de89849fa9958b59a2a parent 34cebdc294a72932380fe3e8f55be50fd29e1b61 Author: I Mean I'm Just Saying <imeanimjustsaying@kiwifarms.st> Date: Mon, 9 Nov 2026 17:51:34 -0500 umtool: retire the UI's take-patch writes -- the take walk and take-only benches open in the draft (L3 S4) Nothing in the UI writes a take's patch any more; every edit lands in the draft. Removed: Play's ownTimeline / take-bench Edit and ?inTake post links, Add a clip's "this take only" (AddClip and its toggle insert into the draft alone), the post bench's "edits go to: take <t> only" scope (inTake.tsx and its six users), the take walk page and its strip (TakeWalkPage, TakeWalkStrip). The old addresses -- /projects/<p>/takes/<t>/walk and .../takes/<t>/clip/<id> -- are the Open in draft page: it asks, saves the draft first, copies the take in (a legacy own-timeline take by its patch over the draft), then the DRAFT's bench; the draft's parent with no edits is a 308 straight on. "Walk" becomes "Play / Open in draft" on the take card (TakeActions), the Cut tab's versions row, New take's "draft recorded" line and New draft from this take. Add items from another project reads the take's entries through Play's view. The take-scope routes and the CLI (--in-take, umtool timeline/window --take, /api/report/takes/timeline) stay for agents. grep -rn "inTake\|takeClipHref\|/api/report/takes/timeline" umtool/components returns nothing. e2e: take-walk (the old addresses ask / 308; the walk's data route still reads the take; take-walk-fixture gains a saved version v1 and the draft pointer), play-take-edit (the old take bench asks; Cancel plays the take), post-items and post-narration (an old ?inTake= address is the draft's bench), intro-play (a version's old walk address asks). Docs: clip-bench.md, knobs.md, report-video.md. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Diffstat:
28 files changed, 221 insertions(+), 757 deletions(-)
diff --git a/umtool/components/projects/AddClip.tsx b/umtool/components/projects/AddClip.tsx @@ -18,13 +18,13 @@ import { announceManifestChanged, refusalOf, timelineOp, type TimelineResult } f // to end there; nudge ±0.5 s; the quote is read from the cues // 3 Place after <row> -- by default where the clip's date falls when the // cut is in date order, else after the row it was opened from -// 4 Add the timeline's own insert (the project's, or with `take` the -// take's patch only: "add to this take only"), then the clip's +// 4 Add the timeline's own insert -- the draft's (L3: a take is a +// frozen version; "add to this take only" is retired), then the clip's // window fetched through the editor's paced fetch // (POST /api/report/fetch) -- never yt-dlp by hand // // Opened from the Cut tab, from Play at the playhead's item ("Add a clip -// here") and from a take. The old one-line spec form stays as the Cut +// here"). The old one-line spec form stays as the Cut // tab's "Add by spec". // --------------------------------------------------------------------------- @@ -91,15 +91,12 @@ export function dateOrderAfter(entries: Entry[], date: string | null): string | export default function AddClip({ project, - take = null, after: afterProp = null, onClose, onAdded, className, }: { project: string; - /** "Add to this take only": the take's patch, never the project's manifest. */ - take?: string | null; /** The row it was opened from (Play's playhead item): the default place when the cut is not in date order. */ after?: string | null; onClose?: () => void; @@ -135,9 +132,7 @@ export default function AddClip({ }, [cues]); const loadEntries = useCallback(async () => { - const url = take - ? `/api/report/takes/timeline?project=${encodeURIComponent(project)}&take=${encodeURIComponent(take)}` - : `/api/report/timeline?project=${encodeURIComponent(project)}`; + const url = `/api/report/timeline?project=${encodeURIComponent(project)}`; const r = await fetch(url, { cache: "no-store" }); const j = await r.json().catch(() => ({})); if (!r.ok) { @@ -147,7 +142,7 @@ export default function AddClip({ setEntries(Array.isArray(j.timeline) ? j.timeline : []); setToken(typeof j.token === "string" ? j.token : null); return j as { token?: string }; - }, [project, take]); + }, [project]); useEffect(() => { void loadEntries(); }, [loadEntries]); @@ -269,17 +264,7 @@ export default function AddClip({ setError(null); const entry: Record<string, unknown> = newClipEntry({ video: moment.video, ownChannel: moment.channel }, { start, end, quote }); if (moment.date) entry.date = moment.date; - let res: TimelineResult; - if (take) { - const r = await fetch("/api/report/takes/timeline", { - method: "POST", - headers: { "content-type": "application/json" }, - body: JSON.stringify({ project, take, token, op: "insert", afterId: after || null, entry }), - }); - res = { ok: r.ok, status: r.status, json: await r.json().catch(() => ({ error: `HTTP ${r.status}` })) }; - } else { - res = await timelineOp(project, token ?? ((await loadEntries())?.token ?? null), "insert", { afterId: after || null, entry }); - } + const res: TimelineResult = await timelineOp(project, token ?? ((await loadEntries())?.token ?? null), "insert", { afterId: after || null, entry }); setBusy(false); if (!res.ok) { setError(refusalOf(res)); @@ -288,7 +273,7 @@ export default function AddClip({ } const id = typeof res.json.id === "string" ? res.json.id : null; setAdded(id); - if (!take) announceManifestChanged(project); + announceManifestChanged(project); await loadEntries(); router.refresh(); if (id) { @@ -302,7 +287,7 @@ export default function AddClip({ const r = await fetch("/api/report/fetch", { method: "POST", headers: { "content-type": "application/json" }, - body: JSON.stringify({ project, clip: id, padBefore: 20, padAfter: 20, ...(take ? { take } : {}) }), + body: JSON.stringify({ project, clip: id, padBefore: 20, padAfter: 20 }), }); const j = (await r.json().catch(() => ({}))) as { error?: string; job?: { id: string }; cachedBefore?: number; cachedPad?: number }; if (r.status === 409 && (j.cachedBefore !== undefined || j.cachedPad !== undefined)) return setFetchState({ state: "done", msg: "already fetched" }); @@ -337,9 +322,9 @@ export default function AddClip({ const nudge = (which: "in" | "out", d: number) => (which === "in" ? setStart((s) => (s === null ? s : r2(Math.max(0, s + d)))) : setEnd((s) => (s === null ? s : r2(s + d)))); return ( - <section data-add-clip={take ?? "cut"} className={cn("space-y-2 rounded border border-seam bg-panel p-3 text-[12px]", className)}> + <section data-add-clip="cut" className={cn("space-y-2 rounded border border-seam bg-panel p-3 text-[12px]", className)}> <div className="flex flex-wrap items-center gap-2"> - <h2 className="micro m-0">{take ? `Add a clip to take ${take} only` : "Add a clip"}</h2> + <h2 className="micro m-0">Add a clip</h2> <span className="text-muted">1 find · 2 in/out · 3 place · 4 add</span> {onClose && ( <button type="button" data-add-clip-close="" onClick={onClose} className={cn(buttonVariants({ variant: "quiet", size: "sm" }), "ml-auto")}> @@ -480,7 +465,7 @@ export default function AddClip({ </label> {placeWhy && <span className="text-muted" data-add-clip-place-why="">{placeWhy}</span>} <button type="button" data-add-clip-submit="" disabled={busy || !valid} onClick={() => void add()} className={buttonVariants({ variant: "go", size: "sm" })}> - {take ? `Add to ${take} only` : "Add to the cut"} + Add to the cut </button> </div> </div> @@ -494,8 +479,7 @@ export default function AddClip({ {added && ( <p className="m-0 flex flex-wrap items-center gap-2 text-text-2" data-add-clip-added={added} data-add-clip-fetch={fetchState.state}> <span> - Added <b className="font-mono">{added}</b> - {take ? ` to take ${take}` : ""}. + Added <b className="font-mono">{added}</b>. </span> {fetchState.state !== "idle" && <span className={fetchState.state === "failed" ? "text-reject-text" : "text-muted"}>{fetchState.msg}</span>} {fetchState.state === "failed" && ( @@ -512,7 +496,6 @@ export default function AddClip({ /** "+ Add a clip": the button and, pressed, the panel (open from the start with `open`, e.g. the head's `?add=1`). */ export function AddClipToggle({ project, - take = null, after = null, open: initiallyOpen = false, label, @@ -521,7 +504,6 @@ export function AddClipToggle({ className, }: { project: string; - take?: string | null; after?: string | null; onAdded?: (id: string) => void; open?: boolean; @@ -534,9 +516,9 @@ export function AddClipToggle({ return ( <> <button type="button" data-add-clip-open={where} aria-expanded={open} onClick={() => setOpen((o) => !o)} className={cn(buttonVariants({ variant: open ? "pressed" : "outline", size: "sm" }), className)}> - {label ?? (take ? `+ Add a clip to ${take} only` : "+ Add a clip")} + {label ?? "+ Add a clip"} </button> - {open && <AddClip project={project} take={take} after={after} onAdded={onAdded} onClose={() => setOpen(false)} className="basis-full" />} + {open && <AddClip project={project} after={after} onAdded={onAdded} onClose={() => setOpen(false)} className="basis-full" />} </> ); } diff --git a/umtool/components/projects/ClipBench.tsx b/umtool/components/projects/ClipBench.tsx @@ -25,7 +25,6 @@ import { ClipExportButtons, ClipExportStatus, useClipExport } from "./ClipExport import EdgeStrip from "./bench/EdgeStrip"; import RenderGhosts, { useRenderEdges } from "./bench/RenderGhosts"; import { ZoomControls, ZoomOverview, ZoomRuler, useWaveZoom, type Span } from "./bench/GapsZoom"; -import TakeWalkStrip from "./bench/TakeWalkStrip"; import { TightenButtons, useEdgeTools, type BenchWord } from "./bench/TightenTools"; // The renderer's own line, imported rather than re-written. A preview that // disagrees with the header by a character is worth less than no preview: you @@ -2967,19 +2966,7 @@ export default function ClipBench({ <GeneratedBanner generatedBy={data.generatedBy} /> </div> )} - {/* Walking a take: what is being walked, where the edits go, and the take's own structure. */} - {data.take && ( - <TakeWalkStrip - className="max-md:order-[22]" - project={data.project} - take={data.take} - clipId={clip.id} - index={data.take.at} - total={data.take.entries} - nextHref={hrefOf("next")} - getToken={() => token.current} - /> - )} + {/* A take's clip is never benched from the UI now (L3: Open in draft first); `umtool window --take` edits one. */} {/* ---- where you are, where you can go, and what will be burned in ---- */} <div className="flex flex-wrap items-center gap-x-3 gap-y-1 text-[11px] max-md:contents"> {/* On a phone both counts are the place bar's `50/51` and its hairline. */} diff --git a/umtool/components/projects/NewTakePanel.tsx b/umtool/components/projects/NewTakePanel.tsx @@ -3,7 +3,7 @@ import { useCallback, useEffect, useRef, useState } from "react"; import { useRouter } from "next/navigation"; import { buttonVariants } from "@/components/ui/button"; -import { takeWalkHref } from "@/lib/hrefs"; +import { openInDraftHref, playHref } from "@/lib/hrefs"; import { Field, Input, Select, Textarea } from "@/components/ui/field"; import { JobProgress, type JobStepState } from "@/components/ui/job-progress"; import RenderModeBanner, { renderPriorityPref } from "./RenderModeBanner"; @@ -314,7 +314,7 @@ export default function NewTakePanel({ data-action="save-draft" disabled={!ready || busy || running || !label.trim() || !!patchError || windowBad} className={buttonVariants({ variant: "quiet", size: "sm" })} - title={`umtool take ${project} --id <label> --label … --draft: recorded, nothing rendered — walk it, then render it`} + title={`umtool take ${project} --id <label> --label … --draft: recorded, nothing rendered — play it, open it in the draft, render it`} onClick={() => void saveDraft()} > Save as a draft @@ -342,8 +342,12 @@ export default function NewTakePanel({ {drafted && ( <p data-take-drafted-new={drafted} className="text-[12px] text-text-2"> draft <b className="font-mono">{drafted}</b> recorded, nothing rendered:{" "} - <a href={takeWalkHref(project, drafted)} className="ink-link"> - walk it + <a href={playHref(project, { take: drafted })} className="ink-link"> + play it + </a>{" "} + ·{" "} + <a href={openInDraftHref(project, drafted)} className="ink-link"> + open in draft </a> </p> )} diff --git a/umtool/components/projects/PostAttachmentLane.tsx b/umtool/components/projects/PostAttachmentLane.tsx @@ -14,7 +14,7 @@ import type { PostPlan } from "./review/PostItemPlayer"; // as the waveform's two handles, the part the item plays dashed, and the playhead. // // The handles move `media[i].start` / `.end` as the number fields do (the bench's -// draft, saved by its Save -- the take's patch on ?inTake=), never closer than +// draft, saved by its Save), never closer than // POST_MEDIA_MIN_SPAN and never past the file. While a handle moves, the bench's // clock follows the edge, so the player shows its frame. Keys, with the lane // focused: [ ] the in, , . the out (0.05 s; Shift 0.5 s, the clip bench's), and diff --git a/umtool/components/projects/PostBench.tsx b/umtool/components/projects/PostBench.tsx @@ -1,6 +1,5 @@ "use client"; -import { inTakeBody, useInTake } from "./inTake"; import Link from "next/link"; import { useRouter } from "next/navigation"; import { useCallback, useEffect, useMemo, useRef, useState } from "react"; @@ -113,7 +112,6 @@ export default function PostBench({ /** The posts its conversation's run leaves on screen (post-conversation.mjs planContext): kept on top or collapsed away. It wins the card over a media scene. */ conversation?: Record<string, unknown> | null; }) { - const inTake = useInTake(); const router = useRouter(); const [entry, setEntry] = useState<Entry>(initial); const [saved, setSaved] = useState<Entry>(initial); @@ -243,7 +241,7 @@ export default function PostBench({ const res = await fetch("/api/report/post-item", { method: "POST", headers: { "content-type": "application/json" }, - body: JSON.stringify({ project, op: "set", id: entry.id, patch: patchOf(entry), token, ...inTakeBody(inTake) }), + body: JSON.stringify({ project, op: "set", id: entry.id, patch: patchOf(entry), token }), }); const j = (await res.json().catch(() => ({}))) as { entry?: Entry; token?: string; error?: string; errors?: string[] }; if (!res.ok || !j.entry) { @@ -263,7 +261,7 @@ export default function PostBench({ const [jobs, setJobs] = useState<Record<number, { job: string; state: string; error?: string }>>({}); const transcribe = async (i: number) => { setError(null); - const res = await fetch("/api/report/post-item", { method: "POST", headers: { "content-type": "application/json" }, body: JSON.stringify({ project, op: "transcribe", id: entry.id, media: i, ...inTakeBody(inTake) }) }); + const res = await fetch("/api/report/post-item", { method: "POST", headers: { "content-type": "application/json" }, body: JSON.stringify({ project, op: "transcribe", id: entry.id, media: i }) }); const j = (await res.json().catch(() => ({}))) as { jobId?: string; error?: string }; if (!res.ok || !j.jobId) { setJobs((x) => ({ ...x, [i]: { job: "", state: "failed", error: j.error ?? `HTTP ${res.status}` } })); diff --git a/umtool/components/projects/PostBenchPage.tsx b/umtool/components/projects/PostBenchPage.tsx @@ -5,11 +5,6 @@ import { channelsDirFor, readManifest } from "@/lib/projects/report.mjs"; import { manifestToken } from "@/lib/report/manifest.mjs"; import { projectHref, playHref } from "@/lib/hrefs"; import PlayLink from "./PlayLink"; -import Link from "next/link"; -import { InTakeProvider } from "./inTake"; -import { postBenchHref } from "@/lib/hrefs"; -import { withTakeScope } from "@/lib/report/takeScope.mjs"; -import { isTakeId, listTakes } from "@/lib/report/takes.mjs"; import { deckGeometry, deckOn, feedGeometry, feedOn } from "umtool-report-to-video/deck"; import { postItemPlan, panelEntry } from "umtool-report-to-video/post-item"; import { planContext } from "umtool-report-to-video/post-conversation"; @@ -26,21 +21,14 @@ import type { ComboInfo } from "./review/ComboBadge"; // words through the editor's transcription. Every save is updatePostItem // (POST /api/report/post-item {op: "set"}), the writer `umtool posts set-item` runs. -// "EDIT THIS TAKE ONLY" (lane/ui-simplify): `?inTake=<take>` reads the item as the take has it and scopes every -// write of the bench to the take's patch (takeScope.mjs, the CLI's `--in-take`); the project's cut is untouched. +// THE BENCH EDITS THE DRAFT (umtool redesign L3): every save lands in the project's manifest. The take-only +// scope (lane/ui-simplify's "edit this take only" query) is retired from the page -- an old address with it is +// the draft's bench -- and stays for agents as the CLI's `--in-take`. export default async function PostBenchPage({ project, id, search = {} }: { project: ProjectRef; id: string; search?: Record<string, string | undefined> }) { - const inTake = search.inTake && isTakeId(search.inTake) ? search.inTake : null; - const takes = ((await listTakes(project.dir)).takes as { id: string; builtAt?: string | null; draft?: boolean }[]) - .filter((t) => t.builtAt || t.draft) - .sort((a, b) => String(b.builtAt ?? "").localeCompare(String(a.builtAt ?? ""))) - .slice(0, 6) - .map((t) => t.id); - if (inTake && !takes.includes(inTake)) takes.unshift(inTake); - const body = () => postBenchBody({ project, id, search, inTake, takes }); - return inTake ? withTakeScope(project.dir, inTake, body) : body(); + return postBenchBody({ project, id, search }); } -async function postBenchBody({ project, id, search, inTake, takes }: { project: ProjectRef; id: string; search: Record<string, string | undefined>; inTake: string | null; takes: string[] }) { +async function postBenchBody({ project, id, search }: { project: ProjectRef; id: string; search: Record<string, string | undefined> }) { const m = (await readManifest(project.dir)) as Record<string, unknown> | null; if (!m) notFound(); const tl = (Array.isArray(m.timeline) ? m.timeline : []) as Array<Record<string, unknown> & { id: string; type?: string }>; @@ -62,30 +50,21 @@ async function postBenchBody({ project, id, search, inTake, takes }: { project: const combo = combos[id] ?? null; // Its media scene (post-media-scene.mjs): its neighbours with the same attachment, by the combo's groups. const scene = mediaSceneOf(tl, at, counted.groups, render); - const back = fromPlay ? playHref(project.id, { take: inTake, clip: id, at: Number(search.at ?? 0) || null }) : projectHref(project.id, { tab: "cut" }); + const back = fromPlay ? playHref(project.id, { clip: id, at: Number(search.at ?? 0) || null }) : projectHref(project.id, { tab: "cut" }); return ( <div className="flex h-full flex-col"> <AppShell active="projects" crumbs={[{ href: "/projects", label: "Projects" }, { href: projectHref(project.id), label: project.name }, { label: `post ${id}` }]} note={`post item ${k + 1} of ${neighbours.length} · ${String(entry.post ?? "")}`} - actions={<PlayLink project={project.id} take={inTake} clip={id} where="post-bench" variant="header" label="▶ Play from here" />} + actions={<PlayLink project={project.id} clip={id} where="post-bench" variant="header" label="▶ Play from here" />} /> <main className="deck-main flex-1 overflow-auto p-4"> - {/* Where the bench's edits go: the cut, or one take only. */} - <p className="mb-2 flex flex-wrap items-center gap-2 text-[12px]" data-post-bench-scope={inTake ?? "cut"}> + {/* Where the bench's edits go: the draft. */} + <p className="mb-2 flex flex-wrap items-center gap-2 text-[12px]" data-post-bench-scope="cut"> <span className="micro">edits go to</span> - <Link href={postBenchHref(project.id, id)} aria-current={!inTake ? "page" : undefined} className={!inTake ? "font-medium text-text" : "ink-link"} data-post-bench-scope-link=""> - the cut - </Link> - {takes.map((t) => ( - <Link key={t} href={`${postBenchHref(project.id, id)}?inTake=${encodeURIComponent(t)}`} aria-current={inTake === t ? "page" : undefined} className={inTake === t ? "font-medium text-text" : "ink-link"} data-post-bench-scope-link={t}> - take {t} only - </Link> - ))} - {inTake && <span className="text-doubt-text">editing take {inTake} only — the cut and its other takes are untouched; reads are re-made on the cut's bench</span>} + <span className="font-medium text-text">the draft</span> </p> - <InTakeProvider take={inTake}> <PostBench project={project.id} entry={entry} @@ -102,7 +81,6 @@ async function postBenchBody({ project, id, search, inTake, takes }: { project: next={k < neighbours.length - 1 ? neighbours[k + 1] : null} fromPlay={fromPlay} /> - </InTakeProvider> </main> </div> ); diff --git a/umtool/components/projects/PostComboPanel.tsx b/umtool/components/projects/PostComboPanel.tsx @@ -1,6 +1,5 @@ "use client"; -import { inTakeBody, useInTake } from "./inTake"; import Link from "next/link"; import { useState } from "react"; import { postBenchHref } from "@/lib/hrefs"; @@ -29,7 +28,6 @@ export default function PostComboPanel({ render: Record<string, unknown>; onEntry: (entry: Record<string, unknown> & { id: string }, token: string | null) => void; }) { - const inTake = useInTake(); const [error, setError] = useState<string | null>(null); const [busy, setBusy] = useState(false); // The box follows the click at once; the write's answer settles it (a refusal puts it back). @@ -44,7 +42,7 @@ export default function PostComboPanel({ const res = await fetch("/api/report/post-combo", { method: "POST", headers: { "content-type": "application/json" }, - body: JSON.stringify({ project, op: "set", id: entry.id, combo: on ? null : false, token, ...inTakeBody(inTake) }), + body: JSON.stringify({ project, op: "set", id: entry.id, combo: on ? null : false, token }), }); const j = (await res.json().catch(() => ({}))) as { entry?: Record<string, unknown> & { id: string }; token?: string; error?: string; errors?: string[] }; setBusy(false); diff --git a/umtool/components/projects/PostNarrationPanel.tsx b/umtool/components/projects/PostNarrationPanel.tsx @@ -1,7 +1,6 @@ "use client"; import { Options } from "@/components/ui/disclosure"; -import { inTakeBody, useInTake } from "./inTake"; import Link from "next/link"; import { useCallback, useEffect, useMemo, useRef, useState } from "react"; import Waveform from "@/components/Waveform"; @@ -25,8 +24,7 @@ import PostAttachmentLane from "./PostAttachmentLane"; // handles, PostAttachmentLane: the bench's draft, as its number // fields; Re-pick best: posts fit's scan), and the read on the // item's clock -- the take's waveform from its lead (drag it), -// the muffle under it, the ramp back to clean. On the take-only -// bench (?inTake) too, every write the take's +// the muffle under it, the ramp back to clean // record THE RECORDING SESSION (operator, 2 Nov: "I think I'll record my // voice"): the mic, a level meter, a 3-2-1 count-in, the script as // a teleprompter PART BY PART (Record / Stop / Redo part / Next @@ -67,7 +65,6 @@ export default function PostNarrationPanel({ next: string | null; fromPlay: boolean; }) { - const inTake = useInTake(); const n = entry.narration ?? {}; const takes = n.takes ?? []; const picked = pickedTake(entry) as (Take & { index: number }) | null; @@ -82,7 +79,7 @@ export default function PostNarrationPanel({ const post = useCallback( async (body: Record<string, unknown>) => { setError(null); - const res = await fetch("/api/report/post-narration", { method: "POST", headers: { "content-type": "application/json" }, body: JSON.stringify({ project, id: entry.id, token, ...body, ...inTakeBody(inTake) }) }); + const res = await fetch("/api/report/post-narration", { method: "POST", headers: { "content-type": "application/json" }, body: JSON.stringify({ project, id: entry.id, token, ...body }) }); const j = (await res.json().catch(() => ({}))) as { entry?: Entry; token?: string; error?: string; errors?: string[]; jobId?: string; file?: string; untouched?: boolean; why?: string; window?: Narration["window"] }; if (!res.ok) { setError(j.errors?.join("; ") ?? j.error ?? `HTTP ${res.status}`); @@ -91,7 +88,7 @@ export default function PostNarrationPanel({ if (j.entry) onEntry(j.entry, j.token ?? null); return j; }, - [project, entry.id, token, onEntry, inTake], + [project, entry.id, token, onEntry], ); const set = (patch: Record<string, unknown>) => post({ op: "set", patch }).then((j) => j && setStatus("saved")); @@ -336,8 +333,7 @@ export default function PostNarrationPanel({ </label> ); - // THE LANES: each attachment's window, the read on the item's clock -- on the take-only bench too (every write - // through the take: the trim is the bench's draft, saved with inTake; the lead and Re-pick best post inTake). + // THE LANES: each attachment's window, the read on the item's clock (every write the draft's). const lanes = timed.length || (sch && picked) ? ( <section className="space-y-1.5 rounded border border-[var(--color-line)] bg-[var(--color-panel)] p-3" data-post-lanes=""> @@ -412,29 +408,6 @@ export default function PostNarrationPanel({ </section> ) : null; - // A take-scoped bench (?inTake): a read is made for the cut here; a take's own read is \`umtool posts narrate … --in-take <t>\`. - // Pauses in the picked read (postPause.mjs) are no TTS, so they are made here too, on the take's own read. - if (inTake) - return ( - <div className="space-y-2 text-[12.5px]" data-post-narration-in-take={inTake}> - <p className="m-0 text-[12px] text-muted" data-post-bench-in-take-note=""> - Recording, re-takes and the mix are made on the cut's bench (edits go to: the cut); take {inTake} keeps the reads it has. The lanes, the pauses and a re-voiced phrase here edit the take. - </p> - {lanes} - {picked && ( - <Options id="post-reread" label="Re-join the read (no TTS)" hint="pauses after words · re-voice a phrase"> - <PauseAfter post={post} hasWords={!!picked.words?.length} setStatus={setStatus} /> - {picked.engine !== "recorded" && <RevoicePhrase post={post} hasWords={!!picked.words?.length} setStatus={setStatus} />} - </Options> - )} - {status && <p className="m-0 text-text-2" data-post-narration-status="">{status}</p>} - {error && ( - <p className="m-0 text-[var(--color-blocking,#c33)]" data-post-narration-error=""> - {error} - </p> - )} - </div> - ); return ( <div className="space-y-3 text-[12.5px]" data-post-narration={entry.id} data-post-narration-plays={picked ? (picked.engine === "recorded" ? "recorded" : "synthesized") : "none"}> {/* The cut's reading: how far along, and where next. */} diff --git a/umtool/components/projects/PostThreadPanel.tsx b/umtool/components/projects/PostThreadPanel.tsx @@ -1,6 +1,5 @@ "use client"; -import { useInTake } from "./inTake"; import { useMemo, useState } from "react"; import { THREAD_DEFAULTS, THREAD_LIMITS, THREAD_MODES, partRoles, readPieces, threadKnobs, threadLayout, threadReadErrors } from "umtool-report-to-video/post-thread"; import { followKnobs } from "umtool-report-to-video/read-follow"; @@ -40,7 +39,6 @@ export default function PostThreadPanel({ setS: (s: number) => void; setEntry: (f: (e: Entry) => Entry) => void; }) { - const inTake = useInTake(); const own = (entry.thread ?? undefined) as Thread | undefined; const k = threadKnobs(entry, render) as Required<Thread>; const layout = useMemo(() => threadLayout(entry, render, { prev: before, scene }), [entry, render, before, scene]); @@ -106,13 +104,6 @@ export default function PostThreadPanel({ </label> ); if (!parents.length && !entry.quoted && !sceneTiles.length) return null; - // A take-scoped bench (?inTake): a read is made for the cut here; a take's own read is \`umtool posts narrate … --in-take <t>\`. - if (inTake) - return ( - <p className="m-0 text-[12px] text-muted" data-post-bench-in-take-note=""> - The thread read is edited on the cut's bench (edits go to: the cut); take {inTake} keeps the reads it has. - </p> - ); return ( <section className="rounded border border-[var(--color-line)] bg-[var(--color-panel)] p-3 text-[12px]" data-post-thread-panel="" data-threaded={layout.on ? "1" : "0"}> <div className="mb-2 flex flex-wrap items-center gap-2"> diff --git a/umtool/components/projects/PostZoomPanel.tsx b/umtool/components/projects/PostZoomPanel.tsx @@ -1,6 +1,5 @@ "use client"; -import { inTakeBody, useInTake } from "./inTake"; import { useEffect, useMemo, useState } from "react"; import { buttonVariants } from "@/components/ui/button"; import { cn } from "@/lib/utils"; @@ -41,7 +40,6 @@ export default function PostZoomPanel({ setS: (s: number) => void; onEntry: (e: Entry, token: string | null) => void; }) { - const inTake = useInTake(); const btn = cn(buttonVariants({ variant: "outline", size: "sm" })); const [error, setError] = useState<string | null>(null); const [status, setStatus] = useState<string | null>(null); @@ -71,7 +69,7 @@ export default function PostZoomPanel({ const send = async (fx: Record<string, unknown>) => { setError(null); - const res = await fetch("/api/report/post-item", { method: "POST", headers: { "content-type": "application/json" }, body: JSON.stringify({ project, op: "fx", id: entry.id, fx, token, ...inTakeBody(inTake) }) }); + const res = await fetch("/api/report/post-item", { method: "POST", headers: { "content-type": "application/json" }, body: JSON.stringify({ project, op: "fx", id: entry.id, fx, token }) }); const j = (await res.json().catch(() => ({}))) as { entry?: Entry; token?: string; error?: string; errors?: string[] }; if (!res.ok || !j.entry) { setError(j.errors?.join("; ") ?? j.error ?? `HTTP ${res.status}`); diff --git a/umtool/components/projects/ProjectView.tsx b/umtool/components/projects/ProjectView.tsx @@ -16,7 +16,6 @@ import ReviewPage from "./ReviewPage"; import ClipDeckPage from "./ClipDeckPage"; import PlayCutPage from "./PlayCutPage"; import PresentPage from "./present/PresentPage"; -import TakeWalkPage from "./TakeWalkPage"; import OpenInDraftPage from "./OpenInDraftPage"; import ReelPlayPage from "./reel/ReelPlayPage"; import ReelWalkPage from "./reel/ReelWalkPage"; @@ -74,15 +73,13 @@ export default async function ProjectView({ // `/projects/<project>/takes/compare?a=<project>:<take>&b=…` -- two takes of the project // or of its variants side by side, in step, with what differs (UI notes item 19). if (rest.length === 2 && rest[0] === "takes" && rest[1] === "compare") return <TakesComparePage project={project} search={search} />; - // `/projects/<project>/takes/<take>/walk` -- walk a take: its clips, and - // where the walk starts; `…/takes/<take>/clip/<id>` -- the bench on one - // of them, its saves going into the take's patch, never the manifest. // `/projects/<project>/takes/<take>/open` -- open a saved version in the draft (it asks first, L3). - if (rest.length === 3 && rest[0] === "takes" && rest[2] === "open") return <OpenInDraftPage project={project} take={rest[1]} search={search} />; - if (rest.length === 3 && rest[0] === "takes" && rest[2] === "walk") return <TakeWalkPage project={project} take={rest[1]} search={search} />; + // The take walk's and a take's bench's old addresses (`…/takes/<take>/walk`, `…/takes/<take>/clip/<id>`) + // are that page too: every edit lands in the draft, so a version is opened in it before its clips are walked. + if (rest.length === 3 && rest[0] === "takes" && (rest[2] === "open" || rest[2] === "walk")) return <OpenInDraftPage project={project} take={rest[1]} search={search} />; if (rest.length === 4 && rest[0] === "takes" && rest[2] === "clip") { if (!isTakeId(rest[1])) return notFound(); - return <ClipBenchPage project={project} clipId={rest[3]} take={rest[1]} search={search} />; + return <OpenInDraftPage project={project} take={rest[1]} clip={rest[3]} search={search} />; } // `/browse/<project>/narration` -- the narration script, card by card, // approved / edited / rejected before synthesis. diff --git a/umtool/components/projects/TakeActions.tsx b/umtool/components/projects/TakeActions.tsx @@ -5,12 +5,16 @@ import Link from "next/link"; import { useRouter } from "next/navigation"; import { buttonVariants } from "@/components/ui/button"; import { startTakeJob } from "./NewTakePanel"; +import PlayLink from "./PlayLink"; -// What a take offers once it can be walked (walk a take): walk it, render it -// (a draft's first render, or a walked take's again), and make it the cut. -// The Takes page's cards and the take's walk page both draw this; each button -// is the CLI's own command run the app's way: +// What a take offers (a saved version, or a legacy take): play it read-only, +// open it in the draft to edit it (L3: every edit lands in the draft), render +// it (a draft's first render, or a walked take's again), and make it the cut. +// The Takes page's cards draw this; each button is the CLI's own command run +// the app's way: // +// Play · Open in draft /projects/<p>/play?take=<t> · /projects/<p>/takes/<t>/open +// = umtool takes open <p> <t> // Render full / Render 60 s POST /api/report/takes/make { rebuild, window } // = umtool take <p> --id <t> --rebuild [--full | --at 0 --dur 60] // Make this the cut POST /api/report/takes/promote @@ -20,14 +24,15 @@ export default function TakeActions({ project, take, draft, - walkHref, + openHref, edited, compact = false, }: { project: string; take: string; draft: boolean; - walkHref: string | null; + /** Open in draft (OpenInDraftPage): it asks, saves the draft first when it has edits, copies the take in. */ + openHref: string | null; /** Edited by the walk since its render (or never rendered). */ edited: boolean; compact?: boolean; @@ -73,9 +78,10 @@ export default function TakeActions({ const size = compact ? "sm" : "md"; return ( <div data-take-actions={take} className="flex flex-wrap items-center gap-1.5 text-[11.5px]"> - {walkHref && ( - <Link href={walkHref} data-take-walk-link={take} className={buttonVariants({ variant: draft ? "go" : "outline", size })}> - Walk this take + <PlayLink project={project} take={take} where="take-actions" variant={compact ? "button" : "header"} label="Play" /> + {openHref && ( + <Link href={openHref} data-take-open-draft={take} className={buttonVariants({ variant: draft ? "go" : "outline", size })} title={`copy ${take} into the draft to edit it (it asks first) — umtool takes open ${project} ${take}`}> + Open in draft </Link> )} <button diff --git a/umtool/components/projects/TakeTools.tsx b/umtool/components/projects/TakeTools.tsx @@ -4,7 +4,7 @@ import Link from "next/link"; import { useRouter } from "next/navigation"; import { useEffect, useState } from "react"; import { buttonVariants } from "@/components/ui/button"; -import { jobsHref, takeWalkHref } from "@/lib/hrefs"; +import { jobsHref, openInDraftHref } from "@/lib/hrefs"; import { cn } from "@/lib/utils"; import PlayLink from "./PlayLink"; @@ -83,10 +83,11 @@ export function DraftFromButton({ project, take }: { project: string; take: stri {res?.exit === 0 && res.id && ( <span className="text-[11.5px] text-text-2" data-take-drafted={res.id}> draft <b className="font-mono">{res.id}</b>:{" "} - <Link href={takeWalkHref(project, res.id)} className="ink-link"> - walk it - </Link>{" "} - <PlayLink project={project} take={res.id} where="drafted" variant="icon" /> + <PlayLink project={project} take={res.id} where="drafted" variant="link" label="Play" />{" "} + ·{" "} + <Link href={openInDraftHref(project, res.id)} className="ink-link" data-take-open-draft={res.id}> + Open in draft + </Link> </span> )} {res && res.exit !== 0 && <span className="text-[11.5px] text-reject-text">{res.error ?? res.said ?? "refused"}</span>} @@ -111,9 +112,10 @@ export function ImportItems({ project, take }: { project: string; take: string } const [done, setDone] = useState<Tools | null>(null); useEffect(() => { if (!open) return; - void fetch(`/api/report/takes/timeline?project=${encodeURIComponent(project)}&take=${encodeURIComponent(take)}`, { cache: "no-store" }) + // The take's entries as Play reads them (its frozen manifest, or its patch over the draft): where an item lands. + void fetch(`/api/report/play-view?${new URLSearchParams({ project, take })}`, { cache: "no-store" }) .then((r) => r.json()) - .then((j) => setEntries(Array.isArray(j.timeline) ? j.timeline : [])) + .then((j) => setEntries(Array.isArray(j.entries) ? (j.entries as { id: string; type: string; heading?: string }[]).map((e) => ({ id: e.id, type: e.type, words: e.heading })) : [])) .catch(() => {}); void fetch("/api/jump", { cache: "no-store" }) .then((r) => r.json()) diff --git a/umtool/components/projects/TakeWalkPage.tsx b/umtool/components/projects/TakeWalkPage.tsx @@ -1,161 +0,0 @@ -import Link from "next/link"; -import { notFound } from "next/navigation"; -import { hms } from "umtool-report-to-video/attribution"; -import { badgeVariants } from "@/components/ui/badge"; -import { buttonVariants } from "@/components/ui/button"; -import { projectsHref, takeClipHref, takeWalkHref, takesHref } from "@/lib/hrefs"; -import { isTakeId } from "@/lib/report/takes.mjs"; -import { walkOf } from "@/lib/report/walkData.mjs"; -import type { ProjectRef } from "@/lib/project-types"; -import { BenchBody, BenchFrame, BenchTop } from "./bench/BenchShell"; -import PlayLink from "./PlayLink"; -import { AddClipToggle } from "./AddClip"; -import TakeTools from "./TakeTools"; -import { Options } from "@/components/ui/disclosure"; -import TakeActions from "./TakeActions"; -import BenchPrepPanel from "./report/BenchPrepPanel"; - -// `/projects/<project>/takes/<take>/walk` -- WALK A TAKE: the take's clips -// (the project's manifest with the take's patch applied, a draft too) in walk -// order, each with its verdict and whether a fetched file holds it, and where -// the walk starts. Each clip opens the clip bench on the TAKE -// (`…/takes/<take>/clip/<id>`), whose saves go into the take's patch. -// `umtool walk <project> --take <take>` prints the same reading. - -const VERDICT_TONE = { confirmed: "on", incorrect: "meter", rejected: "meter", unreviewed: "state" } as const; - -export default async function TakeWalkPage({ - project, - take, - search = {}, -}: { - project: ProjectRef; - take: string; - search?: Record<string, string | undefined>; -}) { - if (!isTakeId(take)) notFound(); - const all = search.all === "1"; - let w: Awaited<ReturnType<typeof walkOf>>; - try { - w = await walkOf(project, { take, all }); - } catch { - notFound(); - } - const start = w.first ? takeClipHref(project.id, take, w.first, { all }) : null; - const unfetched = w.clips.filter((c) => !c.fetched).length; - return ( - <BenchFrame - kind="take-walk" - top={ - <BenchTop - trail={[{ href: projectsHref(), label: "Projects" }]} - back={{ href: takesHref(project.id), label: `${project.name} · takes` }} - kind="Take walk" - here={take} - next={start ? { href: start, label: w.first ?? "", attrs: { "data-take-walk-start": w.first ?? "" } } : null} - note={`${w.total} clips · ${hms(w.seconds)} · ${w.reviewed} reviewed`} - /> - } - > - <BenchBody workClassName="space-y-3 overflow-y-auto"> - <section data-take-walk-head={take} className="space-y-1.5"> - <div className="flex flex-wrap items-center gap-2"> - <h1 className="text-[15px] text-text">{w.take?.label ?? take}</h1> - {w.take?.draft && <span className={badgeVariants({ variant: "state", size: "sm" })}>draft — not rendered</span>} - {!w.take?.editable && <span className={badgeVariants({ variant: "meter", size: "sm" })}>read only — a recipe's take, not made</span>} - </div> - <p className="text-[12px] text-text-2"> - Edits made while walking go into this take's patch (<code className="font-mono">takes/{take}/take.json</code>), never the - project's manifest. {w.needing} need a verdict, {w.ready} of them fetched - {unfetched ? ` · ${unfetched} not fetched` : ""}. - </p> - {w.note && <p className="text-[12px] text-doubt-text">{w.note}</p>} - <div className="flex flex-wrap items-center gap-2"> - {start ? ( - <Link href={start} data-take-walk-go="" className={buttonVariants({ variant: "go", size: "md" })}> - Walk → start at {w.first} - </Link> - ) : ( - <span className="text-[12px] text-[var(--color-dim)]"> - {all ? "Nothing fetched to walk." : "Every fetched clip has a verdict."} - </span> - )} - <PlayLink project={project.id} take={take} where="walk" variant="button" /> - <Link href={takeWalkHref(project.id, take, { all: !all })} data-take-walk-all={all ? "1" : "0"} className="text-[12px] ink-link"> - {all ? "walk only the clips needing a verdict" : "walk every clip (judged ones too)"} - </Link> - </div> - {w.take?.editable && ( - <div className="flex flex-wrap items-start gap-2"> - <AddClipToggle project={project.id} take={take} where="take" /> - </div> - )} - {/* The take's own prep: its clips' excerpts and waveforms made before the walk opens them. */} - <BenchPrepPanel project={project.id} take={take} /> - {w.take?.editable && ( - <TakeActions project={project.id} take={take} draft={!!w.take?.draft} walkHref={null} edited compact /> - )} - <Options id="take-walk" hint="check before render · new draft from it · add items from another project"> - <TakeTools project={project.id} take={take} editable={!!w.take?.editable} /> - </Options> - </section> - <table data-take-walk-clips="" className="w-full border-collapse text-[12px]"> - <thead> - <tr className="micro text-left"> - <th className="py-1 pr-2">#</th> - <th className="py-1 pr-2">clip</th> - <th className="py-1 pr-2">window</th> - <th className="py-1 pr-2 text-right">s</th> - <th className="py-1 pr-2">verdict</th> - <th className="py-1 pr-2">quote</th> - </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> - <td className="py-1 pr-2"> - <Link href={takeClipHref(project.id, take, c.id, { all })} className="font-mono ink-link"> - {c.id} - </Link> - {c.onWalk && <span className="ml-1 text-meter" title="on the walk">→</span>} - <PlayLink project={project.id} take={take} clip={c.id} where="walk-row" variant="icon" /> - </td> - <td className="num py-1 pr-2 whitespace-nowrap"> - {hms(c.start)}–{hms(c.end)} - {!c.fetched && <span className={`ml-1 ${badgeVariants({ variant: "state", size: "sm" })}`}>not fetched</span>} - </td> - <td className="num py-1 pr-2 text-right">{c.seconds.toFixed(1)}</td> - <td className="py-1 pr-2"> - <span className={badgeVariants({ variant: VERDICT_TONE[c.verdict as keyof typeof VERDICT_TONE] ?? "state", size: "sm" })}> - {c.rejected ? `${c.verdict} — ${c.rejected.label}` : c.verdict} - </span> - {(c.rejected?.fact ? c.correction : (c.rejected?.why ?? c.correction)) && ( - <span className="block text-[11px] text-doubt-text">{c.rejected?.fact ? c.correction : c.rejected ? c.rejected.why : c.correction}</span> - )} - </td> - <td className="py-1 pr-2 text-text-2">{c.quote}</td> - </tr> - ))} - </tbody> - </table> - </BenchBody> - </BenchFrame> - ); -} diff --git a/umtool/components/projects/TakesBench.tsx b/umtool/components/projects/TakesBench.tsx @@ -11,7 +11,7 @@ import { badgeVariants, type BadgeVariants } from "@/components/ui/badge"; import { buttonVariants } from "@/components/ui/button"; import { fmtAgo, fmtBytes } from "@/lib/format"; import { cn } from "@/lib/utils"; -import { playHref, takeWalkHref, presentHref } from "@/lib/hrefs"; +import { openInDraftHref, playHref, presentHref } from "@/lib/hrefs"; import RenderRecord from "@/components/queue/RenderRecord"; import type { RenderView } from "@/lib/queue/view"; import { BenchBody, VerdictBar } from "./bench/BenchShell"; @@ -56,8 +56,10 @@ export type Take = { quick?: boolean; /** The project's manifest is not the one it was made from (null: it does not say). */ stale?: boolean | null; - /** Recorded, not rendered (`umtool take … --draft`): walk it, then render it. */ + /** Recorded, not rendered (`umtool take … --draft`, or a saved version): play it, open it in the draft, render it. */ draft?: boolean; + /** A saved version (lib/report/versions.mjs): frozen in takes/<id>/base.manifest.json. */ + version?: boolean; /** The walk's last edit to its patch (later than builtAt: the render is older than the take). */ editedAt?: string | null; /** What a running render names (takeHousekeeping.mjs renderHolds): it is rendering, or a render is made from it. */ @@ -645,8 +647,8 @@ function TakeCard({ }; const superseded = verdict?.superseded ?? null; const windowWords = t.window === "full" ? "full cut" : t.window ? `${t.window.at}–${t.window.at + t.window.dur} s` : null; - // Walk a take: a draft is walked before it is rendered; a rendered take - // walked since says its render is older than it (editedAt after builtAt). + // A take edited since its render (a legacy walk, or the CLI's take-scoped edits) says its render is older + // than it (editedAt after builtAt). Every UI edit lands in the draft now (Open in draft first). const editedSinceRender = !!t.editedAt && (!t.builtAt || t.editedAt > t.builtAt); const walkable = !!t.draft || !!t.baseHash; @@ -677,10 +679,8 @@ function TakeCard({ data-take-draft={t.id} className="flex aspect-video w-full flex-col items-center justify-center gap-1 bg-black px-3 text-center text-[12px] text-[var(--color-dim)]" > - <span className="text-text-2">draft — walk / render</span> - <span className="text-[11px]"> - nothing rendered yet: walk its clips on the bench (edits go into this take), then render it - </span> + <span className="text-text-2">{t.version ? "saved version — not rendered" : "draft — not rendered"}</span> + <span className="text-[11px]">play it read-only, open it in the draft to edit it, or render it</span> </div> ) : ( <div data-no-preview="" className="flex aspect-video w-full items-center justify-center bg-black text-[11px] text-[var(--color-dim)]"> @@ -838,7 +838,7 @@ function TakeCard({ project={project} take={t.id} draft={!!t.draft} - walkHref={takeWalkHref(project, t.id)} + openHref={openInDraftHref(project, t.id)} edited={!!t.draft || editedSinceRender} compact /> diff --git a/umtool/components/projects/bench/TakeWalkStrip.tsx b/umtool/components/projects/bench/TakeWalkStrip.tsx @@ -1,140 +0,0 @@ -"use client"; - -import { useEffect, useState } from "react"; -import Link from "next/link"; -import { badgeVariants } from "@/components/ui/badge"; -import { buttonVariants } from "@/components/ui/button"; -import { cn } from "@/lib/utils"; - -// WALKING A TAKE: the line that says so, on the clip bench, and the take's -// own structure -- this clip out of the take, earlier or later in it, and the -// take's last edit taken back. Every one is POST /api/report/takes/timeline -// (lib/report/takeEdit.mjs), the writer `umtool timeline <p> --take <id>` -// runs; the project's manifest is never written from here. -// -// After a structural edit the page is LOADED again rather than refreshed: the -// bench holds its token and its drafts in state, and a remount is the honest -// way to show the take as it now is. - -export default function TakeWalkStrip({ - project, - take, - clipId, - index, - total, - nextHref, - getToken, - className, -}: { - project: string; - take: { id: string; label: string; draft: boolean; editable: boolean; all: boolean; takesHref: string; walkHref: string; toggleAllHref: string }; - clipId: string; - /** This clip's place in the take's timeline, 0-based, and the timeline's length. */ - index: number; - total: number; - /** Where the walk goes after this clip is removed. */ - nextHref: string | null; - getToken: () => string | null; - className?: string; -}) { - const [ready, setReady] = useState(false); - const [busy, setBusy] = useState(false); - const [said, setSaid] = useState<string | null>(null); - useEffect(() => setReady(true), []); - - const run = async (op: "move" | "remove" | "undo", extra: Record<string, unknown> = {}, then: string | null = null) => { - setBusy(true); - setSaid(null); - try { - const r = await fetch("/api/report/takes/timeline", { - method: "POST", - headers: { "content-type": "application/json" }, - body: JSON.stringify({ project, take: take.id, op, token: getToken(), ...extra }), - cache: "no-store", - }); - const j = (await r.json().catch(() => ({}))) as { error?: string; errors?: string[]; stale?: boolean }; - if (!r.ok) { - setSaid(j.stale ? "the take changed since this page was read — reload" : (j.errors?.join("; ") ?? j.error ?? `HTTP ${r.status}`)); - return; - } - window.location.assign(then ?? window.location.href); - } finally { - setBusy(false); - } - }; - - const off = !ready || busy || !take.editable; - return ( - <div - data-take-walk={take.id} - className={cn( - "flex flex-wrap items-center gap-x-2 gap-y-1 rounded border border-[var(--color-sel)] bg-[var(--color-panel)] px-2 py-1 text-[11.5px]", - className, - )} - > - <span className="micro">walking take</span> - <span className="font-mono text-[var(--color-text)]">{take.id}</span> - <span className="truncate text-text-2">{take.label}</span> - {take.draft && <span className={badgeVariants({ variant: "state", size: "sm" })}>draft</span>} - <span className="text-[var(--color-dim)]"> - {take.editable ? "edits go to the take, not the cut" : "a recipe's take, not made yet: read only"} - </span> - <span className="ml-auto flex flex-wrap items-center gap-1.5"> - <span className="num text-[var(--color-dim)]"> - {index + 1}/{total} in the take - </span> - <button - type="button" - data-take-move="earlier" - disabled={off || index <= 0} - className={buttonVariants({ variant: "outline", size: "sm" })} - title="one place earlier in the take" - onClick={() => void run("move", { id: clipId, toIndex: index - 1 })} - > - ← earlier - </button> - <button - type="button" - data-take-move="later" - disabled={off || index >= total - 1} - className={buttonVariants({ variant: "outline", size: "sm" })} - title="one place later in the take" - onClick={() => void run("move", { id: clipId, toIndex: index + 1 })} - > - later → - </button> - <button - type="button" - data-take-remove={clipId} - disabled={off} - className={buttonVariants({ variant: "outline", size: "sm" })} - title="take this clip out of the take (Undo puts it back)" - onClick={() => void run("remove", { id: clipId }, nextHref ?? take.takesHref)} - > - Remove from take - </button> - <button - type="button" - data-take-undo="" - disabled={off} - className={buttonVariants({ size: "sm" })} - title="take back the take's last edit -- a verdict, a trim, a move or a removal" - onClick={() => void run("undo")} - > - Undo take edit - </button> - <Link href={take.toggleAllHref} data-take-walk-all={take.all ? "1" : "0"} className="ink-link"> - {take.all ? "walk the unjudged only" : "walk every clip"} - </Link> - <Link href={take.takesHref} className="ink-link"> - Takes - </Link> - </span> - {said && ( - <span data-take-said="" className="basis-full text-[var(--color-bad)]"> - {said} - </span> - )} - </div> - ); -} diff --git a/umtool/components/projects/inTake.tsx b/umtool/components/projects/inTake.tsx @@ -1,16 +0,0 @@ -"use client"; - -import { createContext, useContext } from "react"; - -// "EDIT THIS TAKE ONLY" on the post bench (lane/ui-simplify, 5 Nov): the take every write of the bench is scoped -// to (`?inTake=<t>`; the routes run the writer under takeScope.mjs withTakeScope, as `umtool posts set-item … --in-take` -// does), or null for the project's cut. A writer adds `...inTakeBody(take)` to its POST body. -const Ctx = createContext<string | null>(null); - -export function InTakeProvider({ take, children }: { take: string | null; children: React.ReactNode }) { - return <Ctx.Provider value={take}>{children}</Ctx.Provider>; -} - -export const useInTake = () => useContext(Ctx); - -export const inTakeBody = (take: string | null) => (take ? { inTake: take } : {}); diff --git a/umtool/components/projects/report/CutTab.tsx b/umtool/components/projects/report/CutTab.tsx @@ -8,7 +8,7 @@ import { } from "@/lib/projects/report.mjs"; import { listTakes } from "@/lib/report/takes.mjs"; import { buttonVariants } from "@/components/ui/button"; -import { narrationRecordHref, postBenchHref, clipBenchHref, clipDeckHref, clipEditorHref, mixHref as toolsMixHref, playHref, projectHref, takeWalkHref, takesHref, trailerHref } from "@/lib/hrefs"; +import { narrationRecordHref, postBenchHref, clipBenchHref, clipDeckHref, clipEditorHref, mixHref as toolsMixHref, playHref, projectHref, openInDraftHref, takesHref, trailerHref } from "@/lib/hrefs"; import { readTrailerBeats } from "@/lib/report/trailerBeats.mjs"; import { montageClipsOf, momentKeysOf, readRulingsState } from "@/lib/report/montageRulings.mjs"; import FetchUnfetchedButton from "../FetchUnfetchedButton"; @@ -472,21 +472,20 @@ export default async function CutTab({ project, detail, search, tabHref }: Repor {trailerBeats ? `Trailer — ${trailerBeats} beat${trailerBeats === 1 ? "" : "s"}` : trailerBeats === null ? "Trailer (beats file unreadable)" : "Trailer beats"} </Link> )} - {/* Walk a take: the drafts first -- a draft exists to be walked before it is rendered. */} + {/* The saved versions and takes: each played read-only, or opened in the draft to edit (L3). */} {takes.takes.some((t: { draft?: boolean; baseHash?: string | null }) => t.draft || t.baseHash) && ( <span data-walk-takes="" className="flex flex-wrap items-center gap-1.5 text-[11.5px]"> - <span className="micro">walk a take</span> + <span className="micro">versions</span> {[...takes.takes] .filter((t: { draft?: boolean; baseHash?: string | null }) => t.draft || t.baseHash) - .sort((a: { draft?: boolean }, b: { draft?: boolean }) => Number(!!b.draft) - Number(!!a.draft)) + .sort((a: { order?: number }, b: { order?: number }) => (b.order ?? 0) - (a.order ?? 0)) .slice(0, 6) .map((t: { id: string; label: string; draft?: boolean }) => ( - <span key={t.id} className="inline-flex items-center"> - <Link href={takeWalkHref(project.id, t.id)} data-walk-take={t.id} className="ink-link" title={t.label}> - {t.id} - {t.draft ? " (draft)" : ""} + <span key={t.id} className="inline-flex items-center gap-1"> + <PlayLink project={project.id} take={t.id} where="walk-chip" variant="link" label={t.id} /> + <Link href={openInDraftHref(project.id, t.id)} data-walk-take={t.id} className="ink-link text-muted" title={`open ${t.id} (“${t.label}”) in the draft — it asks first`}> + open </Link> - <PlayLink project={project.id} take={t.id} where="walk-chip" variant="icon" /> </span> ))} </span> diff --git a/umtool/components/projects/review/PlayCut.tsx b/umtool/components/projects/review/PlayCut.tsx @@ -93,14 +93,13 @@ import CopyShareLine from "../CopyShareLine"; // bench's "Back to the cut" lands here as `?clip=<id>&at=<offset>`. By clip id // and offset, never by raw cut seconds: the edit just changed this clip's // length, which moves every cut second after it. The page is a fresh server -// render of the manifest (force-dynamic), so the new edges are what plays. A -// take WITHOUT a timeline of its own plays the project's cut as it is now, so -// its Edit goes to the project's manifest, and the bench says so. A take WITH -// its own timeline (`ownTimeline`: its patch replaces the timeline) is a cut -// of its own: its Edit opens the TAKE's bench on the clip (`…/takes/<take>/ -// clip/<id>?from=play`), whose saves go into takes/<take>/take.json, and -// Back plays that take -- never the project's clip of the same id (2 Nov: an -// edge fixed on `kirsche-7`'s kr1 landed in the project's cut). +// render of the manifest (force-dynamic), so the new edges are what plays. +// Every edit lands in THE DRAFT (umtool redesign L3): a saved version +// (`?take=`) is played read-only, and its Edit goes to the Open in draft page +// (`…/takes/<take>/open?clip=<id>&from=play`) -- it asks, saves the draft +// first when it has edits, copies the version in -- then the draft's bench; +// Back plays the draft. (2 Nov: an edge fixed from Play on `kirsche-7`'s kr1 +// landed where the operator did not expect: there is one place now.) // // ON A PHONE (the phone design brief): one document, the player pinned at the // top -- a strip once the transport has scrolled under it -- the strip, Now diff --git a/umtool/docs/clip-bench.md b/umtool/docs/clip-bench.md @@ -307,162 +307,22 @@ and **‹ Back to the cut** returns to the same clip, second and take without Pl header's links walk the CUT's order — the reel strip's neighbours, judged or not ("40 of 127") — not the walk's. Opened on its own, the bench's head has **▶ Play the cut from here**. -Play on a take WITH ITS OWN TIMELINE (its patch replaces the timeline — a tight version, a spin-off) opens -the take's bench instead ([Walking a take](#walking-a-take), `…/takes/<take>/clip/<id>?from=play`): the -save goes into the take's patch, never the project's clip of the same id, the head says **edits go to take -`<take>`, not the project's cut**, and **‹ Back to the cut** plays the take. A take without a timeline of its -own plays the project's cut as it is now, so its Edit stays the project's bench, as it says. - -### What the walk skips - -The walk visits the clips that still **need judgement** and are **fetched**, in -timeline order — so `p`, `n`, both header links, the start button and the jump -<kbd>y</kbd> makes after it confirms all go to the nearest one of those. - -- **Needs judgement** means no verdict: the same rule `N reviewed` counts by. - Walking back onto a clip somebody already answered is the round trip the walk - exists to remove. -- **Fetched** means some file in `out/clips-raw` holds this clip's own window - end to end (a clip with gaps fetched per piece: every kept piece is in some file). Not the *padded* window a build would download, and not an - overlap: a half-covered clip cannot be watched through, so there is nothing - to judge. Landing on one is a dead end whose only move is `n` again. - -A **URL still opens any clip**, judged or unfetched — the bench renders it, says -*"nothing fetched for this clip yet"* and carries a **not fetched yet** pill, -and its two links point at the fetched, unjudged neighbours either side. The -per-row link on the Cut tab is that URL, so "go to that one" is unchanged. - -Both pages read **`ready N of M needing judgement`**: `M` is the clips with no -verdict, `N` the ones among them that can be judged today. The gap between the -two is what is waiting on a download rather than on you — every row the project -page marks **not fetched yet**. - -### Prepared before you open it - -A clip whose source is a long recording (a saved whole stream, any window over -10 minutes) is opened on an **excerpt**: the clip and 45 s either side, edges -rounded out to 15 s, cut once into `out/bench-excerpts/<video>/<from>-<to>.excerpt.mp4` -(`lib/report/serve.mjs`). Cut on first open, that is 10–35 s of ffmpeg with the -bench saying "decoding the audio…", and then the waveform is decoded. - -So the walk is prepared ahead: **Prepare clips for the walk** under the Cut -tab's walk button (with `N of M ready to open` beside it, and what it is on while -it runs), `umtool prep <project>`, and on their own after a fetch lands a window -and after a write that moves a clip's extent or adds one (an excerpt is cut -only then; a waveform is made too after a fetch). It makes exactly what the -first open would: the excerpt, by the same name, and the waveform in the cache -`/api/report/peaks` reads. A clip already prepared is skipped (its excerpt cut -from its recording as it is now, its waveform cached). **Not "newer than its -recording"**: the cut records the recording's identity in -`<excerpt>.src.json`, and an excerpt whose record does not match the recording -today — or that has none — is cut again. A good copy replacing a corrupt one -under an older mtime used to leave the corrupt excerpts playing. Not the decoded audio: once the -excerpt exists `/api/report/audio` decodes the first span in a fraction of a -second. - -It runs as a background runner per project (`umtool prep <project> --run`), one -clip at a time, each in the machine's **heavy slot** with a declared estimate -of 400 MB (so it runs beside a render while the memory floor holds, and waits -when it does not), under `nice -n 19` and `ionice -c3`. Its progress is -`out/bench-excerpts/prep-status.json`, its log `prep.log` beside it. A clip you -open before it gets there is cut by the bench as before; a cut already running -in the other process is waited for, not repeated. `UMTOOL_BENCH_PREP=0` queues -nothing (`umtool prep --wait` still runs). - -### Keep it in the cut? - -A clip is a **claim** — the report said somebody said this, here — so the right -column opens with what this clip is *supposed to be* (its `quote`, and its -`note`: why it is in the cut) and then asks the one question the walk exists to -answer: **Keep c04 in the cut?** - -<kbd>y</kbd> confirms and **advances** — to the next clip on the walk, which is -the next one that needs an answer and has something to play — because in the yes -case that clip is what you want and a walk of sixty clips should be one finger. - -<kbd>x</kbd> is **Reject ▾**: the reasons a clip comes out, and *doesn't match* is -only one of them (operator, 2026-10-30: "I tend to want to reject clips not -because they don't match, but are irrelevant"). A digit picks one: - -| key | reason | what it means | stored | -|---|---|---|---| -| <kbd>1</kbd> | doesn't match | what is said doesn't match the quote or claim | `incorrect` + `correction` (required) | -| <kbd>2</kbd> | wrong speaker | somebody else is talking | `incorrect`, `reason: "wrong-speaker"` | -| <kbd>3</kbd> | irrelevant | accurate, but not relevant to this cut | `rejected`, `reason: "irrelevant"` | -| <kbd>4</kbd> | repeats | covered by an earlier clip (the note: which) | `rejected`, `reason: "repeats"` | -| <kbd>5</kbd> | weak | accurate and relevant, not strong enough | `rejected`, `reason: "weak"` | -| <kbd>6</kbd> | privacy | holds something that must not be published | `rejected`, `reason: "privacy"` | -| <kbd>7</kbd> | other | anything else (the note is required) | `rejected`, `reason: "other"` | - -The first two are FACT errors — corrections for the next report pass, blocking in -`umtool check`; the rest say the report is right and the clip just does not belong -here, and are never read as a correction. Picking one asks in the page — the clip, -the reason, a note — and then **Remove c04** takes it out of the cut in one write -(an undo point first, on record in `removed.json` with the reason and the note, -**Undo** and **Next clip ›** after), or **Reject, keep in place** writes the -verdict only, for removal later. **Wrong speaker** beside **Reject ▾** is the same -flow with its reason preset. On a phone the dock's **Reject…** opens the same -choice in a sheet. On a take's walk only *keep in place* is offered: a take's -timeline is a patch. - -Typing a `correction` on a clip nobody has judged still marks it **incorrect** in -the same patch (`{correction, verdict: "incorrect"}`), so the manifest never holds -a complaint with no verdict. - -An edge you nudged but never saved is confirmed WITH the clip: if the selection -differs from the stored window, <kbd>y</kbd> carries `start`/`end` (and clears a -cut the new extent no longer contains) in the same patch as the verdict, so -walking on never loses the window you just chose. - -### ★ and the walk note — not a verdict, not a correction - -<kbd>s</kbd> (or **☆ Star** beside the answers; **☆ Star** in the phone's status line) stars the -clip: a favourite, written at once (`star: true`). A starred clip is a **trailer candidate** — the -Cut tab lists them under **★ trailer candidates**, and `umtool trailer <p> --candidates [--json]` -prints them as a trailer's `--beats-json`. The **walk note** field (beside `correction`) takes an -editorial note — *this is gold*, *wants a beat of silence*, *move it to sex appeal* — as `walkNote`. -Neither touches the verdict, and neither is a `correction`: that field says the REPORT got a fact -wrong and is read by the next report pass. From a terminal: `umtool window <p> <clip> --star` -(`--no-star`), `--walk-note "…"` (`''` clears). A `correction` on a clip already confirmed (or rejected for a cut reason) is -usually such a note written in the only box there was: **move to walk note** beside it moves it in one -write (`umtool window <p> <clip> --walk-note "…" --correction ''`). A clip that re-plays another on purpose shows -**repeats `<clip>`** in the header (`repeatOf`). - -A window you save that leaves the clip's `cite` (the clock) — or its citeUrl's `t=` — more than 5 s -before what plays, or past its end, moves it to the clip's first second, and the save says so -(*saved — the cite followed the edge: 25:22 → 26:40, and the QR with it*). See -[knobs.md](knobs.md#the-cite-follows-the-edge). - -A note on a clip that is already **confirmed** is just a note — why its window -moved, a caveat for the writers — and writing one there leaves the verdict -alone — as it does on a clip rejected for a cut reason, whose facts are right. -The state line reads *not yet reviewed*, *confirmed*, *confirmed · with note*, -*incorrect — doesn't match* / *incorrect — wrong speaker* or *rejected — irrelevant* -(and the rest), and the header counts how much of the cut has been -reviewed. See -[report-video.md](report-video.md#verdict--what-the-walk-said) for what is -stored and what the writer refuses. +Play on a saved version (`?take=`) is read-only: its **Edit this clip** goes to **Open in draft** first +([knobs.md](knobs.md#the-working-draft-and-saved-versions)) — it asks, saves the draft as a version when it +has edits, copies the version in — then this bench on the DRAFT's clip. Every save here lands in the draft. ## Walking a take -`/projects/<project>/takes/<take>/walk` — from **Walk this take** on the take's card, or **walk a -take** on the Cut tab — lists the take's clips in walk order: each clip's window, length, verdict, -whether a fetched file holds it, and (→) the ones the walk visits, with **Walk → start at -`<clip>`**. A take is the project's manifest with its patch applied (a draft too: -[report-video.md](report-video.md#walking-a-take-drafts-edits-into-the-take-and-making-it-the-cut)), -so its clips may be windows the project's cut does not have — a tight version's sub-windows. Each -plays from the cached windows of its recording: a sub-window inside a fetched window plays without -a new fetch. - -`/projects/<project>/takes/<take>/clip/<id>` is this bench on the take's clip. Everything works as -on the project's cut, and **every save goes into the take's patch** (`takes/<take>/take.json`), -never the project's manifest: the verdict (`y`, `x` — kept in place), the edges, the attribution, the mute mark, -cut to quote, a wider fetch (the job is pointed at the take's manifest, written beside the -project's; the bytes land where every fetch's do). A strip at the top says **walking take -`<take>` — edits go to the take, not the cut**, with **← earlier**, **later →**, **Remove from -take** and **Undo take edit** (the take's newest edit taken back, whichever it was). The one-clip -re-render is not offered: a take is rendered whole (**Render full** on the Takes page, or `umtool -take <p> --id <take> --full`). +The take walk (`/projects/<project>/takes/<take>/walk`) and a take's bench +(`/projects/<project>/takes/<take>/clip/<id>`) are the **Open in draft** page now (umtool redesign L3: every +edit lands in the draft): it asks — *Open tight in draft? Your draft (2 edits since v3) is saved as v4 +first.* — copies the take into the draft (a take with its own timeline by its patch over the draft, as +**Make this the cut** merges it), then opens THIS bench on the draft's clip. When the take is the draft's +parent with no edits, the address goes straight on (308). Nothing in the UI writes a take's patch. + +A take's clips are still walked from a terminal, every save into the take's patch (`takes/<take>/take.json`), +never the project's manifest: `umtool walk <p> --take <take>`, `umtool window <p> <clip> --take <take> …` and +`umtool timeline <p> --take <take> move|remove|undo|insert` ([cli.md](cli.md)). **Prepared before you open it, per take.** The take's walk page carries **Prepare clips for the walk**, and `umtool prep <project> --take <take>` makes the same excerpts and waveforms the take's bench would make diff --git a/umtool/docs/knobs.md b/umtool/docs/knobs.md @@ -629,6 +629,9 @@ expected the cut). A take is a **saved version** — FROZEN: Open in draft page goes straight on (308) to the draft's bench. - **The pick is not touched.** Neither saving nor opening moves or unpins the pick in `verdicts.json` (**Use this take** still does). +- **Old addresses.** The take walk (`/projects/<p>/takes/<t>/walk`) and a take's bench (`…/takes/<t>/clip/<id>`) are + the Open in draft page now — then the draft's bench. The take-scoped CLI (`--in-take`, `umtool timeline <p> --take`, + `umtool window --take`, `/api/report/takes/timeline`) stays for agents. ## Play the cut (the whole cut, or a take, with no render) @@ -671,8 +674,7 @@ take. but never unmounted, so its composed deck, decoded sound, measured edges, the strip's zoom and the take stay as they were (`components/projects/cutApp/CutApp.tsx`; the bench's data is `GET /api/report/bench`, the same function its own page renders from, `lib/report/benchData.ts`). The address moves by `history.pushState` to the bench's -(`/clip/<id>?from=play&at&take&order=cut`; on a take with its own timeline, the take's bench, -`/takes/<take>/clip/<id>?from=play&at&order=cut`): the browser's Back and Forward step between the two, a reload or a link is +(`/clip/<id>?from=play&at&order=cut`; on a saved version, Edit goes to **Open in draft** first, a page of its own): the browser's Back and Forward step between the two, a reload or a link is the bench's own page, and **‹ Back to the cut** goes back the entries it pushed (no second Play in the history). Inside Play the bench walks the CUT's order (`order=cut`: p / n are the reel strip's neighbours, judged or not, `40 of 127`; the neighbours are read ahead). Back on Play the view is read again in place (`GET /api/report/play-view`), the deck @@ -684,11 +686,10 @@ history entry of its own), so **Edit this clip** (E) and then the browser's **Ba cut** — lands paused on the same second of the same clip. When an edit moved that clip in the cut, Play resumes by the clip and the offset into it, and says **Back at c02 · 00:03.0 (the cut changed)**. -**To judge a take clip by clip, walk it** (`/projects/<p>/takes/<id>/walk`, **Walk this take** on its card): -the clip bench on the take's own clips, whose verdicts, trims and removals go into the take's patch, never the -project's manifest; `umtool walk <p> --take <id>`, `umtool window <p> <clip> --take <id> …` and `umtool timeline -<p> --take <id> move|remove|undo` are the terminal's. **Make this the cut** (`umtool take <p> --id <id> --promote`) -puts the walked take over the project's manifest with one undo +**To judge a version clip by clip, open it in the draft** (**Open in draft** on its card or in Play) and walk the +draft; a take's clips are walked from a terminal only (`umtool walk <p> --take <id>`, `umtool window <p> <clip> +--take <id> …`, `umtool timeline <p> --take <id> move|remove|undo`), their saves into the take's patch. **Make this +the cut** (`umtool take <p> --id <id> --promote`) puts the take over the project's manifest with one undo ([report-video.md](report-video.md#walking-a-take-drafts-edits-into-the-take-and-making-it-the-cut)). | | In umtool | Keys | @@ -1576,19 +1577,17 @@ has the recipe. | the read's pieces, in the take | `umtool posts roles <p> <item> --set n=role --in-take <t>` | the take's entry's take parts | | the pick, a new read, a thread read, the mix | `umtool posts narrate <p> <item> --pick <n> \| --take [--thread …] \| --script "…" \| k=v --in-take <t>` | the take's entry; a new read's file in `<p>/narration/` under a number no file or entry has | | a re-join (no TTS) | `umtool posts reread <p> <item> --without parent:0 … --in-take <t>` | the take's entry, the new take picked there (the project keeps its pick) | -| pauses after words of the read (no TTS) | `umtool posts reread <p> <item> --pause "20=0.45,10=0.45" --in-take <t>` · the post bench's **pause after** on `?inTake=<t>` | the take's entry, the new take picked there (the project keeps its pick) | -| one phrase of the read re-voiced (TTS for that phrase only) | `umtool posts reread <p> <item> --revoice "20 10 4 0" --say "20... 10... 4... 0..." --in-take <t>` · the post bench's **re-voice a phrase** on `?inTake=<t>` | the take's entry, the new take picked there (the project keeps its pick); the piece in the project's `narration/parts-cache/` | +| pauses after words of the read (no TTS) | `umtool posts reread <p> <item> --pause "20=0.45,10=0.45" --in-take <t>` | the take's entry, the new take picked there (the project keeps its pick) | +| one phrase of the read re-voiced (TTS for that phrase only) | `umtool posts reread <p> <item> --revoice "20 10 4 0" --say "20... 10... 4... 0..." --in-take <t>` | the take's entry, the new take picked there (the project keeps its pick); the piece in the project's `narration/parts-cache/` | | an effect | `umtool posts fx <p> <item> add caption … --in-take <t>` | the take's entry's `fx` | | look, check, take back | `umtool timeline <p> --take <t>` · `umtool lint <p> --take <t>` (exit 0 clean) · `umtool timeline <p> --take <t> undo` | — / — / the take's newest edit, byte for byte | -**In umtool** (lane/ui-simplify): a take card's Options and the take walk's have **Check before render** (the lint), -**New draft from this take** (the next free `<take>-d<n>`) and **Add items from another project** (the project, the -items, by date or after/before an entry; **Preview** is `--dry-run`, then **Import into <take>**); New take has **Save -as a draft**. The post bench's **edits go to: take <t> only** scopes its set-item, fx and combo writes to the take -(`--in-take`), and its lanes: an attachment's in and out (the lane's handles, saved with **Save**), the read's lead -(dragged) and **Re-pick best** (`POST /api/report/post-narration {op: "set" | "fit" | "reread", inTake}`); recording a -read, a re-take and the mix are still the cut's bench's, and a read for the take is still the terminal's. A clip into a take only is the take walk's **+ Add a clip to -<take> only** (`umtool timeline <p> --take <t> insert <spec> --after <id>`). +**In umtool** (lane/ui-simplify): a take card's Options have **Check before render** (the lint), **New draft from this +take** (the next free `<take>-d<n>`) and **Add items from another project** (the project, the items, by date or +after/before an entry; **Preview** is `--dry-run`, then **Import into <take>**); New take has **Save as a draft**. The +post bench's take-only scope and the take walk's **+ Add a clip to <take> only** are RETIRED (umtool redesign L3: +every UI edit lands in the draft — open the take in the draft first); their writes are the terminal's (`--in-take`, +`umtool timeline <p> --take <t> insert <spec> --after <id>`, `POST /api/report/post-narration {…, inTake}`). Each edit is an undo point of the take's (`takes/<t>/revisions/`). An edit that changes nothing writes nothing. A take that is rendering is not edited (exit 1). The narration's lexicon and diff --git a/umtool/docs/report-video.md b/umtool/docs/report-video.md @@ -2544,6 +2544,11 @@ touched. A pruned take rebuilt, or used as a `--from` base, renders its work aga ### Walking a take: drafts, edits into the take, and making it the cut +> **The UI walks the draft only** (umtool redesign L3, [knobs.md](knobs.md#the-working-draft-and-saved-versions)): +> every UI edit lands in the project's manifest, a saved version is frozen, and the take walk's addresses are the +> **Open in draft** page. What follows is the TERMINAL's take walk (`umtool walk|window|timeline --take`), kept for +> agents. + A take can be **walked** on the clip bench like the project's own cut — its clips, played from the cached windows (a sub-window inside a fetched window plays without a new fetch), each confirmed, noted, trimmed, removed or moved — and every one of those edits goes into the **take's patch**, diff --git a/umtool/e2e/fixtures/take-walk-fixture.mjs b/umtool/e2e/fixtures/take-walk-fixture.mjs @@ -12,7 +12,8 @@ // t01b 3.50-6.00 no verdict -- where the walk starts // t01c 6.20-8.50 no verdict // -// Synthetic, like every fixture. +// take-walk-fixture also has a saved version v1 of the master (base.manifest.json) and the draft pointer +// naming it (takes/draft.json). Synthetic, like every fixture. // // `name`/`title`: the same project under another name, for a spec that must // not share it -- play-take-edit-fixture (play-take-edit.spec.ts: Play on the @@ -73,5 +74,21 @@ export function makeTakeWalkFixture({ reports, manifest, cachedWindow, name = "t baseHash, }), ); + // A SAVED VERSION of the master (lib/report/versions.mjs), take-walk-fixture's own: its frozen base, and the + // draft's parent (takes/draft.json) -- so the draft starts "from v1, no edits". + if (name === "take-walk-fixture") { + const text = readFileSync(path.join(dir, "video.manifest.json"), "utf8"); + write(path.join(dir, "takes", "v1"), "base.manifest.json", text); + write( + path.join(dir, "takes", "v1"), + "take.json", + json({ + id: "v1", group: "takes", order: 2, label: "Saved draft", kind: "reference", summary: "", changes: [], preview: "preview.mp4", + seconds: null, builtAt: null, style: null, patch: null, window: "full", version: true, draft: true, + draftedAt: "2026-11-09T10:00:00.000Z", savedAt: "2026-11-09T10:00:00.000Z", baseHash, + }), + ); + write(path.join(dir, "takes"), "draft.json", json({ from: "v1", hash: baseHash, at: "2026-11-09T10:00:00.000Z" })); + } return dir; } diff --git a/umtool/e2e/intro-play.spec.ts b/umtool/e2e/intro-play.spec.ts @@ -8,7 +8,7 @@ import * as urls from "./urls"; // THE INTRO AS A REAL, PLAYABLE BLOCK (lane intro-play; operator, 8 Nov 2026: "more first-class intro support (view // in play the cut)"; umtool/docs/knobs.md, "The intro, played and edited"): the cut's render.intro plays as the build // draws it -- its own page (report-to-video intro.mjs introPageHtml, composed by POST /api/report/chrome/intro) and -// its sound -- in Play, as Present's first slide, first on the walk; and the Cut tab's intro row opens an editor whose +// its sound -- in Play, as Present's first slide, first on the walk's stops; and the Cut tab's intro row opens an editor whose // live preview follows the unsaved knobs and whose Save writes the manifest. // // Fixture: e2e/fixtures/intro-play-fixture.mjs -- the Play cut opening on a title-card intro (the project's title, @@ -75,14 +75,9 @@ test("Present opens the deck on the intro slide, playing the build's page", asyn await expect(root).not.toHaveAttribute("data-present-slide", "brand-intro"); }); -test("the walk lists the intro first: the take walk's first row, and the walk's stops", async ({ page, request }) => { +test("the walk lists the intro first: the walk's stops (a version's old walk address asks to open it in the draft, L3)", async ({ page, request }) => { await page.goto(urls.takeWalkHref(PROJECT, "v1")); - const rows = page.locator("[data-take-walk-clips] tbody tr"); - await expect(rows.first()).toHaveAttribute("data-take-walk-intro", "title-card"); - await expect(rows.first()).toContainText("watched, not judged"); - await expect(rows.first()).toContainText("29 October 2026"); - await expect(rows.nth(1)).toHaveAttribute("data-take-walk-clip", /c0\d/); - await shot(page, "intro-walk.png"); + await expect(page.locator('[data-open-draft="v1"]')).toContainText("Open v1 in draft?"); const w = (await (await request.get(`/api/report/walk?project=${encodeURIComponent(PROJECT)}`)).json()) as { stops: string[]; intro: { style: string } | null; first: string | null }; expect(w.stops[0]).toBe("brand-intro"); expect(w.intro?.style).toBe("title-card"); diff --git a/umtool/e2e/play-take-edit.spec.ts b/umtool/e2e/play-take-edit.spec.ts @@ -81,13 +81,15 @@ test("Play on a version → Edit asks to open it in the draft (the draft saved f await expect(page.locator("[data-play-draft]")).toContainText(`Draft · from ${TAKE} · 1 edit`); }); -test("a reload of the take's bench from Play is the take's bench page: Back to the cut plays the take", async ({ page }) => { +test("a take's old bench address from Play asks first: the draft (1 edit since tight) would be saved as v2; Cancel plays the take", async ({ page }) => { + const before = manifestText(); await page.goto(urls.takeClipHref(P, TAKE, "t01c", { play: { at: 0.5 } })); - await expect(page.locator('[data-walk-take-edits="take"]')).toContainText("never the project’s cut"); - const back = page.locator("[data-back-to-play]"); - await expect(back).toBeVisible(); - await back.click(); - await expect(page).toHaveURL(new RegExp(`/play\\?take=${TAKE}&clip=t01c&at=0\\.50`)); + const ask = page.locator(`[data-open-draft="${TAKE}"]`); + await expect(ask).toHaveAttribute("data-open-draft-saves", "v2"); + await expect(ask.locator("[data-open-draft-said]")).toContainText(`Your draft (1 edit since ${TAKE}) is saved as v2 first`); + await ask.locator("[data-open-draft-cancel]").click(); + await expect(page).toHaveURL(new RegExp(`/play\\?take=${TAKE}`)); + expect(manifestText()).toBe(before); }); test("Edit on the draft's own parent with no edits goes straight on (308) to the draft's bench", async ({ page, request }) => { diff --git a/umtool/e2e/post-items.spec.ts b/umtool/e2e/post-items.spec.ts @@ -227,8 +227,8 @@ test("the post bench trims the video attachment and saves it; the cut's seconds await expect(page.locator('[data-entry="p-vid"] [data-post-seconds]')).toHaveText("4.7s"); }); -test("the take-only bench draws the attachment's lane: its out edge dragged into the take's patch, the field and the plan following, the project untouched; a GIF's lane has no sound and still drags", async ({ page }) => { - // A draft take of the cut (no patch yet: the project's timeline until its first edit), written here alone. +test("the post bench draws the attachment's lane: its out edge dragged into the DRAFT (an old take-only address is the draft's bench now), the field and the plan following; a GIF's lane has no sound and still drags", async ({ page }) => { + // The take-only scope is retired (L3: every edit lands in the draft): an old `?inTake=` address is the draft's bench. const takes = path.join(DIR, "takes"); rmSync(takes, { recursive: true, force: true }); const projectText = readFileSync(MANIFEST, "utf8"); @@ -237,15 +237,16 @@ test("the take-only bench draws the attachment's lane: its out edge dragged into id: "t1", group: "takes", order: 1, label: "Take one", kind: "different", summary: "", changes: [], preview: "preview.mp4", seconds: null, builtAt: null, style: null, patch: null, window: null, draft: true, draftedAt: "2026-11-05T00:00:00.000Z", baseHash: createHash("sha256").update(projectText).digest("hex"), }, null, 2) + "\n"); + const takeText = readFileSync(path.join(takes, "t1", "take.json"), "utf8"); try { await page.setViewportSize({ width: 1366, height: 1000 }); await page.goto(`${urls.postBenchHref(PROJECT, "p-vid")}?inTake=t1`); - await expect(page.locator('[data-post-bench-scope="t1"]')).toBeVisible(); - await expect(page.locator("[data-post-narration-in-take=t1] [data-post-bench-in-take-note]")).toBeVisible(); + await expect(page.locator('[data-post-bench-scope="cut"]')).toContainText("the draft"); const lane = page.locator('[data-post-lane="attachment"][data-post-lane-media="0"]'); await expect(lane).toBeVisible(); await expect(lane).toHaveAttribute("data-post-lane-kind", "video"); - await expect(lane).toHaveAttribute("data-post-lane-sel", "0.00-4.00"); + const start0 = (JSON.parse(projectText).timeline as Entry[]).find((e) => e.id === "p-vid")?.media?.[0]; + await expect(lane).toHaveAttribute("data-post-lane-sel", `${Number(start0?.start ?? 0).toFixed(2)}-${Number(start0?.end ?? 4).toFixed(2)}`); // Its sound's envelope arrives (the peaks route over the project file). await expect(lane).toHaveAttribute("data-post-lane-peaks", "on"); // Drag the out handle from the file's end to half way: 2 s. @@ -274,13 +275,12 @@ test("the take-only bench draws the attachment's lane: its out edge dragged into } await page.locator("[data-post-bench-save]").click(); await expect(page.locator("[data-post-bench-status]")).toHaveText("saved"); - const take = JSON.parse(readFileSync(path.join(takes, "t1", "take.json"), "utf8")) as { patch?: { timeline?: Entry[] } }; - const vid = (take.patch?.timeline ?? []).find((e) => e.id === "p-vid"); + const vid = (JSON.parse(readFileSync(MANIFEST, "utf8")).timeline as Entry[]).find((e) => e.id === "p-vid"); expect(vid?.media?.[0]?.end).toBeCloseTo(dragged + 0.1, 2); - expect(vid?.media?.[0]?.start).toBeUndefined(); - // The project's manifest byte for byte the same. - expect(readFileSync(MANIFEST, "utf8")).toBe(projectText); + // The take byte for byte the same; the draft put back for the specs after. + expect(readFileSync(path.join(takes, "t1", "take.json"), "utf8")).toBe(takeText); } finally { + writeFileSync(MANIFEST, projectText); rmSync(takes, { recursive: true, force: true }); } // A GIF (the combo fixture's p-c1, 2 s, no sound): the lane draws a flat line and its in handle still drags. diff --git a/umtool/e2e/post-narration.spec.ts b/umtool/e2e/post-narration.spec.ts @@ -397,9 +397,10 @@ test("RE-VOICE A PHRASE (operator, 5 Nov: the countdown gabbled, pauses cut into expect(n.takes[1].seconds).toBeCloseTo(n.takes[0].seconds + delta, 1); }); -test("RE-VOICE ON THE TAKE-ONLY BENCH (?inTake=): the phrase re-voiced into the take's patch, the project's manifest untouched", async ({ page }) => { +test("THE TAKE-ONLY BENCH IS RETIRED (L3): an old ?inTake= address is the draft's bench -- the re-voice lands in the draft, the take's take.json untouched", async ({ page }) => { // p-11's take timed (as Get word timings leaves it), then a draft take of the cut with no patch yet. - const doc = JSON.parse(readFileSync(MANIFEST, "utf8")) as { timeline: Array<Entry & { narration?: { takes?: Array<Take & { words?: unknown }> } }> }; + const original = readFileSync(MANIFEST, "utf8"); + const doc = JSON.parse(original) as { timeline: Array<Entry & { narration?: { takes?: Array<Take & { words?: unknown }> } }> }; const words = [["The", 0.1, 0.3], ["video", 0.35, 0.7], ["speaks", 0.75, 1.1], ["for", 1.15, 1.3], ["itself.", 1.35, 1.8]].map(([w, start, end]) => ({ w, start, end })); doc.timeline.find((e) => e.id === "p-11")!.narration!.takes![0].words = words; writeFileSync(MANIFEST, JSON.stringify(doc, null, 2)); @@ -411,25 +412,15 @@ test("RE-VOICE ON THE TAKE-ONLY BENCH (?inTake=): the phrase re-voiced into the id: "t1", group: "takes", order: 1, label: "Take one", kind: "different", summary: "", changes: [], preview: "preview.mp4", seconds: null, builtAt: null, style: null, patch: null, window: null, draft: true, draftedAt: "2026-11-05T00:00:00.000Z", baseHash: createHash("sha256").update(projectText).digest("hex"), }, null, 2) + "\n"); + const takeText = readFileSync(path.join(takes, "t1", "take.json"), "utf8"); try { await page.setViewportSize({ width: 1500, height: 1100 }); await page.goto(`${urls.postBenchHref(PROJECT, "p-11")}?inTake=t1`); - await expect(page.locator("[data-post-narration-in-take=t1]")).toBeVisible(); - const opts = page.locator('[data-panel-id="post-reread"]'); - await opts.locator("summary").click(); - const row = opts.locator("[data-post-reread-revoice-row]"); - await row.locator("[data-post-reread-revoice]").fill("speaks"); - await row.locator("[data-post-reread-revoice-say]").fill("talks loudly"); - await row.locator("[data-post-reread-revoice-go]").click(); - const status = page.locator("[data-post-narration-status]"); - await expect(status).toContainText("a new take, picked", { timeout: 30_000 }); - const t1 = JSON.parse(readFileSync(path.join(takes, "t1", "take.json"), "utf8")) as { patch?: { timeline?: Entry[] } }; - const n = t1.patch?.timeline?.find((e) => e?.id === "p-11")?.narration as { takes: Array<Take & { steps?: Array<{ op: string }> }>; pick?: number }; - expect(n.takes).toHaveLength(2); - expect(n.pick).toBe(1); - expect(n.takes[1].steps?.[0]?.op).toBe("revoice"); - expect(readFileSync(MANIFEST, "utf8")).toBe(projectText); + await expect(page.locator('[data-post-bench-scope="cut"]')).toContainText("the draft"); + await expect(page.locator("[data-post-narration-in-take]")).toHaveCount(0); } finally { + expect(readFileSync(path.join(takes, "t1", "take.json"), "utf8")).toBe(takeText); + writeFileSync(MANIFEST, original); rmSync(takes, { recursive: true, force: true }); } }); diff --git a/umtool/e2e/take-walk.spec.ts b/umtool/e2e/take-walk.spec.ts @@ -5,14 +5,16 @@ import { fileURLToPath } from "node:url"; import * as urls from "./urls"; // --------------------------------------------------------------------------- -// WALK A TAKE (umtool/docs/clip-bench.md, "Walking a take"): a draft take -- -// recorded, not rendered -- walked on the clip bench, every edit landing in -// the take's patch and none in the project's manifest; then made the cut. +// THE TAKE WALK'S OLD ADDRESSES (umtool redesign L3; was "walk a take": a draft take walked on the clip +// bench, every edit landing in its patch). Every edit lands in the draft now: the take walk +// (`…/takes/<t>/walk`) and a take's bench (`…/takes/<t>/clip/<id>`) are the Open in draft page -- it asks, +// saves the draft first, copies the take in -- then the DRAFT's bench; the take's take.json is never +// written. The walk's data route and `umtool walk --take` still read a take. // -// Fixture (fixtures/take-walk-fixture.mjs), written by this file alone: -// take-walk-fixture's master is one clip, w01; its draft take `tight` replaces -// the timeline with t01a (confirmed), t01b and t01c, all inside the cached -// vid1 0-9 s window. The tests run in order, each leaving what the next reads. +// Fixture (fixtures/take-walk-fixture.mjs), written by this file alone: take-walk-fixture's master is one +// clip, w01; its legacy draft take `tight` replaces the timeline with t01a (confirmed), t01b and t01c, all +// inside the cached vid1 0-9 s window; and a saved version `v1` of the master (its frozen base). The tests +// run in order, each leaving what the next reads. // --------------------------------------------------------------------------- test.describe.configure({ mode: "serial" }); @@ -21,10 +23,10 @@ const PROJECT = "reports/take-walk-fixture"; const TAKE = "tight"; const DIR = path.join(path.dirname(fileURLToPath(import.meta.url)), "..", ".e2e-song", "reports", "take-walk-fixture"); const manifestText = () => readFileSync(path.join(DIR, "video.manifest.json"), "utf8"); -const takeDoc = () => JSON.parse(readFileSync(path.join(DIR, "takes", TAKE, "take.json"), "utf8")); -const takeClip = (id: string) => (takeDoc().patch.timeline as { id: string; verdict?: string }[]).find((e) => e.id === id); +const takeText = () => readFileSync(path.join(DIR, "takes", TAKE, "take.json"), "utf8"); +const draftClip = (id: string) => (JSON.parse(manifestText()).timeline as { id: string; verdict?: string }[]).find((e) => e.id === id); -/** The bench's keys answer once it has hydrated (`x` focuses the note box). */ +/** The bench's keys answer once it has hydrated. */ const keyboardLive = async (page: import("@playwright/test").Page) => { // Live once the bench's own keys answer: `x` opens Reject ▾'s reasons, Escape closes them unasked. const menu = page.locator("[data-reject-menu]"); @@ -37,28 +39,32 @@ const keyboardLive = async (page: import("@playwright/test").Page) => { }; let masterBefore = ""; +let takeBefore = ""; test.beforeAll(() => { masterBefore = manifestText(); + takeBefore = takeText(); }); -test("the Takes page shows the draft as `draft — walk / render`, with Walk this take", async ({ page }) => { +test("the Takes page: the draft take and the saved version each Play and Open in draft -- no walk", async ({ page }) => { await page.goto(urls.takesHref(PROJECT)); const card = page.locator(`[data-take="${TAKE}"]`); - await expect(card.locator(`[data-take-draft="${TAKE}"]`)).toContainText("draft — walk / render"); - await expect(card.locator("[data-take-is-draft]")).toBeVisible(); - await expect(card.locator(`[data-take-walk-link="${TAKE}"]`)).toHaveAttribute("href", urls.takeWalkHref(PROJECT, TAKE)); + await expect(card.locator(`[data-take-draft="${TAKE}"]`)).toContainText("draft — not rendered"); + await expect(card.locator(`[data-take-open-draft="${TAKE}"]`)).toHaveAttribute("href", urls.openInDraftHref(PROJECT, TAKE)); + await expect(card.locator('[data-play-link="take-actions"]')).toHaveAttribute("href", urls.playHref(PROJECT, { take: TAKE })); + await expect(page.locator("[data-take-walk-link]")).toHaveCount(0); // Nothing rendered to use: the draft is made the cut, not "used". await expect(card.locator("[data-action=pick]")).toHaveCount(0); await expect(card.locator("[data-take-promote]")).toBeVisible(); + await expect(page.locator('[data-take="v1"] [data-take-draft="v1"]')).toContainText("saved version — not rendered"); }); -test("the take's walk: its clips in walk order, the walk starting at the first one needing a verdict", async ({ page, request }) => { +test("the walk's old address asks to open the take in the draft; the walk's data route still reads the take", async ({ page, request }) => { await page.goto(urls.takeWalkHref(PROJECT, TAKE)); - await expect(page.locator("[data-take-walk-clip]")).toHaveCount(3); - await expect(page.locator("[data-take-walk-go]")).toHaveAttribute("href", urls.takeClipHref(PROJECT, TAKE, "t01b")); - await page.locator("[data-take-walk-all]").click(); - await expect(page.locator("[data-take-walk-go]")).toHaveAttribute("href", urls.takeClipHref(PROJECT, TAKE, "t01a", { all: true })); - // The data route: the same reading. + const ask = page.locator(`[data-open-draft="${TAKE}"]`); + await expect(ask).toContainText(`Open ${TAKE} in draft?`); + // The draft (from v1, the master unchanged: no edits) has nothing to save. + await expect(ask.locator("[data-open-draft-said]")).toContainText("no edits since v1 — nothing to save"); + // The data route (and `umtool walk --take`): the same reading as before. const j = (await (await request.get(`/api/report/walk?project=${encodeURIComponent(PROJECT)}&take=${TAKE}`)).json()) as { first: string; take: { draft: boolean }; @@ -71,38 +77,32 @@ test("the take's walk: its clips in walk order, the walk starting at the first o ["t01b", true, true], ["t01c", true, true], ]); + expect(manifestText()).toBe(masterBefore); }); -test("confirming on the bench writes the take's patch, never the manifest, and walks on", async ({ page }) => { +test("a take's old bench address: asked, opened, then the DRAFT's bench on the clip -- a verdict lands in the draft, take.json untouched", async ({ page }) => { await page.goto(urls.takeClipHref(PROJECT, TAKE, "t01b")); - await expect(page.locator(`[data-take-walk="${TAKE}"]`)).toContainText("edits go to the take, not the cut"); - await expect(page.locator("[data-bench-kind]")).toHaveText("Take walk"); - // A take renders whole: no one-clip re-render of the project's segment here. - await expect(page.locator("[data-rerender]")).toHaveCount(0); + const ask = page.locator(`[data-open-draft="${TAKE}"]`); + await expect(ask).toContainText("the bench opens on t01b"); + await ask.locator("[data-open-draft-confirm]").click(); + await expect(page).toHaveURL(/\/projects\/reports\/take-walk-fixture\/clip\/t01b$/); + await expect(page.locator("[data-bench=t01b]")).toBeVisible({ timeout: 20_000 }); + expect((JSON.parse(manifestText()).timeline as { id: string }[]).map((e) => e.id)).toEqual(["t01a", "t01b", "t01c"]); + expect(takeText(), "the take is never written").toBe(takeBefore); await keyboardLive(page); await page.locator("body").press("y"); await expect(page.locator("[data-bench=t01c]")).toBeVisible(); - await expect.poll(() => takeClip("t01b")?.verdict).toBe("confirmed"); - expect(manifestText()).toBe(masterBefore); - expect(takeDoc().draft).toBe(true); + await expect.poll(() => draftClip("t01b")?.verdict).toBe("confirmed"); + expect(takeText()).toBe(takeBefore); }); -test("remove from the take, then undo the take's edit", async ({ page }) => { - await page.goto(urls.takeClipHref(PROJECT, TAKE, "t01c")); - await expect(page.locator(`[data-take-walk="${TAKE}"]`)).toBeVisible(); - await page.locator("[data-take-remove=t01c]").click(); - await expect.poll(() => (takeDoc().patch.timeline as { id: string }[]).map((e) => e.id)).toEqual(["t01a", "t01b"]); - await page.goto(urls.takeClipHref(PROJECT, TAKE, "t01b")); - await page.locator("[data-take-undo]").click(); - await expect.poll(() => (takeDoc().patch.timeline as { id: string }[]).map((e) => e.id)).toEqual(["t01a", "t01b", "t01c"]); - expect(manifestText()).toBe(masterBefore); -}); - -test("Make this the cut: the take's walked timeline becomes the project's", async ({ page }) => { - await page.goto(urls.takeWalkHref(PROJECT, TAKE)); - await page.locator(`[data-take-actions="${TAKE}"] [data-take-promote]`).click(); - await expect(page.locator("[data-take-promoted]")).toBeVisible(); - const m = JSON.parse(manifestText()) as { timeline: { id: string; verdict?: string }[] }; - expect(m.timeline.map((e) => e.id)).toEqual(["t01a", "t01b", "t01c"]); - expect(m.timeline[1].verdict).toBe("confirmed"); +test("the draft's own parent with no edits: the old bench address goes straight on (308)", async ({ request }) => { + const r = await request.post("/api/report/takes/save", { data: { project: PROJECT } }); + expect(await r.json()).toMatchObject({ saved: true, id: "v2" }); + const res = await request.get(urls.takeClipHref(PROJECT, "v2", "t01c"), { maxRedirects: 0 }); + expect(res.status()).toBe(308); + expect(res.headers()["location"]).toMatch(/\/projects\/reports\/take-walk-fixture\/clip\/t01c$/); + // A take that is not the parent still asks. + const asks = await request.get(urls.takeWalkHref(PROJECT, TAKE), { maxRedirects: 0 }); + expect(asks.status()).toBe(200); });