Archilyzer · Source

archilyzer

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

commit 668d1419cbdde267580ef01881464d708b4d9dcc
parent acbc3fe1aab51df2a58bc1668d1b4f7dedd0aa7c
Author: I Mean I'm Just Saying <imeanimjustsaying@kiwifarms.st>
Date:   Thu,  5 Nov 2026 01:57:48 -0500

umtool: a take's tools in the app, and a take card that leads with play, judge, walk, render -- Check before render (umtool lint --take), New draft from this take (take --draft --from, the next free <take>-d<n>), Add items from another project with a Preview before Import (take --import-item [--after|--before] [--dry-run]): one POST /api/report/takes/tools running the CLI's own functions with --json, never a shelled-out CLI; on the take card's Options and the take walk's; the card's Use this take, Rebuild, fork and compare into Options, supersede, delete and its work files into Advanced (a marked slot for lane/vertical's take-card controls)

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

Diffstat:
Aumtool/app/api/report/takes/tools/route.ts | 72++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Aumtool/components/projects/TakeTools.tsx | 209+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Mumtool/components/projects/TakeWalkPage.tsx | 5+++++
Mumtool/components/projects/TakesBench.tsx | 129++++++++++++++++++++++++++++++++++++++++++-------------------------------------
Mumtool/e2e/take-housekeeping.spec.ts | 5+++++
Mumtool/e2e/take-variants.spec.ts | 3+++
Mumtool/e2e/takes.spec.ts | 4++++
7 files changed, 367 insertions(+), 60 deletions(-)

diff --git a/umtool/app/api/report/takes/tools/route.ts b/umtool/app/api/report/takes/tools/route.ts @@ -0,0 +1,72 @@ +import { projectRef } from "@/lib/projects"; +import { refuseCaller } from "@/lib/report/caller"; +import { lintCommand } from "@/lib/report/lintCli.mjs"; +import { takeCommand } from "@/lib/report/takeCli.mjs"; +import { isTakeId, listTakes } from "@/lib/report/takes.mjs"; +import { REPORTS_ROOT } from "@/lib/paths"; + +export const dynamic = "force-dynamic"; + +// THE TAKE TOOLS a person had only from a terminal (slice C of "the apps do the +// work", 4 Nov), on a take's card and its walk (lane/ui-simplify, 5 Nov). Each +// runs the CLI's own function in this process -- never a shelled-out CLI -- with +// --json, and answers with what it printed: +// +// POST { project, take?, op: "lint" } umtool lint <p> [--take <t>] --json +// -> { exit, report: { ok, errors[], warnings[], entries } } +// POST { project, take, op: "draft-from", id?, label? } umtool take <p> --id <id> --draft --from <take> --json +// -> { exit, id, report } (id: the next free `<take>-d<n>` when none is given) +// POST { project, take, op: "import", refs: "<project>:<item>[,…]", after?, before?, dryRun? } +// umtool take <p> --id <take> --import-item … [--dry-run] --json +// -> { exit, report } +export async function POST(request: Request) { + const refused = refuseCaller(request, "/api/report/takes/tools"); + if (refused) return refused; + const body = (await request.json().catch(() => null)) as Record<string, unknown> | null; + if (!body || typeof body !== "object") return Response.json({ error: "bad json" }, { status: 400 }); + const project = await projectRef(String(body.project ?? "")); + if (!project) return Response.json({ error: "no such project" }, { status: 404 }); + const take = body.take === undefined || body.take === null || body.take === "" ? null : body.take; + if (take !== null && !isTakeId(take)) return Response.json({ error: "take must be a take id" }, { status: 400 }); + const out: string[] = []; + const err: string[] = []; + const io = { reportsRoot: REPORTS_ROOT, log: (s: string) => out.push(s), err: (s: string) => err.push(s) }; + const answer = (exit: number, extra: Record<string, unknown> = {}) => { + let report: unknown = null; + try { + report = out.length ? JSON.parse(out.join("\n")) : null; + } catch { + report = null; + } + const status = exit === 2 ? 400 : 200; + return Response.json({ exit, report, said: [...err, ...(report === null ? out : [])].join("\n"), ...extra }, { status, headers: { "cache-control": "no-store" } }); + }; + try { + if (body.op === "lint") { + const exit = await lintCommand([project.id, ...(take ? ["--take", take] : []), "--json"], io); + return answer(exit); + } + if (!take) return Response.json({ error: `${String(body.op)} needs a take` }, { status: 400 }); + if (body.op === "draft-from") { + let id = typeof body.id === "string" && body.id ? body.id : null; + if (!id) { + const have = new Set(((await listTakes(project.dir)).takes as { id: string }[]).map((t) => t.id)); + for (let n = 1; n < 1000 && !id; n++) if (!have.has(`${take}-d${n}`)) id = `${take}-d${n}`; + } + if (!id || !isTakeId(id)) return Response.json({ error: "no free draft id" }, { status: 400 }); + const label = typeof body.label === "string" && body.label.trim() ? ["--label", body.label.trim()] : []; + const exit = await takeCommand([project.id, "--id", id, "--draft", "--from", take, ...label, "--json"], io); + return answer(exit, { id }); + } + if (body.op === "import") { + const refs = typeof body.refs === "string" ? body.refs.trim() : ""; + if (!refs) return Response.json({ error: "import needs <project>:<item>[,<item>…]" }, { status: 400 }); + const place = typeof body.after === "string" && body.after ? ["--after", body.after] : typeof body.before === "string" && body.before ? ["--before", body.before] : []; + const exit = await takeCommand([project.id, "--id", take, ...refs.split(/\s+/).flatMap((r) => ["--import-item", r]), ...place, ...(body.dryRun ? ["--dry-run"] : []), "--json"], io); + return answer(exit); + } + return Response.json({ error: "op must be lint, draft-from or import" }, { status: 400 }); + } catch (e) { + return Response.json({ error: e instanceof Error ? e.message : String(e) }, { status: 500 }); + } +} diff --git a/umtool/components/projects/TakeTools.tsx b/umtool/components/projects/TakeTools.tsx @@ -0,0 +1,209 @@ +"use client"; + +import Link from "next/link"; +import { useRouter } from "next/navigation"; +import { useEffect, useState } from "react"; +import { buttonVariants } from "@/components/ui/button"; +import { takeWalkHref } from "@/lib/hrefs"; +import { cn } from "@/lib/utils"; +import PlayLink from "./PlayLink"; + +// --------------------------------------------------------------------------- +// A TAKE's TOOLS that were terminal-only (slice C, 4 Nov), on its card and its +// walk (lane/ui-simplify, 5 Nov). Each is one POST /api/report/takes/tools, +// which runs the CLI's own function with --json: +// +// Check before render umtool lint <p> --take <t> +// New draft from this take umtool take <p> --id <t>-d<n> --draft --from <t> +// Add items from another umtool take <p> --id <t> --import-item <src>:<a,b> [--after|--before <e>] +// project [--dry-run]: Preview shows the plan, Import does it +// --------------------------------------------------------------------------- + +type Tools = { exit: number; report: Record<string, unknown> | null; said?: string; id?: string; error?: string }; + +async function tool(body: Record<string, unknown>): Promise<Tools> { + const r = await fetch("/api/report/takes/tools", { method: "POST", headers: { "content-type": "application/json" }, body: JSON.stringify(body), cache: "no-store" }); + const j = (await r.json().catch(() => ({ error: `HTTP ${r.status}` }))) as Tools; + if (!r.ok && j.exit === undefined) return { exit: 1, report: null, error: j.error ?? `HTTP ${r.status}` }; + return j; +} + +/** Check before render: the manifest lint (and the files the posts name) on the take, or on the project's cut. */ +export function LintButton({ project, take = null, className }: { project: string; take?: string | null; className?: string }) { + const [busy, setBusy] = useState(false); + const [res, setRes] = useState<Tools | null>(null); + const rep = res?.report as { ok?: boolean; errors?: string[]; warnings?: string[]; entries?: number } | null | undefined; + return ( + <span className={cn("inline-flex flex-wrap items-center gap-1.5", className)} data-take-lint={take ?? ""} data-take-lint-state={res ? (rep?.ok ? "ok" : "errors") : busy ? "running" : "idle"}> + <button type="button" data-action="lint" disabled={busy} onClick={() => (setBusy(true), void tool({ project, take, op: "lint" }).then((r) => (setRes(r), setBusy(false))))} className={buttonVariants({ variant: "outline", size: "sm" })} title={`umtool lint ${project}${take ? ` --take ${take}` : ""}`}> + {busy ? "Checking…" : "Check before render"} + </button> + {res && (res.error || !rep) && <span className="text-[11.5px] text-reject-text">{res.error ?? res.said ?? "the check said nothing"}</span>} + {rep && ( + <span className={cn("text-[11.5px]", rep.ok ? "text-kept-text" : "text-reject-text")} data-take-lint-result={rep.ok ? "ok" : String(rep.errors?.length ?? 0)}> + {rep.ok ? `✓ ready to render · ${rep.entries ?? 0} entries` : `✕ ${rep.errors?.length ?? 0} error${rep.errors?.length === 1 ? "" : "s"}`} + {(rep.warnings?.length ?? 0) > 0 && ` · ${rep.warnings!.length} warning${rep.warnings!.length === 1 ? "" : "s"}`} + </span> + )} + {rep && ((rep.errors?.length ?? 0) > 0 || (rep.warnings?.length ?? 0) > 0) && ( + <ul className="m-0 basis-full list-disc space-y-0.5 pl-4 text-[11px]" data-take-lint-lines=""> + {(rep.errors ?? []).map((e, i) => ( + <li key={`e${i}`} className="text-reject-text"> + {e} + </li> + ))} + {(rep.warnings ?? []).slice(0, 8).map((w, i) => ( + <li key={`w${i}`} className="text-text-2"> + {w} + </li> + ))} + </ul> + )} + </span> + ); +} + +/** New draft from this take: its style and patch, a timeline of its own to walk and edit. */ +export function DraftFromButton({ project, take }: { project: string; take: string }) { + const router = useRouter(); + const [busy, setBusy] = useState(false); + const [res, setRes] = useState<Tools | null>(null); + const go = async () => { + setBusy(true); + const r = await tool({ project, take, op: "draft-from" }); + setRes(r); + setBusy(false); + if (r.exit === 0) router.refresh(); + }; + return ( + <span className="inline-flex flex-wrap items-center gap-1.5" data-take-draft-from={take}> + <button type="button" data-action="draft-from" disabled={busy} onClick={() => void go()} className={buttonVariants({ variant: "outline", size: "sm" })} title={`umtool take ${project} --id ${take}-d<n> --draft --from ${take}`}> + New draft from this take + </button> + {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" /> + </span> + )} + {res && res.exit !== 0 && <span className="text-[11.5px] text-reject-text">{res.error ?? res.said ?? "refused"}</span>} + </span> + ); +} + +type Entry = { id: string; type: string; words?: string }; + +/** Add items from another project: cloned into this take only, their files hard-linked in; Preview first. */ +export function ImportItems({ project, take }: { project: string; take: string }) { + const router = useRouter(); + const [open, setOpen] = useState(false); + const [source, setSource] = useState(""); + const [items, setItems] = useState(""); + const [where, setWhere] = useState<"auto" | "after" | "before">("auto"); + const [anchor, setAnchor] = useState(""); + const [entries, setEntries] = useState<Entry[]>([]); + const [projects, setProjects] = useState<string[]>([]); + const [busy, setBusy] = useState(false); + const [plan, setPlan] = useState<Tools | null>(null); + 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" }) + .then((r) => r.json()) + .then((j) => setEntries(Array.isArray(j.timeline) ? j.timeline : [])) + .catch(() => {}); + void fetch("/api/jump", { cache: "no-store" }) + .then((r) => r.json()) + .then((j) => setProjects(((j.pieces ?? []) as { id: string; kind: string }[]).filter((p) => p.kind === "project" && p.id.startsWith("p:")).map((p) => p.id.slice(2)))) + .catch(() => {}); + }, [open, project, take]); + const refs = items.trim() ? `${source.trim()}:${items.replace(/\s+/g, "")}` : ""; + const run = async (dryRun: boolean) => { + setBusy(true); + const r = await tool({ project, take, op: "import", refs, ...(where === "after" && anchor ? { after: anchor } : where === "before" && anchor ? { before: anchor } : {}), dryRun }); + setBusy(false); + if (dryRun) { + setPlan(r); + setDone(null); + } else { + setDone(r); + setPlan(null); + if (r.exit === 0) router.refresh(); + } + }; + const input = "rounded-[3px] border border-seam-2 bg-ground px-1.5 py-[3px] text-[11.5px] text-text outline-none focus:border-signal"; + const rows = (t: Tools | null) => ((t?.report as { items?: { id: string; action: string; at?: { index?: number; after?: string | null; before?: string | null } }[] } | null)?.items ?? []); + return ( + <span className="inline-flex basis-full flex-col gap-1.5" data-take-import={take}> + <button type="button" data-action="import-open" aria-expanded={open} onClick={() => setOpen((o) => !o)} className={cn(buttonVariants({ variant: open ? "pressed" : "outline", size: "sm" }), "self-start")}> + Add items from another project + </button> + {open && ( + <span className="flex flex-wrap items-center gap-1.5 rounded border border-seam p-2 text-[11.5px]"> + <input data-import-source="" list={`import-projects-${take}`} value={source} onChange={(e) => setSource(e.target.value)} placeholder="project (e.g. emberparadox/mr-obvious-unhinged)" className={cn(input, "w-72 font-mono")} /> + <datalist id={`import-projects-${take}`}> + {projects.filter((p) => p !== project).map((p) => ( + <option key={p} value={p} /> + ))} + </datalist> + <input data-import-items="" value={items} onChange={(e) => setItems(e.target.value)} placeholder="item ids, comma-separated" className={cn(input, "w-64 font-mono")} /> + <select data-import-where="" value={where} onChange={(e) => setWhere(e.target.value as typeof where)} className={input}> + <option value="auto">by date (else at the end)</option> + <option value="after">after</option> + <option value="before">before</option> + </select> + {where !== "auto" && ( + <select data-import-anchor="" value={anchor} onChange={(e) => setAnchor(e.target.value)} className={cn(input, "max-w-64")}> + <option value="">(pick an entry)</option> + {entries.map((e, i) => ( + <option key={`${e.id}:${i}`} value={e.id}> + {i + 1}. {e.id} + {e.words ? ` · ${e.words.slice(0, 30)}` : ""} + </option> + ))} + </select> + )} + <button type="button" data-action="import-preview" disabled={busy || !refs || !source.trim()} onClick={() => void run(true)} className={buttonVariants({ variant: "outline", size: "sm" })}> + Preview + </button> + <button type="button" data-action="import-go" disabled={busy || !refs || !source.trim()} onClick={() => void run(false)} className={buttonVariants({ variant: "go", size: "sm" })}> + Import into {take} + </button> + </span> + )} + {[plan, done].map((t, k) => + t ? ( + <span key={k} className="text-[11.5px]" data-import-result={k === 0 ? "plan" : "done"} data-import-exit={t.exit}> + {t.exit !== 0 ? ( + <span className="text-reject-text">{t.error ?? t.said ?? "refused"}</span> + ) : ( + <> + <span className="text-text-2">{k === 0 ? "would do: " : "done: "}</span> + {rows(t).map((r) => ( + <span key={r.id} className="mr-2 font-mono" data-import-row={r.id}> + {r.id} {r.action} + {r.at?.after ? ` after ${r.at.after}` : r.at?.before ? ` before ${r.at.before}` : typeof r.at?.index === "number" ? ` at ${r.at.index}` : ""} + </span> + ))} + </> + )} + </span> + ) : null, + )} + </span> + ); +} + +/** The three, as a take card's or a take walk's row. */ +export default function TakeTools({ project, take, editable = true }: { project: string; take: string; editable?: boolean }) { + return ( + <span className="flex flex-wrap items-start gap-1.5" data-take-tools={take}> + <LintButton project={project} take={take} /> + <DraftFromButton project={project} take={take} /> + {editable && <ImportItems project={project} take={take} />} + </span> + ); +} diff --git a/umtool/components/projects/TakeWalkPage.tsx b/umtool/components/projects/TakeWalkPage.tsx @@ -10,6 +10,8 @@ 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"; @@ -93,6 +95,9 @@ export default async function TakeWalkPage({ {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> diff --git a/umtool/components/projects/TakesBench.tsx b/umtool/components/projects/TakesBench.tsx @@ -17,6 +17,8 @@ import type { RenderView } from "@/lib/queue/view"; import { BenchBody, VerdictBar } from "./bench/BenchShell"; import { startTakeJob } from "./NewTakePanel"; import TakeActions from "./TakeActions"; +import TakeTools from "./TakeTools"; +import { Advanced, Options, PanelSlot } from "@/components/ui/disclosure"; 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. @@ -826,31 +828,8 @@ function TakeCard({ compact /> )} - <div className="flex flex-wrap items-center gap-1.5"> - {!t.draft && ( - <button - type="button" - data-action="pick" - disabled={!ready || busy} - className={buttonVariants({ size: "sm" })} - title="the manifest this take was RENDERED from, over the project's" - onClick={() => void pick(false)} - > - Use this take - </button> - )} - {t.baseHash && !t.draft && ( - <button - type="button" - data-action="rebuild" - disabled={!ready || busy} - className={buttonVariants({ size: "sm" })} - onClick={() => void rebuild()} - > - Rebuild - </button> - )} - </div> + {(t.holds ?? []).some((h) => h.startsWith("it is rendering")) && <CancelRender project={project} take={t.id} ready={ready} onSaid={setCancelSaid} />} + <CancelSaidLine said={cancelSaid} /> {pickState?.stale && ( <div data-take-stale="" className="flex flex-wrap items-center gap-1.5 text-[11.5px] text-doubt-text"> <span>{pickState.stale}.</span> @@ -875,43 +854,73 @@ 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} 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} /> - </div> - <div className="flex flex-wrap items-center gap-1.5 text-[11px]" data-take-housekeeping={t.id}> - {superseded ? ( - <button type="button" data-action="unsupersede" disabled={!ready || busy} onClick={() => void housekeeping({ op: "unsupersede" })} className={buttonVariants({ size: "sm" })}> - Not superseded + {/* Everything but play, judge, walk and render, folded (lane/ui-simplify): Options the common, Advanced the rare. */} + <Options id="take-card" hint="use · rebuild · check · draft · import · fork · compare"> + <div className="flex flex-wrap items-center gap-1.5"> + {!t.draft && ( + <button + type="button" + data-action="pick" + disabled={!ready || busy} + className={buttonVariants({ size: "sm" })} + title="the manifest this take was RENDERED from, over the project's" + onClick={() => void pick(false)} + > + Use this take </button> - ) : ( - <> - <select data-take-superseded-by={t.id} value={supBy} disabled={!ready || busy || !!verdict?.picked} onChange={(e) => setSupBy(e.target.value)} className="rounded border border-[var(--color-line)] bg-[var(--color-ink)] px-1 py-0.5 text-[11px]" title={verdict?.picked ? "the picked take is not superseded" : "which take replaces this one"}> - <option value="">by (any later take)</option> - {others.map((o) => ( - <option key={o.id} value={o.id}> - {o.id} - </option> - ))} - </select> - <button type="button" data-action="supersede" disabled={!ready || busy || !!verdict?.picked} onClick={() => void housekeeping({ op: "supersede", by: supBy || null })} className={buttonVariants({ size: "sm" })}> - Mark superseded + )} + {t.baseHash && !t.draft && ( + <button + type="button" + data-action="rebuild" + disabled={!ready || busy} + className={buttonVariants({ size: "sm" })} + onClick={() => void rebuild()} + > + Rebuild </button> - </> - )} - </div> - <div className="flex flex-wrap"> - <DeletePlan - label={`Delete take ${t.id}`} - subject={`take ${t.id}`} - endpoint="/api/report/takes/delete" - body={{ project, take: t.id }} - onDone={() => router.refresh()} - /> - </div> + )} + </div> + <TakeTools project={project} take={t.id} editable={walkable} /> + <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} /> + </div> + <PanelSlot name="take-card-vertical" /> + </Options> + <Advanced id="take-card" hint="supersede · delete · work files"> + <div className="flex flex-wrap items-center gap-1.5 text-[11px]" data-take-housekeeping={t.id}> + {superseded ? ( + <button type="button" data-action="unsupersede" disabled={!ready || busy} onClick={() => void housekeeping({ op: "unsupersede" })} className={buttonVariants({ size: "sm" })}> + Not superseded + </button> + ) : ( + <> + <select data-take-superseded-by={t.id} value={supBy} disabled={!ready || busy || !!verdict?.picked} onChange={(e) => setSupBy(e.target.value)} className="rounded border border-[var(--color-line)] bg-[var(--color-ink)] px-1 py-0.5 text-[11px]" title={verdict?.picked ? "the picked take is not superseded" : "which take replaces this one"}> + <option value="">by (any later take)</option> + {others.map((o) => ( + <option key={o.id} value={o.id}> + {o.id} + </option> + ))} + </select> + <button type="button" data-action="supersede" disabled={!ready || busy || !!verdict?.picked} onClick={() => void housekeeping({ op: "supersede", by: supBy || null })} className={buttonVariants({ size: "sm" })}> + Mark superseded + </button> + </> + )} + </div> + <div className="flex flex-wrap"> + <DeletePlan + label={`Delete take ${t.id}`} + subject={`take ${t.id}`} + endpoint="/api/report/takes/delete" + body={{ project, take: t.id }} + onDone={() => router.refresh()} + /> + </div> + <TakeWorkLine project={project} work={work} ready={ready} onFreed={onFreed} /> + </Advanced> {t.previewSize != null && ( <TimedNotes notes={notes} file={`takes/${t.id}/${t.preview}`} video={el} take={t.id} resolveProject={project} /> )} diff --git a/umtool/e2e/take-housekeeping.spec.ts b/umtool/e2e/take-housekeeping.spec.ts @@ -3,6 +3,7 @@ import { existsSync, readFileSync, rmSync, writeFileSync } from "node:fs"; import path from "node:path"; import { fileURLToPath } from "node:url"; import * as urls from "./urls"; +import { openPanel } from "./panels"; // --------------------------------------------------------------------------- // Take housekeeping in the takes list (UI notes 2026-10-30, item 19): @@ -60,6 +61,7 @@ test("relabel a take; a take that is rendering is not relabelled", async ({ page test("mark a take superseded: folded away, shown dimmed on request, and back", async ({ page }) => { await page.goto(urls.takesHref(PROJECT)); const card = page.locator("[data-take='draft-9']"); + await openPanel(page, "advanced", "take-card"); await card.locator("[data-take-superseded-by='draft-9']").selectOption("draft-11"); await card.locator('[data-action="supersede"]').click(); await expect.poll(() => verdicts()["draft-9"]?.superseded?.by).toBe("draft-11"); @@ -69,6 +71,7 @@ test("mark a take superseded: folded away, shown dimmed on request, and back", a const shown = page.locator("[data-take='draft-9']"); await expect(shown).toHaveAttribute("data-superseded", "draft-11"); await expect(shown.locator("[data-take-superseded]")).toHaveText("superseded by draft-11"); + await openPanel(page, "advanced", "take-card"); await shown.locator('[data-action="unsupersede"]').click(); await expect.poll(() => verdicts()["draft-9"]).toBeUndefined(); await expect(page.locator("[data-take='draft-9']")).not.toHaveAttribute("data-superseded", /.*/); @@ -76,10 +79,12 @@ test("mark a take superseded: folded away, shown dimmed on request, and back", a test("delete refuses a take that is rendering, and the take it is rendered from", async ({ page }) => { await page.goto(urls.takesHref(PROJECT)); + await openPanel(page, "advanced", "take-card"); await page.locator("[data-take='draft-12']").getByRole("button", { name: "Delete take draft-12" }).click(); const plan = page.getByRole("region", { name: "delete take draft-12" }); await expect(plan).toHaveAttribute("data-delete-blocked", "yes"); await expect(plan.getByRole("list", { name: "refused" })).toContainText("take draft-12: it is rendering now"); + await openPanel(page, "advanced", "take-card"); await page.locator("[data-take='draft-11']").getByRole("button", { name: "Delete take draft-11" }).click(); await expect(page.getByRole("region", { name: "delete take draft-11" }).getByRole("list", { name: "refused" })).toContainText("take draft-12 is being rendered from it"); expect(existsSync(takeFile("draft-12"))).toBe(true); diff --git a/umtool/e2e/take-variants.spec.ts b/umtool/e2e/take-variants.spec.ts @@ -3,6 +3,7 @@ import { existsSync, readFileSync, rmSync, writeFileSync } from "node:fs"; import path from "node:path"; import { fileURLToPath } from "node:url"; import * as urls from "./urls"; +import { openPanel } from "./panels"; // --------------------------------------------------------------------------- // Take housekeeping, the rest (UI notes 2026-10-30, item 19): @@ -79,6 +80,7 @@ test("Fork as variant: a project beside this one, with the take in it; compared await page.setViewportSize({ width: 1440, height: 1000 }); await page.goto(urls.takesHref(PROJECT)); const card = page.locator("[data-take='draft-2']"); + await openPanel(page, "options", "take-card"); await card.locator("[data-action='fork']").click(); await expect(card.locator("[data-take-fork-name='draft-2']")).toHaveValue("v-draft-2"); await card.locator("[data-action='fork-go']").click(); @@ -99,6 +101,7 @@ test("Fork as variant: a project beside this one, with the take in it; compared // Compare with…: the parent's draft-1 against the variant's draft-2. await page.goto(urls.takesHref(PROJECT)); const one = page.locator("[data-take='draft-1']"); + await openPanel(page, "options", "take-card"); await one.locator("[data-take-compare-with='draft-1']").selectOption("reports/v-draft-2:draft-2"); await one.locator("[data-action='compare']").click(); await expect(page.locator("[data-compare-player='b']")).toHaveAttribute("data-compare-take", "reports/v-draft-2:draft-2"); diff --git a/umtool/e2e/takes.spec.ts b/umtool/e2e/takes.spec.ts @@ -3,6 +3,7 @@ import { existsSync, readFileSync, rmSync, writeFileSync } from "node:fs"; import path from "node:path"; import { fileURLToPath } from "node:url"; import * as urls from "./urls"; +import { openPanel } from "./panels"; // --------------------------------------------------------------------------- // Takes: alternative renders of part of a cut, side by side, judged. @@ -207,6 +208,7 @@ test("the take maker: New take with a style, the take appears, Use this take mak expect(JSON.parse(readText("takes/crisp/video.manifest.json")).render.crf).toBe(34); // Use this take: the project's manifest is the take's, the badge shows. + await openPanel(page, "options", "take-card"); await card.locator("[data-action='pick']").click(); await expect(card.locator("[data-take-used]")).toBeVisible(); await expect(card.locator("[data-take-picked]")).toBeVisible(); @@ -228,6 +230,7 @@ test("the take maker: New take with a style, the take appears, Use this take mak writeFileSync(path.join(MAKE_DIR, "video.manifest.json"), JSON.stringify({ ...m, title: "Moved on" }, null, 2) + "\n"); await page.reload(); const soft = page.locator("[data-take='soft']"); + await openPanel(page, "options", "take-card"); await soft.locator("[data-action='pick']").click(); await expect(soft.locator("[data-take-stale]")).toContainText("The project changed since this take was made"); expect(JSON.parse(readText("video.manifest.json")).title).toBe("Moved on"); @@ -309,5 +312,6 @@ test("the Takes page with the New take form open fits a phone", async ({ page }) client: document.documentElement.clientWidth, })); expect(scroll).toBeLessThanOrEqual(client); + await openPanel(page, "options", "take-card"); await expect(page.locator("[data-action='pick']").first()).toBeVisible(); });