Archilyzer · Source

archilyzer

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

commit c95672e1da588b5958038dc6210f095f446a9067
parent c8c9fe13e8c060803c830b824fb8c1229bbc280b
Author: I Mean I'm Just Saying <imeanimjustsaying@kiwifarms.st>
Date:   Mon,  9 Nov 2026 14:33:22 -0500

umtool: the Look panel's Basic | Deck switch, Play's bare footage, Copy share line

The Look panel's Basic | Deck switch shows render.mode as the build resolves it (over
the cut's look preset; GET /api/report/render answers `mode` and `preset`) and saves
it with the rest (`umtool look <p> mode=basic|deck`). Play of a basic cut plays what
the basic render cuts -- the clips alone, their spans exactly, hard cuts -- on the bare
footage (no deck composed, no card, no side post: data-play-bare). Copy share line
(GET /api/report/share-line) on Play's clip on screen and on every take's card copies
the platform page at the moment and the archive moment, and shows the line beside the
button for a browser that refuses the clipboard.

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

Diffstat:
Mumtool/app/api/report/render/route.ts | 16++++++++++++++--
Aumtool/components/projects/CopyShareLine.tsx | 82+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Mumtool/components/projects/TakesBench.tsx | 5+++++
Mumtool/components/projects/report/LookPanel.tsx | 51+++++++++++++++++++++++++++++++++++++++++++++------
Mumtool/components/projects/review/PlayCut.tsx | 26+++++++++++++++++++-------
Mumtool/lib/report/playView.mjs | 16+++++++++++-----
Mumtool/report-to-video/package.json | 1+
7 files changed, 177 insertions(+), 20 deletions(-)

diff --git a/umtool/app/api/report/render/route.ts b/umtool/app/api/report/render/route.ts @@ -1,5 +1,6 @@ import { withEditNotes } from "@/lib/report/guard"; -import { LOOK_KEYS, RenderRefused, StaleToken, lookOf, manifestToken, updateRender, updateVariants } from "@/lib/report/manifest.mjs"; +import { LOOK_KEYS, RenderRefused, StaleToken, effectiveManifest, lookOf, manifestToken, updateRender, updateVariants } from "@/lib/report/manifest.mjs"; +import { renderModeOf } from "yt-dlp-transcript-common/lib/report/look.mjs"; import { VARIANTS_DEFAULT, variantsProblems } from "@/lib/report/knobs.mjs"; import { resolveReport } from "@/lib/report/serve.mjs"; import { deckOn } from "umtool-report-to-video/deck"; @@ -17,7 +18,9 @@ export const dynamic = "force-dynamic"; // the writer (lib/report/manifest.mjs updateRender) validates with the // build's own checks, so a look this route accepts is one the build accepts. // -// GET ?project=<id> { look, deck, montage, styles, introStyles, keys, errors, token } +// GET ?project=<id> { look, mode, preset, deck, montage, styles, introStyles, keys, errors, token } +// `mode`: "deck" | "basic" as the build resolves it (the look preset under the +// manifest); the Look panel's Basic | Deck switch writes `patch: {mode}` // PUT { project, token, patch } { ok, look, token } | 409 stale | 400 { errors } // PUT { project, token, variants } render.variants, the ladder Make variants encodes // (null: the default ladder) → { ok, variants, token } @@ -29,9 +32,18 @@ export async function GET(request: Request) { const r = await resolveReport(url.searchParams.get("project") ?? ""); if ("error" in r) return Response.json({ error: r.error }, { status: r.status }); const render = (r.manifest.render ?? {}) as Record<string, unknown>; + // The mode as the build reads it: over the cut's look preset, when it stands on one. + let mode: "deck" | "basic" = renderModeOf(render); + try { + mode = renderModeOf((effectiveManifest(r.manifest) as { render?: Record<string, unknown> }).render); + } catch { + // An unknown preset: the manifest's own word (the build says what is wrong). + } return Response.json( { look: lookOf(render), + mode, + preset: typeof r.manifest.preset === "string" ? r.manifest.preset : null, deck: deckOn(render), montage: render.montage !== undefined && render.montage !== null, styles: TRANSITION_STYLES, diff --git a/umtool/components/projects/CopyShareLine.tsx b/umtool/components/projects/CopyShareLine.tsx @@ -0,0 +1,82 @@ +"use client"; + +import { useState } from "react"; +import { buttonVariants } from "@/components/ui/button"; +import { cn } from "@/lib/utils"; + +// COPY SHARE LINE (lane output-modes): a clip's platform page at the moment and +// its archive moment (GET /api/report/share-line, lib/report/shareLine.mjs), +// copied to the clipboard and shown -- the line stays readable beside the +// button, so a browser that refuses the clipboard still has it to select. +// On the take panel (a take's first clip) and on Play (the clip on screen). +// The CLI twin: `umtool share <project> [<clip>] [--take <id>]`. + +type Line = { clip: string; seconds: number; platform: string | null; archive: string | null; text: string }; + +export default function CopyShareLine({ + project, + clip = null, + take = null, + size = "sm", + testid = "", +}: { + project: string; + clip?: string | null; + take?: string | null; + size?: "sm" | "md"; + testid?: string; +}) { + const [state, setState] = useState<"idle" | "busy" | "copied" | "shown" | "error">("idle"); + const [line, setLine] = useState<Line | null>(null); + const [error, setError] = useState<string | null>(null); + const copy = async () => { + setState("busy"); + setError(null); + try { + const q = new URLSearchParams({ project, ...(clip ? { clip } : {}), ...(take ? { take } : {}) }); + const r = await fetch(`/api/report/share-line?${q}`, { cache: "no-store" }); + const j = (await r.json().catch(() => ({}))) as Line & { error?: string }; + if (!r.ok) throw new Error(j.error ?? `HTTP ${r.status}`); + setLine(j); + if (!j.text) { + setState("shown"); + return; + } + try { + await navigator.clipboard.writeText(j.text); + setState("copied"); + } catch { + // The clipboard refused (no permission, not a secure context): the line is shown to select. + setState("shown"); + } + } catch (e) { + setError(e instanceof Error ? e.message : String(e)); + setState("error"); + } + }; + return ( + <span className="inline-flex min-w-0 flex-wrap items-center gap-1.5" data-share-line-box={testid || clip || take || ""}> + <button + type="button" + data-share-copy={testid || clip || take || ""} + data-share-state={state} + disabled={state === "busy"} + onClick={() => void copy()} + className={cn(buttonVariants({ variant: "outline", size }))} + title={`the platform's page at the moment and its archive moment — umtool share ${project}${clip ? ` ${clip}` : ""}${take ? ` --take ${take}` : ""}`} + > + {state === "copied" ? "Copied" : "Copy share line"} + </button> + {line && ( + <span data-share-line="" className="min-w-0 max-w-[42em] select-all break-all font-mono text-[11px] text-text-2"> + {line.text || `${line.clip}: no platform page or archive to link`} + </span> + )} + {error && ( + <span role="alert" data-share-error="" className="text-[11.5px] text-reject-text"> + {error} + </span> + )} + </span> + ); +} diff --git a/umtool/components/projects/TakesBench.tsx b/umtool/components/projects/TakesBench.tsx @@ -17,6 +17,7 @@ import type { RenderView } from "@/lib/queue/view"; import { BenchBody, VerdictBar } from "./bench/BenchShell"; import { startTakeJob } from "./NewTakePanel"; import TakeActions from "./TakeActions"; +import CopyShareLine from "./CopyShareLine"; import FastRenders from "./FastRenders"; import TakeTools from "./TakeTools"; import { Advanced, Options, PanelSlot } from "@/components/ui/disclosure"; @@ -844,6 +845,10 @@ function TakeCard({ )} {/* Fast feedback (takePreview.mjs): a preview of the whole take, a reel of what changed -- queue steps. */} <FastRenders project={project} take={t.id} /> + {/* Its share line (lane output-modes): the take's first clip's platform page at the moment and its archive moment. */} + <div className="flex flex-wrap items-center gap-1.5 text-[11.5px]"> + <CopyShareLine project={project} take={t.id} testid={`take:${t.id}`} /> + </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 && ( diff --git a/umtool/components/projects/report/LookPanel.tsx b/umtool/components/projects/report/LookPanel.tsx @@ -25,6 +25,11 @@ import AssistBox from "./AssistBox"; // The brand intro (render.intro, report-to-video intro.mjs): the sting the // cut opens with, by style; "none" is no intro. An intro written with its // other knobs (ground, sound, seconds) keeps them when the style changes. +// The OUTPUT MODE (render.mode, lane output-modes): **Basic | Deck** -- basic is +// the footage alone (report-to-video basic.mjs: no deck, chrome, intro, QR, +// cards or brand; post items and teasers left out), deck everything else. The +// switch shows the mode as the build resolves it (over the cut's look preset) +// and saves with the rest (`umtool look <p> mode=basic|deck`). type Look = { headerHeight?: number; @@ -39,7 +44,8 @@ type Look = { blur?: string; intro?: string | { style?: string; [k: string]: unknown } | null; }; -type View = { look: Look; deck: boolean; montage: boolean; styles: string[]; introStyles?: string[]; errors: string[]; token: string | null }; +type Mode = "deck" | "basic"; +type View = { look: Look; mode?: Mode; preset?: string | null; deck: boolean; montage: boolean; styles: string[]; introStyles?: string[]; errors: string[]; token: string | null }; /** The intro's style as written: a bare name or the object's `style`; "" for none. */ const introStyleOf = (v: Look["intro"]) => (typeof v === "string" ? v : v && typeof v === "object" ? String(v.style ?? "") : ""); @@ -67,9 +73,10 @@ type Draft = { grain: string; blur: "on" | "off"; intro: string; + mode: Mode; }; -function draftOf(l: Look): Draft { +function draftOf(l: Look, mode: Mode = "deck"): Draft { const t = l.loudness?.target; return { header: l.headerHeight !== 0, @@ -92,6 +99,7 @@ function draftOf(l: Look): Draft { grain: String(l.slide?.grain ?? SLIDE_DEFAULTS.grain), blur: l.blur === "off" ? "off" : "on", intro: introStyleOf(l.intro), + mode, }; } @@ -137,6 +145,8 @@ function patchOf(was: Look, d: Draft, view: View): Record<string, unknown> { (!on || ((was0?.maxS ?? ROOM.maxS) === maxS && (was0?.minGap ?? ROOM.minGap) === minGap)); if (!same) p.room = next; } + // The output mode (render.mode): the writer keeps "deck" as no key unless a look preset's must be beaten. + if (d.mode !== (view.mode ?? "deck")) p.mode = d.mode; // The blurred clips (render.blur): "on" is the default, written as no key. if (d.blur !== (was.blur === "off" ? "off" : "on")) p.blur = d.blur === "off" ? "off" : null; // The brand intro: none removes the key; a style keeps an object's other knobs. @@ -169,7 +179,7 @@ export default function LookPanel({ project }: { project: string }) { const j = (await r.json()) as View & { error?: string }; if (!r.ok) throw new Error(j.error ?? `HTTP ${r.status}`); setView(j); - setDraft(draftOf(j.look)); + setDraft(draftOf(j.look, j.mode ?? "deck")); }, [project]); useEffect(() => { load().catch((e) => setError(e instanceof Error ? e.message : String(e))); @@ -203,8 +213,8 @@ export default function LookPanel({ project }: { project: string }) { setError((j.errors ?? [j.error ?? `HTTP ${r.status}`]).join("; ")); return; } - setView({ ...view, look: j.look ?? {}, token: j.token ?? null, errors: [] }); - setDraft(draftOf(j.look ?? {})); + setView({ ...view, look: j.look ?? {}, mode: draft.mode, token: j.token ?? null, errors: [] }); + setDraft(draftOf(j.look ?? {}, draft.mode)); setVersion((n) => n + 1); setStatus("Saved — the next render uses it"); } finally { @@ -225,6 +235,35 @@ export default function LookPanel({ project }: { project: string }) { {view.errors.join("; ")} </p> )} + <div className="mb-3 flex flex-wrap items-center gap-x-3 gap-y-1.5" data-look-mode-row=""> + <span className="text-[12.5px] text-text-2">Output</span> + <span role="group" aria-label="Output mode" className="inline-flex overflow-hidden rounded-[3px] border border-seam-2"> + {(["basic", "deck"] as const).map((m) => ( + <button + key={m} + type="button" + data-look-mode={m} + aria-pressed={draft.mode === m} + disabled={busy} + onClick={() => set({ mode: m })} + title={m === "basic" ? "the footage alone: no deck, chrome, intro, QR, cards or brand — umtool look <p> mode=basic" : "the deck and everything this panel sets — umtool look <p> mode=deck"} + className={ + draft.mode === m + ? "bg-[var(--color-text)] px-3 py-1 text-[12px] font-semibold text-[var(--color-ground)]" + : "bg-transparent px-3 py-1 text-[12px] text-text-2 hover:text-text" + } + > + {m === "basic" ? "Basic" : "Deck"} + </button> + ))} + </span> + {draft.mode === "basic" && ( + <span className="text-[12px] text-muted" data-look-mode-note=""> + the footage alone — post items, teasers and cards are left out; the rest below applies to a deck render + </span> + )} + {view.preset && <span className="text-[12px] text-muted">look preset: {view.preset}</span>} + </div> <div className="flex flex-wrap items-center gap-x-5 gap-y-2"> {check("header", "Header", "data-look-header")} {check("footer", "Timeline footer", "data-look-footer")} @@ -348,7 +387,7 @@ export default function LookPanel({ project }: { project: string }) { Save the look </button> {dirty && ( - <button type="button" disabled={busy} onClick={() => setDraft(draftOf(view.look))} className={buttonVariants({ variant: "quiet", size: "md" })}> + <button type="button" disabled={busy} onClick={() => setDraft(draftOf(view.look, view.mode ?? "deck"))} className={buttonVariants({ variant: "quiet", size: "md" })}> Undo changes </button> )} diff --git a/umtool/components/projects/review/PlayCut.tsx b/umtool/components/projects/review/PlayCut.tsx @@ -37,6 +37,7 @@ import VideoEntryPlayer from "./VideoEntryPlayer"; import TeaserCardPlayer, { type TeaserPage } from "./TeaserCardPlayer"; import { videoStageAt, type VideoEntryPlay } from "@/lib/report/playVideo.mjs"; import ComboBadge, { type ComboInfo } from "./ComboBadge"; +import CopyShareLine from "../CopyShareLine"; // --------------------------------------------------------------------------- // THE PLAY VIEW (umtool/docs/knobs.md, "Play the cut"): a screening room. The @@ -165,6 +166,8 @@ export type PlayViewData = { transition: number; blurRendered: boolean; deckOn: boolean; + /** A basic cut (render.mode "basic", report-to-video basic.mjs): the footage alone, nothing drawn over it. */ + basic?: boolean; segments: { id: string; start: number; duration: number; hold?: number }[]; entries: PlayEntry[]; }; @@ -1138,6 +1141,7 @@ export default function PlayCut({ // A video entry with the chrome off over it is on screen (video-entry.mjs): nothing of the deck shows. data-play-chrome={videoNow?.video.noChrome ? "off" : undefined} data-play-compose={composeState} + data-play-basic={view.basic ? "" : undefined} data-play-edges={edges.state} data-play-sound={engine.info?.sound ?? ""} data-play-picture={engine.info?.picture ?? ""} @@ -1229,13 +1233,19 @@ export default function PlayCut({ )} </DeckFrame> ) : ( - <div className="relative w-full overflow-hidden rounded border border-seam bg-black max-md:rounded-none max-md:border-0" style={{ aspectRatio: "16 / 9" }} data-testid="play-plain"> + <div + className="relative w-full overflow-hidden rounded border border-seam bg-black max-md:rounded-none max-md:border-0" + style={{ aspectRatio: "16 / 9" }} + data-testid="play-plain" + // A basic cut: the bare footage, as the basic render cuts it -- no card, no side post, nothing over it. + data-play-bare={view.basic ? "" : undefined} + > {footageCanvas({ inset: 0, width: "100%", height: "100%" }, 1280, 720)} - {postNow && <div className="absolute inset-0" style={{ background: bg }}>{postPlayer({ width: 1920, height: 1080 })}{comboBadge({ width: 1920, height: 1080 })}</div>} - {videoUnder} - {teaserCard} - {placeholderCard} - {sideNow} + {!view.basic && postNow && <div className="absolute inset-0" style={{ background: bg }}>{postPlayer({ width: 1920, height: 1080 })}{comboBadge({ width: 1920, height: 1080 })}</div>} + {!view.basic && videoUnder} + {!view.basic && teaserCard} + {!view.basic && placeholderCard} + {!view.basic && sideNow} </div> )} {dipVeil} @@ -1330,6 +1340,8 @@ export default function PlayCut({ </span> )} {ui.waiting && <span className="text-[11.5px] text-muted" data-play-waiting="">loading…</span>} + {/* The clip on screen's share line: its platform page at the moment and its archive moment. */} + {item?.clip && <CopyShareLine key={`${item.id}:${take ?? ""}`} project={project} clip={item.id} take={take ?? null} testid="play" />} {/* The clip on the bench, and back here after (E). */} <button type="button" @@ -1358,7 +1370,7 @@ export default function PlayCut({ )} {finaleNow && <span data-play-finale-up="">finale</span>} {composeState === "composing" && <span>composing the chrome…</span>} - {composeState === "no-deck" && <span>no on-screen deck: the footage alone</span>} + {composeState === "no-deck" && <span>{view.basic ? "basic: the footage alone, as the basic render cuts it" : "no on-screen deck: the footage alone"}</span>} </span> </div> {backToast && ( diff --git a/umtool/lib/report/playView.mjs b/umtool/lib/report/playView.mjs @@ -11,6 +11,7 @@ import { DEFAULT_VARIANT, selectVariant } from "umtool-report-to-video/build-video"; import { deckOn, estimatedDuration, estimateSchedule, scheduleFrom, transitionOf } from "umtool-report-to-video/deck"; import { resolveFactcheck } from "umtool-report-to-video/factcheck"; +import { basicOn, basicSpans } from "umtool-report-to-video/basic"; import { channelsDirFor, clipDateKey, readManifest } from "../projects/report.mjs"; import { rejectionOf } from "./rejectReasons.mjs"; import { dateKeyLabel } from "./playCut.mjs"; @@ -168,10 +169,13 @@ export async function playViewWith(project, { take = null, bare = false, postFor } const selected = selectVariant(manifest, DEFAULT_VARIANT); const render = selected.render ?? {}; + // THE BASIC OUTPUT MODE (render.mode, report-to-video basic.mjs): Play plays what the basic render cuts -- + // the clips alone, their spans exactly (no lead-in), hard cuts, nothing drawn over the footage. + const basic = basicOn(render); const post = postFor ? await postFor(selected) : null; - const timeline = (selected.timeline ?? []).filter((e) => e && typeof e.id === "string"); - const D = transitionOf(render); - const durs = timeline.map((e) => estimatedDuration(e, render, D)); + const timeline = (selected.timeline ?? []).filter((e) => e && typeof e.id === "string" && (!basic || e.type === "clip")); + const D = basic ? 0 : transitionOf(render); + const durs = timeline.map((e) => (basic ? Math.max(0.5, basicSpans(e, render).reduce((n, x) => n + x.to - x.from, 0)) : estimatedDuration(e, render, D))); const { starts } = scheduleFrom(durs, D); const segments = timeline.map((e, i) => ({ id: e.id, start: Math.round(starts[i] * 1000) / 1000, duration: Math.round(durs[i] * 1000) / 1000 })); const cache = await projectCache(project, manifest); @@ -284,10 +288,12 @@ export async function playViewWith(project, { take = null, bare = false, postFor note, takes: await playableTakes(project.dir), working, - leadIn: fin(render.leadIn) ? render.leadIn : 0.4, + leadIn: basic ? 0 : fin(render.leadIn) ? render.leadIn : 0.4, transition: D, blurRendered: render.blur !== "off", - deckOn: deckOn(render), + deckOn: !basic && deckOn(render), + // A basic cut (render.mode "basic"): the footage alone -- Play draws nothing over it. + basic, segments, entries, }; diff --git a/umtool/report-to-video/package.json b/umtool/report-to-video/package.json @@ -23,6 +23,7 @@ "./brand": "./brand.mjs", "./brand-ids": "./brand-ids.mjs", "./build-video": "./build-video.mjs", + "./basic": "./basic.mjs", "./vertical": "./vertical.mjs", "./vertical-plan": "./vertical-plan.mjs", "./reframe": "./reframe.mjs",