commit b468d550ffc83bd88045769bde99fee2277e44d8
parent 484f6128b48570fd2a7a45147969f66e58207d64
Author: I Mean I'm Just Saying <imeanimjustsaying@kiwifarms.st>
Date: Thu, 5 Nov 2026 03:59:44 -0500
umtool: the reel panel's Options -- close on the master's last S seconds (trailer --finale), a file name (--out, a name only, never a path from the page), a dry run (--dry-run: the mapping in the log)
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Diffstat:
3 files changed, 42 insertions(+), 8 deletions(-)
diff --git a/umtool/app/api/report/reel/route.ts b/umtool/app/api/report/reel/route.ts
@@ -17,7 +17,7 @@ export const dynamic = "force-dynamic";
// takes with masters, the reels, and the
// cut job running for this project, if any
// GET ?job=<id>[&since=&sinceEvent=] that job, as the take jobs show one
-// POST { project, reel, take } cut it: `umtool trailer <p> --reel <r>
+// POST { project, reel, take, finale?, out?, dryRun? } cut it (finale: the master's last S s; out: a NAME; dryRun): `umtool trailer <p> --reel <r>
// --take <t>` on the runner (one job at a
// time; the CLI takes the heavy slot)
// ?cancel=<job> stop it
@@ -71,7 +71,13 @@ export async function POST(request: Request) {
if (!view.beats && !view.introAsked) return Response.json({ error: `the reel ${reel} has no beats yet` }, { status: 400 });
const running = runningJob();
if (running) return Response.json({ error: `a job is already running (${running.kind})`, running: jobView(running) }, { status: 409 });
- const plan = reelCutSteps(r.project, reel, take, { umtoolDir: UMTOOL_DIR });
+ const finale = Number(body.finale);
+ const plan = reelCutSteps(r.project, reel, take, {
+ umtoolDir: UMTOOL_DIR,
+ finale: Number.isFinite(finale) && finale > 0 && finale <= 60 ? finale : null,
+ out: typeof body.out === "string" && body.out ? body.out : null,
+ dryRun: body.dryRun === true,
+ });
try {
const job = startJob(plan.kind, plan.steps, { project: r.project.id });
return Response.json({ ok: true, job: jobView(job) }, { headers: noStore });
diff --git a/umtool/components/projects/reel/ReelCutPanel.tsx b/umtool/components/projects/reel/ReelCutPanel.tsx
@@ -1,5 +1,6 @@
"use client";
+import { Options } from "@/components/ui/disclosure";
import Link from "next/link";
import { useCallback, useEffect, useRef, useState } from "react";
import { buttonVariants } from "@/components/ui/button";
@@ -71,10 +72,15 @@ export default function ReelCutPanel({ project, reel }: { project: string; reel:
};
}, [job, load]);
+ // The cut's Options (lane/ui-simplify): umtool trailer's --finale, --out and --dry-run.
+ const [finaleS, setFinaleS] = useState("");
+ const [outName, setOutName] = useState("");
+ const [dryRun, setDryRun] = useState(false);
+ const cutOptions = { ...(Number(finaleS) > 0 ? { finale: Number(finaleS) } : {}), ...(outName.trim() ? { out: outName.trim() } : {}), ...(dryRun ? { dryRun: true } : {}) };
const cut = async () => {
if (!view?.take) return;
setError(null);
- const r = await fetch("/api/report/reel", { method: "POST", headers: { "content-type": "application/json" }, body: JSON.stringify({ project, reel, take: view.take.id }) });
+ const r = await fetch("/api/report/reel", { method: "POST", headers: { "content-type": "application/json" }, body: JSON.stringify({ project, reel, take: view.take.id, ...cutOptions }) });
const j = await r.json().catch(() => ({}));
if (!r.ok) {
setError(String(j.error ?? `HTTP ${r.status}`));
@@ -132,6 +138,21 @@ export default function ReelCutPanel({ project, reel }: { project: string; reel:
<button type="button" data-reel-cut="" disabled={running || !!view.busy || !(view.beats || view.introAsked)} onClick={() => void cut()} className={buttonVariants({ size: "sm" })} title={view.busy ? `the runner is busy: ${view.busy}` : `umtool trailer ${project} --reel ${reel} --take ${t}`}>
{running ? "Cutting…" : "Cut the trailer"}
</button>
+ <Options id="reel-cut" hint="finale · file name · dry run">
+ <label className="inline-flex items-center gap-1">
+ close on the master's last
+ <input data-reel-finale="" value={finaleS} onChange={(e) => setFinaleS(e.target.value.replace(/[^0-9.]/g, ""))} placeholder="0" className="w-12 rounded border border-[var(--color-line)] bg-[var(--color-ink)] px-1 py-0.5 font-mono text-[11px]" />
+ s
+ </label>
+ <label className="inline-flex items-center gap-1">
+ file name
+ <input data-reel-out="" value={outName} onChange={(e) => setOutName(e.target.value)} placeholder={`${reel} (default)`} className="w-36 rounded border border-[var(--color-line)] bg-[var(--color-ink)] px-1 py-0.5 font-mono text-[11px]" />
+ </label>
+ <label className="inline-flex items-center gap-1">
+ <input type="checkbox" data-reel-dry-run="" checked={dryRun} onChange={(e) => setDryRun(e.target.checked)} />
+ dry run (the mapping only, in the log)
+ </label>
+ </Options>
{running && (
<button type="button" data-reel-cancel="" onClick={() => void cancel()} className={buttonVariants({ variant: "quiet", size: "sm" })}>
Cancel
diff --git a/umtool/lib/report/reelPlay.mjs b/umtool/lib/report/reelPlay.mjs
@@ -361,14 +361,21 @@ export const REEL_CUT_TIMEOUT_MS = 45 * 60 * 1000;
* @param {{ id: string }} project
* @param {string} reel
* @param {string} take
- * @param {{ umtoolDir: string }} o
+ * @param {{ umtoolDir: string, finale?: number | null, out?: string | null, dryRun?: boolean }} o
*/
-export function reelCutSteps(project, reel, take, { umtoolDir }) {
+export function reelCutSteps(project, reel, take, { umtoolDir, finale = null, out = null, dryRun = false }) {
+ // The cut's options (lane/ui-simplify, the reel panel's Options): --finale S (the master's last S seconds to close
+ // on), --out NAME (a NAME only -- never a path from a page), --dry-run (the mapping, nothing written).
+ const extra = [
+ ...(Number.isFinite(finale) && finale > 0 ? ["--finale", String(finale)] : []),
+ ...(typeof out === "string" && /^[A-Za-z0-9][A-Za-z0-9._-]{0,63}$/.test(out) ? ["--out", out] : []),
+ ...(dryRun ? ["--dry-run"] : []),
+ ];
return {
- kind: `trailer ${project.id} ${reel} (${take})`,
+ kind: `trailer ${project.id} ${reel} (${take})${dryRun ? " (dry run)" : ""}`,
steps: [{
- label: `cut the reel ${reel} from take ${take}'s master`,
- argv: ["node", path.join(/* turbopackIgnore: true */ umtoolDir, "bin", "umtool.mjs"), "trailer", project.id, "--reel", reel, "--take", take],
+ label: `cut the reel ${reel} from take ${take}'s master${dryRun ? " (dry run)" : ""}`,
+ argv: ["node", path.join(/* turbopackIgnore: true */ umtoolDir, "bin", "umtool.mjs"), "trailer", project.id, "--reel", reel, "--take", take, ...extra],
cwd: umtoolDir,
env: {},
timeoutMs: REEL_CUT_TIMEOUT_MS,