Archilyzer · Source

archilyzer

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

commit 4b4f811c2e634bd09c4216b66bd44761cc96d52d
parent c51467df94cb62e931faf542b7f9d2cb617118ea
Author: I Mean I'm Just Saying <imeanimjustsaying@kiwifarms.st>
Date:   Thu,  5 Nov 2026 02:28:23 -0500

umtool: the Deliver tab opens on Output files -- the newest take's rendered mp4s (takes/<t>/out/<slug>.mp4 and its ladder), then the newest other takes' and the build's, each an absolute local path with Copy and a Play of its take

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

Diffstat:
Mumtool/components/projects/report/DeliverTab.tsx | 3+++
Aumtool/components/projects/report/OutputFiles.tsx | 78++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
2 files changed, 81 insertions(+), 0 deletions(-)

diff --git a/umtool/components/projects/report/DeliverTab.tsx b/umtool/components/projects/report/DeliverTab.tsx @@ -5,6 +5,7 @@ import DeliverSection from "../DeliverSection"; import PodcastExport from "../PodcastExport"; import ShortsList from "./ShortsList"; import VariantsPanel from "./VariantsPanel"; +import OutputFiles from "./OutputFiles"; import type { ReportTabProps } from "./shared"; // The Deliver tab: the deliver panel (cuts, share batches, rulings applied, @@ -29,6 +30,8 @@ export default async function DeliverTab({ project, detail }: ReportTabProps) { {/* After the build chain, because that is the order the work happens in: the video is one deliverable and the written report with its own clip files is the other, and both wait on the same walk. */} + {/* The rendered files, as local paths with Copy (lane/ui-simplify): the newest take's first. */} + <OutputFiles project={project.id} dir={project.dir} /> <DeliverSection project={project} manifest={m} entries={entries} /> {/* --- the shorts: one clip each, 1080x1920 (release 36) ---------- */} diff --git a/umtool/components/projects/report/OutputFiles.tsx b/umtool/components/projects/report/OutputFiles.tsx @@ -0,0 +1,78 @@ +import { readdir, stat } from "node:fs/promises"; +import path from "node:path"; +import CopyButton from "@/components/CopyButton"; +import { fmtBytes } from "@/lib/format"; +import { latestWorkingTake } from "@/lib/report/workingCut.mjs"; +import { listTakes } from "@/lib/report/takes.mjs"; +import PlayLink from "../PlayLink"; + +// --------------------------------------------------------------------------- +// OUTPUT FILES, AS LOCAL PATHS (lane/ui-simplify, 5 Nov; the operator's rule: +// "output files get local paths (absolute), never an /api/... download URL +// shown as the place a file is"). The newest take's rendered mp4s first -- +// takes/<t>/out/<slug>.mp4 and its ladder -- then the newest few other takes', +// then the build's out/<slug>.mp4: each an absolute path with Copy. +// --------------------------------------------------------------------------- + +type File = { path: string; bytes: number; mtimeMs: number }; + +async function mp4sIn(dir: string): Promise<File[]> { + const names = await readdir(dir).catch(() => [] as string[]); + const out: File[] = []; + for (const n of names) { + if (!n.endsWith(".mp4")) continue; + const f = path.join(dir, n); + const st = await stat(f).catch(() => null); + if (st?.isFile() && st.size > 0) out.push({ path: f, bytes: st.size, mtimeMs: st.mtimeMs }); + } + return out.sort((a, b) => a.path.localeCompare(b.path)); +} + +export default async function OutputFiles({ project, dir }: { project: string; dir: string }) { + const listing = await listTakes(dir); + const takes = (listing.takes as { id: string; builtAt?: string | null; label?: string }[]).filter((t) => t.builtAt).sort((a, b) => String(b.builtAt).localeCompare(String(a.builtAt))); + const latest = latestWorkingTake(listing.takes as never[]) as { id: string } | null; + const order = latest ? [takes.find((t) => t.id === latest.id)!, ...takes.filter((t) => t.id !== latest.id)].filter(Boolean) : takes; + const rows = await Promise.all(order.slice(0, 4).map(async (t) => ({ take: t, files: await mp4sIn(path.join(dir, "takes", t.id, "out")) }))); + const build = await mp4sIn(path.join(dir, "out")); + const shown = rows.filter((r) => r.files.length > 0); + return ( + <section data-output-files="" className="rounded border border-[var(--color-line)] bg-[var(--color-panel)] px-3 py-2"> + <h2 className="micro mb-1">Output files</h2> + {shown.length === 0 && build.length === 0 && <p className="m-0 text-[12px] text-muted">No rendered file yet: render a take (Takes, or the take card&apos;s Render full).</p>} + {shown.map(({ take, files }) => ( + <div key={take.id} className="mb-1.5" data-output-take={take.id}> + <div className="flex flex-wrap items-center gap-2 text-[12px]"> + <span className="font-mono text-text">{take.id}</span> + {latest?.id === take.id && <span className="micro text-signal-text">latest</span>} + {take.label && <span className="truncate text-text-2">{take.label}</span>} + <PlayLink project={project} take={take.id} where="outputs" variant="icon" /> + </div> + <ul className="m-0 list-none space-y-0.5 p-0"> + {files.map((f) => ( + <li key={f.path} className="flex flex-wrap items-center gap-2 font-mono text-[11px] text-text-2" data-output-file={f.path}> + <span className="break-all">{f.path}</span> + <span className="text-muted">{fmtBytes(f.bytes)}</span> + <CopyButton text={f.path} label="copy path" /> + </li> + ))} + </ul> + </div> + ))} + {build.length > 0 && ( + <div data-output-build=""> + <div className="text-[12px] text-text-2">the build</div> + <ul className="m-0 list-none space-y-0.5 p-0"> + {build.map((f) => ( + <li key={f.path} className="flex flex-wrap items-center gap-2 font-mono text-[11px] text-text-2" data-output-file={f.path}> + <span className="break-all">{f.path}</span> + <span className="text-muted">{fmtBytes(f.bytes)}</span> + <CopyButton text={f.path} label="copy path" /> + </li> + ))} + </ul> + </div> + )} + </section> + ); +}