Archilyzer · Source

archilyzer

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

commit 0c1443708f15838602c88f51adc293009eb45fa3
parent cfccf67e9efc30c168e80673d348b4845fd4835b
Author: I Mean I'm Just Saying <imeanimjustsaying@kiwifarms.st>
Date:   Mon,  2 Nov 2026 13:47:41 -0500

umtool play: Edit this clip on a take with its own timeline opens THAT TAKE's bench (in place, `/takes/<take>/clip/<id>?from=play`), its save into takes/<take>/take.json and Back playing the take -- never the project's clip of the same id (2 Nov: an edge fixed from Play on kirsche-7's kr1 landed in in-her-words' manifest); a take without its own timeline keeps the project's bench

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

Diffstat:
Mumtool/components/projects/ClipBench.tsx | 28+++++++++++++++++++---------
Mumtool/components/projects/cutApp/CutApp.tsx | 31+++++++++++++++++++++++--------
Mumtool/components/projects/review/PlayCut.tsx | 30++++++++++++++++++++----------
Mumtool/e2e/fixtures/make-fixture.mjs | 2++
Mumtool/e2e/fixtures/take-walk-fixture.mjs | 12++++++++----
Aumtool/e2e/play-take-edit.spec.ts | 99+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Mumtool/lib/hrefs.ts | 16+++++++++++++---
Mumtool/lib/report/benchData.ts | 21+++++++++++++--------
8 files changed, 197 insertions(+), 42 deletions(-)

diff --git a/umtool/components/projects/ClipBench.tsx b/umtool/components/projects/ClipBench.tsx @@ -321,7 +321,8 @@ export type ClipBenchData = { * returns -- the project's cut at this clip -- and the take that was playing, * if one was (its render does not change when this manifest does). */ - fromPlay?: { href: string; take: string | null } | null; + /** Opened from Play: where Back lands; the take that was playing; `editsTake`: this bench edits that take (its own timeline). */ + fromPlay?: { href: string; take: string | null; editsTake?: boolean } | null; /** Walk → Play: the cut from this clip (the bench opened on its own, not from Play, not a take's). */ playHere?: string | null; /** The working cut's name (lib/report/workingCut.mjs): the latest whole-cut take and the edits since it. */ @@ -3028,12 +3029,19 @@ export default function ClipBench({ <p data-walk-quote="" className="m-0 font-serif text-[18px] leading-snug text-text"> {draft.quote.trim() ? `“${draft.quote.trim()}”` : <span className="text-muted">no quote on this entry</span>} </p> - {data.fromPlay?.take && ( - <p data-walk-take-note={data.fromPlay.take} className="m-0 text-[12.5px] leading-snug text-text-2"> - Opened from take <span className="font-mono">{data.fromPlay.take}</span>. Edits here go to the project&rsquo;s cut, not - to the take&rsquo;s render, so Back plays the project&rsquo;s cut. - </p> - )} + {data.fromPlay?.take && + (data.fromPlay.editsTake ? ( + <p data-walk-take-note={data.fromPlay.take} data-walk-take-edits="take" className="m-0 text-[12.5px] leading-snug text-text-2"> + Opened from take <span className="font-mono">{data.fromPlay.take}</span>, which has its own timeline. Edits here go to the + take (<code className="font-mono">takes/{data.fromPlay.take}/take.json</code>), never the project&rsquo;s cut; Back plays + the take. + </p> + ) : ( + <p data-walk-take-note={data.fromPlay.take} className="m-0 text-[12.5px] leading-snug text-text-2"> + Opened from take <span className="font-mono">{data.fromPlay.take}</span>. Edits here go to the project&rsquo;s cut, not + to the take&rsquo;s render, so Back plays the project&rsquo;s cut. + </p> + ))} </div> {cached && ( <EdgeStrip @@ -3290,8 +3298,10 @@ export default function ClipBench({ {unsaved ? "Save and back to the cut" : "‹ Back to the cut"} </button> {data.fromPlay.take && ( - <span data-back-take={data.fromPlay.take} className="ml-2 text-[11.5px] text-muted-2"> - edits go to the project&rsquo;s cut, not take {data.fromPlay.take} + <span data-back-take={data.fromPlay.take} data-back-take-edits={data.fromPlay.editsTake ? "take" : "cut"} className="ml-2 text-[11.5px] text-muted-2"> + {data.fromPlay.editsTake + ? `edits go to take ${data.fromPlay.take}, not the project’s cut` + : <>edits go to the project&rsquo;s cut, not take {data.fromPlay.take}</>} </span> )} </>, diff --git a/umtool/components/projects/cutApp/CutApp.tsx b/umtool/components/projects/cutApp/CutApp.tsx @@ -27,6 +27,10 @@ import type { BenchTopSpec } from "@/lib/report/benchData"; // the CUT's order here (p / n are the reel strip's neighbours). Back on Play // the view is read again (router.refresh: the bench may have saved), and // Play recomposes only when the manifest's token moved. +// +// A TAKE WITH ITS OWN TIMELINE is edited on its own bench (PlayCut's Edit: +// `/takes/<take>/clip/<id>?from=play`) -- in place too, the bench's data asked +// with `walkTake`, so its saves go into the take's patch and Back plays it. // --------------------------------------------------------------------------- type View = { kind: "play" } | { kind: "clip"; id: string; href: string }; @@ -43,13 +47,21 @@ const Ctx = createContext<CutAppApi | null>(null); /** Play's handle on the app: null when Play is drawn on its own (a test page, an old build). */ export const useCutApp = () => useContext(Ctx); -/** The clip id in a bench address of this project, or null. */ -function clipOf(pathname: string, project: string): string | null { - const base = `/projects/${project.split("/").map(encodeURIComponent).join("/")}/clip/`; - if (!pathname.startsWith(base)) return null; - const rest = pathname.slice(base.length); - return rest && !rest.includes("/") ? decodeURIComponent(rest) : null; +/** + * The clip id in a bench address of this project, or null: the cut's + * (`/clip/<id>`) or a take's (`/takes/<take>/clip/<id>`, `take` set). + */ +function benchOf(pathname: string, project: string): { id: string; take: string | null } | null { + const root = `/projects/${project.split("/").map(encodeURIComponent).join("/")}/`; + if (!pathname.startsWith(root)) return null; + const rest = pathname.slice(root.length).split("/"); + if (rest.length === 2 && rest[0] === "clip" && rest[1]) return { id: decodeURIComponent(rest[1]), take: null }; + if (rest.length === 4 && rest[0] === "takes" && rest[1] && rest[2] === "clip" && rest[3]) { + return { id: decodeURIComponent(rest[3]), take: decodeURIComponent(rest[1]) }; + } + return null; } +const clipOf = (pathname: string, project: string): string | null => benchOf(pathname, project)?.id ?? null; const isPlay = (pathname: string, project: string) => pathname === `/projects/${project.split("/").map(encodeURIComponent).join("/")}/play`; export default function CutApp({ project, playTop, children }: { project: string; playTop: React.ReactNode; children: React.ReactNode }) { @@ -80,6 +92,9 @@ export default function CutApp({ project, playTop, children }: { project: string q.set("project", project); q.set("clip", id); q.set("order", "cut"); + // A take's bench (its own timeline): the take's clip, its saves into the take's patch. + const walkTake = benchOf(u.pathname, project)?.take; + if (walkTake) q.set("walkTake", walkTake); return fetch(`/api/report/bench?${q.toString()}`, { cache: "no-store" }).then(async (r) => ({ ok: r.ok, status: r.status, body: (await r.json().catch(() => ({}))) as Bench & { error?: string } })); }, [project], @@ -149,7 +164,7 @@ export default function CutApp({ project, playTop, children }: { project: string return; } const id = clipOf(u.pathname, project); - if (id && !u.pathname.includes("/takes/")) { + if (id) { openClip(id, `${u.pathname}${u.search}`); return; } @@ -189,7 +204,7 @@ export default function CutApp({ project, playTop, children }: { project: string if (!a || a.target === "_blank") return; const u = new URL(a.href, window.location.origin); if (u.origin !== window.location.origin) return; - if (isPlay(u.pathname, project) || (clipOf(u.pathname, project) && !u.pathname.includes("/takes/"))) { + if (isPlay(u.pathname, project) || clipOf(u.pathname, project)) { e.preventDefault(); e.stopPropagation(); navigate(`${u.pathname}${u.search}`); diff --git a/umtool/components/projects/review/PlayCut.tsx b/umtool/components/projects/review/PlayCut.tsx @@ -6,7 +6,7 @@ import { buttonVariants } from "@/components/ui/button"; import { useSharedNotes } from "@/components/notes/NotesProvider"; import { NoteThread } from "@/components/notes/NoteThread"; import type { Anchor, CutAsk, Note } from "@/lib/annotations/types"; -import { clipBenchHref } from "@/lib/hrefs"; +import { clipBenchHref, takeClipHref } from "@/lib/hrefs"; import { cn } from "@/lib/utils"; import { footageAt } from "@/lib/report/footage-move.mjs"; import { finaleUp, stampAt, tallyAt } from "@/lib/report/liveClock.mjs"; @@ -80,8 +80,13 @@ import AddPost from "./AddPost"; // 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's Edit goes to the project's manifest too (a take's render does not -// change), and its Back plays the project's cut; the bench says so. +// 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). // // 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 @@ -575,8 +580,11 @@ export default function PlayCut({ const e = now(); const it = planRef.current.items[e.cur]; if (!it?.clip) return null; - return clipBenchHref(project, it.id, { play: { at: Math.round(Math.max(0, e.t - it.from) * 100) / 100, take: view.take?.defaulted ? null : take } }); - }, [project, take, now, view.take?.defaulted]); + const at = Math.round(Math.max(0, e.t - it.from) * 100) / 100; + // A take with its own timeline: ITS bench, its patch (never the project's clip of the same id). + if (take && view.take?.ownTimeline) return takeClipHref(project, take, it.id, { play: { at } }); + return clipBenchHref(project, it.id, { play: { at, take: view.take?.defaulted ? null : take } }); + }, [project, take, now, view.take?.defaulted, view.take?.ownTimeline]); /** Play's place as its own URL: the clip on screen, the offset into it, the cut second, the toggle. */ const placeHref = useCallback(() => { const e = now(); @@ -916,7 +924,7 @@ export default function PlayCut({ {view.take.defaulted ? "the latest take, " : ""}take “{view.take.label}”: the project&rsquo;s cut as it is now with its patch ({view.take.from}){view.take.made ? "" : " — not rendered yet"} {view.take.summary ? ` · ${view.take.summary}` : ""} {view.take.ownTimeline - ? " — it has its own timeline: edits to the cut do not show in it, and nothing here edits it (walk the take)" + ? " — it has its own timeline: edits to the cut do not show in it; Edit this clip opens the take's own bench (its patch)" : " · edits here go to the cut, and show at once"} </p> ) : ( @@ -1020,15 +1028,17 @@ export default function PlayCut({ {/* The clip on the bench, and back here after (E). */} <button type="button" - data-play-edit="" + data-play-edit={take && view.take?.ownTimeline ? "take" : ""} disabled={!item?.clip} onClick={editHere} className={cn(buttonVariants({ variant: "outline", size: "sm" }))} title={ item?.clip - ? take - ? "edit this clip on the bench (E): the edit goes to the project's cut, not this take's render; Back plays the project's cut" - : "edit this clip on the bench (E); Back to the cut returns here" + ? take && view.take?.ownTimeline + ? `edit this clip on take ${take}'s bench (E): the edit goes to the take's own timeline (takes/${take}/take.json), never the project's cut; Back plays this take` + : take + ? "edit this clip on the bench (E): the edit goes to the project's cut, not this take's render; Back plays the project's cut" + : "edit this clip on the bench (E); Back to the cut returns here" : "a card is not edited on the clip bench" } > diff --git a/umtool/e2e/fixtures/make-fixture.mjs b/umtool/e2e/fixtures/make-fixture.mjs @@ -1876,6 +1876,8 @@ makeClipEditorFixture({ reports, manifest, cachedWindow: path.join(REPORT, "out" makeBenchShellFixture({ reports, manifest, cachedWindow: path.join(REPORT, "out", "clips-raw", "vid1_0.00-9.00.mp4") }); // Walk a take: a draft take of sub-windows, walked on the bench (take-walk.spec.ts). makeTakeWalkFixture({ reports, manifest, cachedWindow: path.join(REPORT, "out", "clips-raw", "vid1_0.00-9.00.mp4") }); +// play-take-edit.spec.ts: the same draft take with its own timeline, played and edited from Play (its own copy). +makeTakeWalkFixture({ reports, manifest, cachedWindow: path.join(REPORT, "out", "clips-raw", "vid1_0.00-9.00.mp4"), name: "play-take-edit-fixture", title: "The Play Take Edit Fixture" }); // Cut integrity (UI notes 2026-10-30): the cite following the edge, repeatOf, ★ and walk notes, take patch markers, the QR link check (cut-integrity.spec.ts). makeCutIntegrityFixture({ reports, manifest, cachedWindow: path.join(REPORT, "out", "clips-raw", "vid1_0.00-9.00.mp4") }); // ui-ops.spec's own project and channels (UI notes #9 #10 #15 #18). diff --git a/umtool/e2e/fixtures/take-walk-fixture.mjs b/umtool/e2e/fixtures/take-walk-fixture.mjs @@ -13,6 +13,10 @@ // t01c 6.20-8.50 no verdict // // 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 +// take, Edit, an edge saved into the take and never the manifest). import { copyFileSync, mkdirSync, readFileSync, writeFileSync } from "node:fs"; import { createHash } from "node:crypto"; import path from "node:path"; @@ -24,17 +28,17 @@ const write = (dir, name, text) => { const json = (doc) => JSON.stringify(doc, null, 2) + "\n"; /** - * @param {{ reports: string, manifest: Function, cachedWindow: string }} o + * @param {{ reports: string, manifest: Function, cachedWindow: string, name?: string, title?: string }} o * `manifest` is make-fixture's manifest(slug, title, provenance, timeline); * `cachedWindow` the vid1 0-9 s window the build fixtures share. */ -export function makeTakeWalkFixture({ reports, manifest, cachedWindow }) { - const dir = path.join(reports, "take-walk-fixture"); +export function makeTakeWalkFixture({ reports, manifest, cachedWindow, name = "take-walk-fixture", title = "The Take Walk Fixture" }) { + const dir = path.join(reports, name); const clip = (id, start, end, extra = {}) => ({ type: "clip", id, video: "vid1", start, end, cite: start, section: 0, lock: true, ...extra }); write( dir, "video.manifest.json", - json(manifest("take-walk-fixture", "The Take Walk Fixture", { siteOrigin: "https://archive.example" }, [ + json(manifest(name, title, { siteOrigin: "https://archive.example" }, [ clip("w01", 1.0, 8.0, { verdict: "confirmed", quote: "the whole of it" }), ])), ); diff --git a/umtool/e2e/play-take-edit.spec.ts b/umtool/e2e/play-take-edit.spec.ts @@ -0,0 +1,99 @@ +import { test, expect } from "@playwright/test"; +import { readFileSync } from "node:fs"; +import path from "node:path"; +import { fileURLToPath } from "node:url"; +import * as urls from "./urls"; + +// --------------------------------------------------------------------------- +// PLAY'S EDIT ON A TAKE WITH ITS OWN TIMELINE edits THAT TAKE (2 Nov: an edge +// fixed from Play on `kirsche-7`'s kr1 landed in the project's +// video.manifest.json, the cut's clip of the same id, not in the take). +// +// play-take-edit-fixture (fixtures/take-walk-fixture.mjs, written for this +// file alone): the master is one clip, w01 1.00-8.00; the DRAFT take `tight` +// replaces the timeline (its own timeline) with t01a, t01b 3.50-6.00 and +// t01c, all inside the cached vid1 0-9 s window. Edit from Play on the take +// opens the TAKE's bench in place; an edge saved there lands in +// takes/tight/take.json and the project's manifest stays byte for byte. +// --------------------------------------------------------------------------- + +test.describe.configure({ mode: "serial" }); + +const P = "reports/play-take-edit-fixture"; +const TAKE = "tight"; +const DIR = path.join(path.dirname(fileURLToPath(import.meta.url)), "..", ".e2e-song", "reports", "play-take-edit-fixture"); +const manifestText = () => readFileSync(path.join(DIR, "video.manifest.json"), "utf8"); +const takeClip = (id: string) => + (JSON.parse(readFileSync(path.join(DIR, "takes", TAKE, "take.json"), "utf8")).patch.timeline as { id: string; start: number; end: number }[]).find( + (e) => e.id === id, + )!; + +test.beforeEach(() => { + test.setTimeout(120_000); +}); + +test("Play on a take with its own timeline → Edit opens the TAKE's bench; an edge saved there is the take's, the manifest untouched; Back plays the take", async ({ page }) => { + const before = manifestText(); + expect(takeClip("t01b").end).toBe(6); + await page.setViewportSize({ width: 1366, height: 1000 }); + await page.goto(urls.playHref(P, { take: TAKE })); + const root = page.locator("[data-play-cut]"); + await expect(root).toHaveAttribute("data-play-state", "paused", { timeout: 30_000 }); + await expect(page.locator(`[data-play-take="${TAKE}"]`)).toContainText("Edit this clip opens the take's own bench"); + await page.locator('[data-play-row="t01b"]').press("Enter"); + await expect(root).toHaveAttribute("data-play-item", "t01b"); + const edit = page.locator("[data-play-edit]"); + await expect(edit).toHaveAttribute("data-play-edit", "take"); + await expect(edit).toHaveAttribute("title", /takes\/tight\/take\.json/); + await edit.click(); + + // In place, on the take's bench: its address, its note, its edits. + const bench = page.locator('[data-cut-app-bench="t01b"]'); + await expect(bench.locator('[data-bench-shell="clip"]')).toBeVisible({ timeout: 20_000 }); + await expect(page).toHaveURL(new RegExp(`/takes/${TAKE}/clip/t01b\\?from=play.*order=cut`)); + await expect(bench.locator("[data-bench-kind]")).toHaveText("Take walk"); + await expect(bench.locator(`[data-back-take="${TAKE}"]`)).toHaveAttribute("data-back-take-edits", "take"); + await expect(bench.locator(`[data-back-take="${TAKE}"]`)).toContainText(`edits go to take ${TAKE}, not the project`); + await page.screenshot({ path: test.info().outputPath("play-take-edit-bench.png") }); + + // An edge: the end +0.05 s (`.`), saved. + const save = bench.locator("[data-save-window]"); + await expect(async () => { + await page.locator("body").press("."); + await expect(save).toBeEnabled({ timeout: 500 }); + }).toPass({ timeout: 10_000 }); + await save.click(); + await expect.poll(() => takeClip("t01b").end).toBeGreaterThan(6); + expect(takeClip("t01b").start).toBe(3.5); + expect(manifestText(), "the project's manifest is byte-identical").toBe(before); + + // Back to the cut: Play on the same take, the same clip. + await bench.locator("[data-back-to-play]").click(); + await expect(page.locator("[data-cut-app-play]")).toHaveAttribute("data-cut-app-play", "shown"); + await expect(page).toHaveURL(new RegExp(`/play\\?take=${TAKE}`)); + await expect(root).toHaveAttribute("data-play-item", "t01b"); + await expect(page.locator(`[data-play-take="${TAKE}"]`)).toBeVisible(); + expect(manifestText()).toBe(before); +}); + +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 }) => { + 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`)); +}); + +test("a take WITHOUT its own timeline keeps today's Edit: the project's bench", async ({ page }) => { + // play-walk-fixture's draft-1 is a whole-cut take (no timeline in its patch). + await page.goto(urls.playHref("reports/play-walk-fixture", { take: "draft-1" })); + const root = page.locator("[data-play-cut]"); + await expect(root).toHaveAttribute("data-play-state", "paused", { timeout: 30_000 }); + await page.locator('[data-play-row="c02"]').press("Enter"); + const edit = page.locator("[data-play-edit]"); + await expect(edit).toHaveAttribute("data-play-edit", ""); + await edit.click(); + await expect(page.locator('[data-cut-app-bench="c02"] [data-bench-shell="clip"]')).toBeVisible({ timeout: 20_000 }); + await expect(page).toHaveURL(/\/projects\/reports\/play-walk-fixture\/clip\/c02\?from=play/); +}); diff --git a/umtool/lib/hrefs.ts b/umtool/lib/hrefs.ts @@ -315,11 +315,21 @@ export function takeWalkHref(project: string, take: string, q: NoteOpt & { all?: return withQuery(`/projects/${encodePath(project)}/takes/${encodeURIComponent(take)}/walk`, { all: q.all }, q.note); } -/** The clip bench on one of a take's clips: its saves go into the take's patch, never the project's manifest. */ -export function takeClipHref(project: string, take: string, clip: string, q: NoteOpt & { all?: boolean } = {}): string { +/** + * The clip bench on one of a take's clips: its saves go into the take's patch, never the project's manifest. + * `play`: opened from Play on this take (Edit this clip, on a take with its own timeline) -- the bench offers + * "Back to the cut", landing on Play of THIS take `at` seconds into the clip. + */ +export function takeClipHref( + project: string, + take: string, + clip: string, + q: NoteOpt & { all?: boolean; play?: { at?: number | null } | null } = {}, +): string { + const play = q.play; return withQuery( `/projects/${encodePath(project)}/takes/${encodeURIComponent(take)}/clip/${encodeURIComponent(clip)}`, - { all: q.all }, + { all: q.all, ...(play ? { from: "play", at: play.at != null && play.at > 0 ? play.at.toFixed(2) : null } : {}) }, q.note, ); } diff --git a/umtool/lib/report/benchData.ts b/umtool/lib/report/benchData.ts @@ -228,16 +228,20 @@ export async function clipBenchData( // so "Back to the cut" survives walking on; `at` is only ever the clip Play // was on. Back lands on the PROJECT's cut, positioned by clip id plus the // offset into it -- never by raw cut seconds, which the edit just moved for - // everything after this clip. A take's render does not change when the - // project's manifest does, so a take's Back is the project's cut too, and - // the bench says so (`take`). - const fromPlay = !take && search.from === "play"; + // everything after this clip. A take without a timeline of its own plays + // the project's cut, so its Edit lands here and its Back is the project's + // cut too, and the bench says so (`take`). A take WITH its own timeline is + // walked on its own bench (`take`: `…/takes/<take>/clip/<id>?from=play`): + // its saves go into the take's patch, and Back plays that take. + const fromPlay = search.from === "play"; const withOrder = (h: string) => (order === "cut" ? `${h}${h.includes("?") ? "&" : "?"}order=cut` : h); - const playTake = fromPlay && search.take ? search.take : null; + const playTake = take && fromPlay ? take : fromPlay && search.take ? search.take : null; const atRaw = Number(search.at); const at = fromPlay && Number.isFinite(atRaw) && atRaw > 0 ? atRaw : 0; const href = (id: string) => - take ? takeClipHref(project.id, take, id, { all }) : withOrder(clipBenchHref(project.id, id, fromPlay ? { play: { take: playTake } } : {})); + take + ? withOrder(takeClipHref(project.id, take, id, { all, play: fromPlay ? {} : null })) + : withOrder(clipBenchHref(project.id, id, fromPlay ? { play: { take: playTake } } : {})); data.walkHrefs = { prev: prev ? href(prev) : null, next: next ? href(next) : null, @@ -255,12 +259,13 @@ export async function clipBenchData( takesHref: takesHref(project.id), walkHref: takeWalkHref(project.id, take, { all }), toggleAllHref: takeClipHref(project.id, take, clipId, { all: !all }), - clipHref: Object.fromEntries(data.siblings.map((sb: { id: string }) => [sb.id, takeClipHref(project.id, take, sb.id, { all })])), + clipHref: Object.fromEntries(data.siblings.map((sb: { id: string }) => [sb.id, takeClipHref(project.id, take, sb.id, { all, play: fromPlay ? {} : null })])), at: timeline.findIndex((e) => e.id === clipId), entries: timeline.length, }; } - data.fromPlay = fromPlay ? { href: playHref(project.id, { take: playTake, clip: clipId, at }), take: playTake } : null; + // `editsTake`: this bench writes the take Play was playing (its own timeline), not the project's cut. + data.fromPlay = fromPlay ? { href: playHref(project.id, { take: playTake, clip: clipId, at }), take: playTake, editsTake: !!take } : null; // Walk → Play (the audit's "no way back"): the cut, from this clip. data.playHere = take || fromPlay ? null : playHref(project.id, { clip: clipId }); // The working cut's name: the bench edits the project's manifest, the latest take is what it was made into.