Archilyzer · Source

archilyzer

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

commit e269648f366f60cacb59fbd51e8b76e874770973
parent bb69d565cad59b964e71f5ce2b8be54d4f8b0d99
Author: I Mean I'm Just Saying <imeanimjustsaying@kiwifarms.st>
Date:   Mon,  2 Nov 2026 02:11:10 -0500

umtool: the lane's fixes from its e2e runs -- Cancel's answer outlives the row, Propose tight windows is a toolbar button, Export ▾ opens from the edge it sits at

- Cancel render: the refresh after a stopped render takes the "rendering now"
  row (and a card's button) away, and the answer went with it. It is held by
  the parent that stays (CancelSaidLine, data-take-cancel-said=<take>).
- Propose tight windows sat under the timeline as a section, and the taller
  page moved where a centred drag target scrolls to: cut-sections.spec's
  bar-onto-c01 drag lost its drop. It is now one button among the Cut tab's
  tools, adding no height; the review list opens on a line of its own under
  them once pressed.
- Export ▾'s options opened rightwards from the bench reader's right edge and
  were clipped; `align="end"` there.
- knobs.md: a project's variant is not the encode ladder's.

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

Diffstat:
Mumtool/components/projects/ClipBench.tsx | 2+-
Mumtool/components/projects/ClipExport.tsx | 9+++++++--
Mumtool/components/projects/TakeVariants.tsx | 42++++++++++++++++++++++++++++--------------
Mumtool/components/projects/TakesBench.tsx | 7+++++--
Mumtool/components/projects/report/CutTab.tsx | 5++---
Mumtool/components/projects/report/TightWindowsPanel.tsx | 26+++++++++++++++++---------
Mumtool/docs/knobs.md | 3++-
Mumtool/e2e/take-variants.spec.ts | 5++++-
8 files changed, 66 insertions(+), 33 deletions(-)

diff --git a/umtool/components/projects/ClipBench.tsx b/umtool/components/projects/ClipBench.tsx @@ -2795,7 +2795,7 @@ export default function ClipBench({ > Play clip </button> - <ClipExportButtons exp={clipExport} clip={clip.id} surface="paper" why={cached ? null : "its window is not fetched — fetch it first"} unsaved={unsaved} around={clipAround} /> + <ClipExportButtons exp={clipExport} clip={clip.id} surface="paper" why={cached ? null : "its window is not fetched — fetch it first"} unsaved={unsaved} around={clipAround} align="end" /> <ClipExportStatus exp={clipExport} surface="paper" /> </> } diff --git a/umtool/components/projects/ClipExport.tsx b/umtool/components/projects/ClipExport.tsx @@ -156,6 +156,7 @@ export function ClipExportButtons({ why = null, unsaved = false, around = null, + align = "start", }: { exp: ClipExportHandle; clip: string | null; @@ -166,13 +167,15 @@ export function ClipExportButtons({ unsaved?: boolean; /** The clip's extent (source seconds): the full exchange's span starts from it. */ around?: { start: number; end: number } | null; + /** Which edge of Export ▾ its options open from: "end" on the bench's reader, at the screen's right edge. */ + align?: "start" | "end"; }) { const hydrated = useHydrated(); const off = !hydrated || !clip || !!why || exp.busy; const saved = unsaved ? " — of the SAVED window: save first to export your edit" : ""; return ( <> - <ExportMenu exp={exp} clip={clip} surface={surface} around={around} saved={saved} disabled={!hydrated || !clip || exp.busy} /> + <ExportMenu exp={exp} clip={clip} surface={surface} around={around} saved={saved} align={align} disabled={!hydrated || !clip || exp.busy} /> <button type="button" data-clip-export-go={clip ?? ""} @@ -212,6 +215,7 @@ function ExportMenu({ surface, around, saved, + align, disabled, }: { exp: ClipExportHandle; @@ -219,6 +223,7 @@ function ExportMenu({ surface: Surface; around: { start: number; end: number } | null; saved: string; + align: "start" | "end"; disabled: boolean; }) { const [open, setOpen] = useState(false); @@ -277,7 +282,7 @@ function ExportMenu({ role="menu" aria-label={`export ${clip ?? ""}`} data-clip-export-options="" - className="absolute bottom-full left-0 z-30 mb-1 flex w-[19rem] max-w-[calc(100vw-2rem)] flex-col gap-2 rounded border border-[var(--color-line)] bg-[var(--color-panel)] p-2 text-[12px] text-[var(--color-text)] shadow-lg" + className={`absolute bottom-full ${align === "end" ? "right-0" : "left-0"} z-30 mb-1 flex w-[19rem] max-w-[calc(100vw-2rem)] flex-col gap-2 rounded border border-[var(--color-line)] bg-[var(--color-panel)] p-2 text-[12px] text-[var(--color-text)] shadow-lg`} > <div className="flex flex-col gap-0.5"> <button type="button" role="menuitem" data-clip-export-kind="cut" className={item} onClick={() => go("cut")} title={`the clip as the cut plays it: its edges, gaps out, its mute; no deck${saved}`}> diff --git a/umtool/components/projects/TakeVariants.tsx b/umtool/components/projects/TakeVariants.tsx @@ -35,36 +35,48 @@ async function housekeeping(body: Record<string, unknown>) { return { ok: r.ok, j }; } -/** Cancel: asks the process rendering the take to stop, and waits for it (up to ~25 s). */ -export function CancelRender({ project, take, ready }: { project: string; take: string; ready: boolean }) { +export type CancelSaid = { take: string; text: string; ok: boolean }; + +/** + * Cancel: asks the process rendering the take to stop, and waits for it (up to ~25 s). + * The answer goes to `onSaid` -- held by a parent that outlives this button, because a + * render that stopped is no longer rendering, and the refresh takes the button away. + */ +export function CancelRender({ project, take, ready, onSaid }: { project: string; take: string; ready: boolean; onSaid: (s: CancelSaid) => void }) { const router = useRouter(); - const [state, setState] = useState<{ k: "idle" } | { k: "cancelling" } | { k: "done"; said: string; ok: boolean }>({ k: "idle" }); + const [busy, setBusy] = useState(false); return ( <span className="inline-flex flex-wrap items-center gap-1.5" data-take-cancel={take}> <button type="button" data-action="cancel-render" - disabled={!ready || state.k === "cancelling" || (state.k === "done" && state.ok)} + disabled={!ready || busy} className={`${buttonVariants({ variant: "outline", size: "sm" })} border-[var(--color-bad)] text-[var(--color-bad)]`} title="stop this take's render: the process rendering it stops its render, marks the take cancelled and lets render mode go if the take held it" onClick={async () => { - setState({ k: "cancelling" }); + setBusy(true); const { ok, j } = await housekeeping({ project, take, op: "cancel" }); - setState({ k: "done", ok: ok && j.stopped === true, said: String(j.said ?? j.error ?? (ok ? "asked" : "refused")) }); + setBusy(false); + onSaid({ take, ok: ok && j.stopped === true, text: String(j.said ?? j.error ?? (ok ? "asked" : "refused")) }); router.refresh(); }} > - {state.k === "cancelling" ? "Cancelling…" : "Cancel render"} + {busy ? "Cancelling…" : "Cancel render"} </button> - {state.k === "done" && ( - <span role="status" data-take-cancel-said="" className={`text-[11px] ${state.ok ? "text-[var(--color-dim)]" : "text-reject-text"}`}> - {state.said} - </span> - )} </span> ); } +/** What the last Cancel render said. */ +export function CancelSaidLine({ said }: { said: CancelSaid | null }) { + if (!said) return null; + return ( + <p role="status" data-take-cancel-said={said.take} className={`m-0 text-[11.5px] ${said.ok ? "text-text-2" : "text-reject-text"}`}> + {said.text} + </p> + ); +} + /** Fork as variant: the take as a project beside this one (default name v-<take>). */ export function ForkVariant({ project, take, ready }: { project: string; take: string; ready: boolean }) { const [open, setOpen] = useState(false); @@ -171,9 +183,11 @@ export function CompareWith({ project, take, options }: { project: string; take: export function TakeWorkDirs({ project, dirs, ready }: { project: string; dirs: WorkDirs; ready: boolean }) { const router = useRouter(); const [show, setShow] = useState(false); - if (!dirs.rendering.length && !dirs.cancelled.length) return null; + const [said, setSaid] = useState<CancelSaid | null>(null); + if (!dirs.rendering.length && !dirs.cancelled.length && !said) return null; return ( <section data-take-workdirs="" className="space-y-1.5 text-[12px]"> + <CancelSaidLine said={said} /> {dirs.rendering.map((r) => ( <div key={r.id} data-take-rendering={r.id} className="flex flex-wrap items-center gap-2 rounded border border-[var(--color-meter)] bg-[var(--color-panel)] px-3 py-2"> <span className="micro">rendering now</span> @@ -185,7 +199,7 @@ export function TakeWorkDirs({ project, dirs, ready }: { project: string; dirs: {r.from ? ` · from ${r.from}` : ""} · its first render: it becomes a take when it is done </span> <span className="ml-auto"> - <CancelRender project={project} take={r.id} ready={ready} /> + <CancelRender project={project} take={r.id} ready={ready} onSaid={setSaid} /> </span> </div> ))} diff --git a/umtool/components/projects/TakesBench.tsx b/umtool/components/projects/TakesBench.tsx @@ -14,7 +14,7 @@ import { playHref, takeWalkHref } from "@/lib/hrefs"; import { BenchBody, VerdictBar } from "./bench/BenchShell"; import { startTakeJob } from "./NewTakePanel"; import TakeActions from "./TakeActions"; -import { CancelRender, CompareWith, ForkVariant, TakeWorkDirs, type CompareOption, type WorkDirs } from "./TakeVariants"; +import { CancelRender, CancelSaidLine, CompareWith, ForkVariant, TakeWorkDirs, type CancelSaid, type CompareOption, type WorkDirs } from "./TakeVariants"; // The takes of one project, a group at a time, every preview on screen at once. // @@ -545,6 +545,8 @@ function TakeCard({ }, []); const [note, setNote] = useState(verdict?.note ?? ""); const [busy, setBusy] = useState(false); + // What Cancel render said: kept here, as the button goes once the render has stopped. + const [cancelSaid, setCancelSaid] = useState<CancelSaid | null>(null); const [error, setError] = useState<string | null>(null); const saved = verdict?.note ?? ""; // Adopt a server value that moved underneath (another tab, a refresh). @@ -863,7 +865,8 @@ function TakeCard({ </p> )} <TakeWorkLine project={project} work={work} ready={ready} onFreed={onFreed} /> - {(t.holds ?? []).some((h) => h.startsWith("it is rendering")) && <CancelRender project={project} take={t.id} ready={ready} />} + {(t.holds ?? []).some((h) => h.startsWith("it is rendering")) && <CancelRender project={project} take={t.id} ready={ready} onSaid={setCancelSaid} />} + <CancelSaidLine said={cancelSaid} /> <div className="flex flex-wrap items-center gap-1.5" data-take-variants={t.id}> <ForkVariant project={project} take={t.id} ready={ready} /> <CompareWith project={project} take={t.id} options={compareOptions} /> diff --git a/umtool/components/projects/report/CutTab.tsx b/umtool/components/projects/report/CutTab.tsx @@ -402,6 +402,8 @@ export default async function CutTab({ project, detail, search, tabHref }: Repor /> )} {fetchBody && <FetchWindowsPanel project={project.id} items={fetchBody.items} skipped={fetchBody.skipped} lastRun={fetchBody.lastRun} />} + {/* Tight windows: each clip to its sentence, for review (UI notes item 4) -- a button until pressed. */} + {clips.length > 0 && <TightWindowsPanel project={project.id} />} </div> {/* --- the timeline --------------------------------------------- */} @@ -443,9 +445,6 @@ export default async function CutTab({ project, detail, search, tabHref }: Repor </div> </section> - {/* --- tight windows: each clip to its sentence, for review (UI notes item 4) --- */} - {clips.length > 0 && <TightWindowsPanel project={project.id} />} - {/* --- the walk's ★ clips: the trailer's candidates ------------------- */} {candidates.length > 0 && ( <section diff --git a/umtool/components/projects/report/TightWindowsPanel.tsx b/umtool/components/projects/report/TightWindowsPanel.tsx @@ -141,13 +141,26 @@ export default function TightWindowsPanel({ project }: { project: string }) { ); const rows = got ? got.rows.filter((r) => all || r.changed) : []; + // Until it is pressed, one button among the Cut tab's tools (it adds nothing to the page's + // height); the review list then opens on a line of its own under them. + const button = ( + <button + type="button" + data-action="propose-tight" + className={buttonVariants({ variant: "outline", size: "sm" })} + disabled={loading} + title="each clip to its sentence (the cut's, else the whole ones in its window), each edge into its pause — a list to review; nothing changes until you Apply a row" + onClick={() => void propose()} + > + {loading ? "Proposing…" : got ? "Propose again" : "Propose tight windows"} + </button> + ); + if (!got && !error) return <span data-tight-windows="">{button}</span>; return ( - <section data-tight-windows={got ? got.counts.proposed : ""} className="rounded border border-[var(--color-line)] bg-[var(--color-panel)] px-3 py-2"> + <section data-tight-windows={got ? got.counts.proposed : ""} className="basis-full rounded border border-[var(--color-line)] bg-[var(--color-panel)] px-3 py-2"> <div className="flex flex-wrap items-center gap-2"> <h2 className="micro">tight windows</h2> - <button type="button" data-action="propose-tight" className={buttonVariants({ variant: "outline", size: "sm" })} disabled={loading} onClick={() => void propose()}> - {loading ? "Proposing…" : got ? "Propose again" : "Propose tight windows"} - </button> + {button} {got && ( <span data-tight-counts="" className="text-[11.5px] text-[var(--color-dim)]"> {got.counts.proposed} of {got.counts.clips} clips would change · {got.counts.same} already tight @@ -158,11 +171,6 @@ export default function TightWindowsPanel({ project }: { project: string }) { </button> </span> )} - {!got && !loading && ( - <span className="text-[11.5px] text-[var(--color-dim)]"> - each clip to its sentence (the cut&rsquo;s, else the whole ones in its window), each edge into its pause — a list to review; nothing changes until you Apply a row - </span> - )} </div> {error && ( <p role="alert" className="mt-1 text-[12px] text-reject-text"> diff --git a/umtool/docs/knobs.md b/umtool/docs/knobs.md @@ -634,7 +634,8 @@ is a work dir with no take.json: the list folds it away (**N cancelled renders f **Delete take**. A rebuild cancelled keeps its last take whole, its card marked **last render cancelled**. Made again, the take's mark is cleared. -**A variant is a project beside its parent** — as the hand copies were (`emberparadox/v-a-cold-open` …), because a +**A variant is a project beside its parent** (a narrative variant of the cut — not the encode ladder's variants of +[Make variants](#make-variants-and-the-sync-report)) — as the hand copies were (`emberparadox/v-a-cold-open` …), because a project is a leaf of the walk and cannot sit inside one — so the walk, the cut, takes and Deliver all work on it unchanged. `lib/report/variantFork.mjs` writes: `video.manifest.json` (the take's — the one it was rendered from; a draft's resolved from its patch — its `slug` the variant's name), `variant.json` (`{variantOf, fromTake, takeLabel, diff --git a/umtool/e2e/take-variants.spec.ts b/umtool/e2e/take-variants.spec.ts @@ -134,7 +134,8 @@ test("Cancel a take while it renders: its render stops, it is marked cancelled, await expect(row).toContainText("Slow render"); await shot(page, "u3-4-cancel-rendering-take.png"); await row.locator("[data-action='cancel-render']").click(); - await expect(row.locator("[data-take-cancel-said]")).toContainText("its render stopped (the take maker)", { timeout: 60_000 }); + // The answer stays on the page after the refresh takes the row away (it is not rendering any more). + await expect(page.locator(`[data-take-cancel-said='${id}']`)).toContainText("its render stopped (the take maker)", { timeout: 60_000 }); // Stopped cleanly: the render's process gone, no take.json, the mark, the lock gone, render mode off. await expect.poll(() => alive(stubPid), { timeout: 15_000 }).toBe(false); @@ -147,6 +148,8 @@ test("Cancel a take while it renders: its render stops, it is marked cancelled, .toBe("failed"); // The list: no longer rendering; folded away as cancelled, deletable. + await expect(page.locator(`[data-take-rendering='${id}']`)).toHaveCount(0); + await shot(page, "u3-4b-cancelled.png"); await page.reload(); await expect(page.locator(`[data-take-rendering='${id}']`)).toHaveCount(0); await expect(page.locator("[data-cancelled-count]")).toContainText("1 cancelled render folded away");