commit e4a9cff33a7af34a18cccc5f0df3431c291afcdc parent 2491edde9c835467f2eec0abe064599584f4b5ad Author: I Mean I'm Just Saying <imeanimjustsaying@kiwifarms.st> Date: Wed, 14 Oct 2026 15:28:30 -0400 umtool: P6a audit — states wear a neutral tag, the benches' Signal outlines are outlines, a song's cuts at its full path, the Media tab says what is off - badge `state` (a dashed ink edge): "in the making", an open decision's chip, an iteration running or queued, a research proposal waiting, a refresh held by the cap, open notes, a clip not fetched yet. Verdict colours are judgements only. - Outlines: IterationsTab's Use this iteration and Start iteration, ResearchSlot's Yes and Continue, StructureEditors' saves, and the song benches (CutBench, ProvenancePanel, LoudnessTable, SpecSheet, ThumbBench, NoteField, VerdictChip, MomentMarks) on buttonVariants; a pressed toggle (blind, the picked variant, the plan shown, an accepted cover) wears the panel ground. Signal stays on focus and the cut slider. - One address per cut: the Cuts tab's cards, the provenance plan links and a song's decision hrefs use the song's full path (lib/browse.ts songProjectId); the decision's `project` stays the basename (the notes' target), and /projects/<basename>/<cut> still resolves. - Media: "Drafting is off: no article iteration made this project." / "Drafting waits for <article> i<n>, which is <status>." - Specs: the state tag and the outline (article-iterations, song-piece), the cut cards' and calls' full path, no Signal-outline control on a cut page, the Media lines. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Diffstat:
28 files changed, 107 insertions(+), 57 deletions(-)
diff --git a/umtool/components/CutBench.tsx b/umtool/components/CutBench.tsx @@ -2,6 +2,7 @@ import { useCallback, useEffect, useRef, useState } from "react"; import { useRouter } from "next/navigation"; +import { buttonVariants } from "@/components/ui/button"; import VerdictChip from "@/components/VerdictChip"; import MomentMarks from "@/components/MomentMarks"; import NoteField from "@/components/NoteField"; @@ -243,7 +244,7 @@ export default function CutBench({ onClick={() => setBlind((v) => !v)} className={`rounded border px-2.5 py-1 text-[12px] disabled:opacity-40 ${ blind - ? "border-[var(--color-sel)] text-[var(--color-sel)]" + ? "border-muted bg-panel-2 text-text" : "border-[var(--color-line)] text-[var(--color-dim)] hover:text-[var(--color-text)]" }`} > @@ -324,7 +325,7 @@ export default function CutBench({ type="button" onClick={() => void mint()} data-next-pairing - className="ml-auto rounded border border-[var(--color-sel)] px-2 py-0.5 text-[11px] text-[var(--color-sel)]" + className={`ml-auto ${buttonVariants({ size: "sm" })}`} > another pairing </button> @@ -350,7 +351,7 @@ export default function CutBench({ type="button" data-choose={w} onClick={() => void decide(w)} - className="rounded border border-[var(--color-line)] px-2.5 py-1 text-[12px] text-[var(--color-text)] hover:border-[var(--color-sel)] hover:text-[var(--color-sel)]" + className={buttonVariants({ size: "md" })} > {label} </button> @@ -405,7 +406,7 @@ export default function CutBench({ type="button" data-choose={w} onClick={() => void decide(w)} - className="rounded border border-[var(--color-line)] px-2 py-0.5 font-mono text-[11px] text-[var(--color-dim)] hover:border-[var(--color-sel)] hover:text-[var(--color-sel)]" + className={`${buttonVariants({ size: "sm" })} font-mono`} > {label} </button> @@ -430,7 +431,7 @@ export default function CutBench({ onClick={() => setPick(v.rel)} className={`rounded border px-2 py-0.5 font-mono text-[11px] ${ pick === v.rel - ? "border-[var(--color-sel)] text-[var(--color-sel)]" + ? "border-muted bg-panel-2 text-text" : "border-[var(--color-line)] text-[var(--color-dim)] hover:text-[var(--color-text)]" }`} > @@ -451,7 +452,7 @@ export default function CutBench({ type="button" disabled={busy !== null} onClick={() => act("promote", chosen.rel)} - className="rounded border border-[var(--color-sel)] px-2.5 py-1 text-[12px] text-[var(--color-sel)] hover:bg-[color-mix(in_srgb,var(--color-sel)_14%,transparent)] disabled:opacity-40" + className={buttonVariants({ size: "md" })} > promote {chosen.tag} to {cut} </button> @@ -487,7 +488,7 @@ export default function CutBench({ onClick={() => setPick(v.rel)} className={`rounded border border-dashed px-2 py-0.5 font-mono text-[11px] ${ pick === v.rel - ? "border-[var(--color-sel)] text-[var(--color-sel)]" + ? "border-muted bg-panel-2 text-text" : "border-[var(--color-line)] text-[var(--color-dim)]" }`} > @@ -564,7 +565,7 @@ function BlindPane({ return ( <section className="rounded border border-[var(--color-line)] bg-[var(--color-panel)]"> <div className="flex flex-wrap items-baseline gap-2 border-b border-[var(--color-line)] px-3 py-1.5"> - <span className="font-mono text-[13px] text-[var(--color-sel)]">{title}</span> + <span className="font-mono text-[13px] text-[var(--color-text)]">{title}</span> {revealed ? ( <span className="font-mono text-[11px] text-[var(--color-text)]" data-revealed={revealed}> {revealed} diff --git a/umtool/components/LoudnessTable.tsx b/umtool/components/LoudnessTable.tsx @@ -1,6 +1,7 @@ "use client"; import { useState } from "react"; +import { buttonVariants } from "@/components/ui/button"; import { DEFAULT_TARGET, loudnessSpread, @@ -84,7 +85,7 @@ export default function LoudnessTable({ onClick={() => void measureAll()} disabled={busy !== null} data-measure-all - className="ml-auto rounded border border-[var(--color-sel)] px-2 py-0.5 text-[11px] text-[var(--color-sel)] disabled:opacity-40" + className={`ml-auto ${buttonVariants({ size: "sm" })}`} > {busy ? `measuring ${busy}…` : "measure the rest"} </button> diff --git a/umtool/components/MomentMarks.tsx b/umtool/components/MomentMarks.tsx @@ -1,6 +1,7 @@ "use client"; import { useState } from "react"; +import { buttonVariants } from "@/components/ui/button"; import CopyButton from "@/components/CopyButton"; import type { NoteMap } from "@/lib/notes"; @@ -93,7 +94,7 @@ export default function MomentMarks({ type="button" onClick={mark} data-mark - className="rounded border border-[var(--color-sel)] px-2 py-0.5 text-[11px] text-[var(--color-sel)]" + className={buttonVariants({ size: "sm" })} > mark this moment </button> diff --git a/umtool/components/NoteField.tsx b/umtool/components/NoteField.tsx @@ -1,6 +1,7 @@ "use client"; import { useEffect, useRef, useState } from "react"; +import { buttonVariants } from "@/components/ui/button"; import { NOTE_LIMIT, type NoteEntry } from "@/lib/note-types"; // A generous note, on anything. @@ -127,7 +128,7 @@ export default function NoteField({ type="button" disabled={saving || !dirty} onClick={save} - className="rounded border border-[var(--color-sel)] px-2 py-0.5 text-[11px] text-[var(--color-sel)] disabled:opacity-40" + className={buttonVariants({ size: "sm" })} > save </button> diff --git a/umtool/components/ProvenancePanel.tsx b/umtool/components/ProvenancePanel.tsx @@ -1,6 +1,7 @@ import Link from "next/link"; import type { Provenance } from "@/lib/provenance"; import type { BuildStatus } from "@/lib/manifest"; +import { cutHref } from "@/lib/hrefs"; import { fmtDur } from "@/lib/format"; import NoteField from "@/components/NoteField"; import CopyButton from "@/components/CopyButton"; @@ -28,6 +29,7 @@ import { concentrationLine, shares } from "@/lib/concentration"; const ROW_LIMIT = 250; export default function ProvenancePanel({ + project, song, cut, prov, @@ -36,6 +38,8 @@ export default function ProvenancePanel({ notes, allNotes = false, }: { + /** The song's project id: the cut page's canonical address. */ + project: string; song: string; cut: string; prov: Provenance; @@ -44,8 +48,7 @@ export default function ProvenancePanel({ notes: NoteMap; allNotes?: boolean; }) { - const href = (plan: string | null) => - `/projects/${song}/${cut}${plan ? `?plan=${encodeURIComponent(plan)}` : ""}`; + const href = (plan: string | null) => cutHref(project, cut, plan ? { plan } : {}); const shown = allNotes ? prov.rows : prov.rows.slice(0, ROW_LIMIT); const hidden = prov.rows.length - shown.length; @@ -160,7 +163,7 @@ export default function ProvenancePanel({ data-plan={p} className={`rounded border px-1.5 py-0.5 font-mono text-[11px] ${ planParam === p - ? "border-[var(--color-sel)] text-[var(--color-sel)]" + ? "border-muted bg-panel-2 text-text" : "border-[var(--color-line)] text-[var(--color-dim)] hover:text-[var(--color-text)]" }`} > diff --git a/umtool/components/SpecSheet.tsx b/umtool/components/SpecSheet.tsx @@ -2,6 +2,7 @@ import { useEffect, useState } from "react"; import Link from "next/link"; +import { buttonVariants } from "@/components/ui/button"; import type { Operation, Spec, SpecProblem, SpecSound } from "@/lib/spec"; // The spec sheet, edited. @@ -135,7 +136,7 @@ export default function SpecSheet({ disabled={!ready || saving || !dirty} onClick={save} data-save-spec - className="ml-auto rounded border border-[var(--color-sel)] px-2.5 py-1 text-[12px] text-[var(--color-sel)] disabled:opacity-40" + className={`ml-auto ${buttonVariants({ size: "md" })}`} > {dirty ? "save" : "saved"} </button> diff --git a/umtool/components/ThumbBench.tsx b/umtool/components/ThumbBench.tsx @@ -2,6 +2,7 @@ import { useState } from "react"; import Link from "next/link"; +import { buttonVariants } from "@/components/ui/button"; import NoteField from "@/components/NoteField"; import type { NoteMap } from "@/lib/notes"; import type { ThumbView } from "@/lib/thumbs"; @@ -99,7 +100,7 @@ export default function ThumbBench({ data-thumb={c.name} data-thumb-state={c.accepted ? "accepted" : c.clash ? "clash" : "candidate"} className={`rounded border p-2 ${ - c.accepted ? "border-[var(--color-sel)]" : "border-[var(--color-line)]" + c.accepted ? "border-muted bg-panel-2" : "border-[var(--color-line)]" }`} > <div className="flex flex-wrap items-start gap-3"> @@ -120,7 +121,7 @@ export default function ThumbBench({ <div className="min-w-0 flex-1 space-y-1"> <div className="flex flex-wrap items-baseline gap-2"> <span className="font-mono text-[12px] text-[var(--color-text)]">{c.name}</span> - {c.accepted && <span className="micro text-[var(--color-sel)]">accepted</span>} + {c.accepted && <span className="micro text-[var(--color-text)]">accepted</span>} <span className="num truncate text-[11px] text-[var(--color-dim)]">{c.file}</span> </div> @@ -174,7 +175,7 @@ export default function ThumbBench({ disabled={busy !== null} onClick={() => void accept(c.name, c.file)} data-accept={c.name} - className="rounded border border-[var(--color-sel)] px-2 py-0.5 text-[11px] text-[var(--color-sel)] disabled:opacity-40" + className={buttonVariants({ size: "sm" })} > {busy === c.name ? "accepting…" : `accept — spends ${c.corners.length} videos`} </button> diff --git a/umtool/components/VerdictChip.tsx b/umtool/components/VerdictChip.tsx @@ -1,6 +1,7 @@ "use client"; import { useEffect, useState } from "react"; +import { buttonVariants } from "@/components/ui/button"; import type { Verdict, VerdictEntry } from "@/lib/browse"; // One file's judgement, small enough to sit in a variant row. @@ -132,7 +133,7 @@ export default function VerdictChip({ /> <button type="submit" - className="rounded border border-[var(--color-sel)] px-1.5 py-0.5 text-[10px] text-[var(--color-sel)]" + className={buttonVariants({ size: "sm" })} > save </button> diff --git a/umtool/components/articles/ArticlePage.tsx b/umtool/components/articles/ArticlePage.tsx @@ -161,7 +161,7 @@ export default async function ArticlePage({ )} <span data-status={missing ? "pending" : published ? "published" : "draft"} - className={badgeVariants({ variant: published ? "on" : missing ? "open" : "neutral", size: "sm" })} + className={badgeVariants({ variant: published ? "on" : missing ? "state" : "neutral", size: "sm" })} > {missing ? "in the making" : published ? "published" : "draft"} </span> diff --git a/umtool/components/articles/ArticleTable.tsx b/umtool/components/articles/ArticleTable.tsx @@ -75,7 +75,7 @@ export default function ArticleTable({ articles }: { articles: ArticleRow[] }) { <Link href={`${articleHref(a)}?status=open`} data-open-notes={a.openNotes} - className={badgeVariants({ variant: "open", size: "sm" })} + className={badgeVariants({ variant: "state", size: "sm" })} > {a.openNotes} open </Link> diff --git a/umtool/components/articles/IterationsTab.tsx b/umtool/components/articles/IterationsTab.tsx @@ -25,11 +25,11 @@ import type { ArticleIterations, DraftJobView, IterationRow, PolicyView } from " const field = "rounded border border-[var(--color-line)] bg-[var(--color-ink)] px-1.5 py-0.5 text-[12px] text-[var(--color-text)]"; -const STATUS_VARIANT: Record<string, "on" | "blocking" | "open" | "info" | "neutral"> = { +const STATUS_VARIANT: Record<string, "on" | "blocking" | "state" | "info" | "neutral"> = { done: "on", failed: "blocking", - running: "open", - queued: "open", + running: "state", + queued: "state", cancelled: "info", }; @@ -134,7 +134,7 @@ function NewIterationForm({ it, ctx, onDone }: { it: IterationRow; ctx: Ctx; onD onChange={(e) => setFeedback(e.target.value)} /> <div> - <Button type="submit" size="sm" variant="primary"> + <Button type="submit" size="sm" variant="outline"> Start iteration </Button> </div> @@ -276,7 +276,7 @@ function IterationCard({ <div className="mt-2 flex flex-wrap items-center gap-2"> {done && it.reportFrom !== null && !it.currentReport && ( - <Button size="sm" variant="primary" onClick={() => void ctx.use(it.n)}> + <Button size="sm" variant="outline" onClick={() => void ctx.use(it.n)}> Use this iteration </Button> )} diff --git a/umtool/components/articles/RefreshSummary.tsx b/umtool/components/articles/RefreshSummary.tsx @@ -13,11 +13,11 @@ import RefreshWatch from "./RefreshWatch"; // again every few seconds (RefreshWatch). // --------------------------------------------------------------------------- -const STATUS: Record<string, { label: string; variant: "neutral" | "on" | "blocking" | "open" | "info" | "meter" }> = { +const STATUS: Record<string, { label: string; variant: "neutral" | "on" | "blocking" | "state" | "info" | "meter" }> = { running: { label: "running", variant: "meter" }, "no-change": { label: "no change", variant: "info" }, updated: { label: "updated", variant: "on" }, - "held-by-cap": { label: "held by the cap", variant: "open" }, + "held-by-cap": { label: "held by the cap", variant: "state" }, failed: { label: "failed", variant: "blocking" }, cancelled: { label: "cancelled", variant: "info" }, }; diff --git a/umtool/components/articles/ResearchSlot.tsx b/umtool/components/articles/ResearchSlot.tsx @@ -27,9 +27,9 @@ import type { ResearchProposal, ResearchView } from "@/lib/articles/research"; const field = "rounded border border-[var(--color-line)] bg-[var(--color-ink)] px-1.5 py-0.5 text-[12px] text-[var(--color-text)]"; -const STATUS_VARIANT: Record<string, "on" | "blocking" | "open" | "info" | "neutral" | "meter"> = { - proposed: "open", - approved: "open", +const STATUS_VARIANT: Record<string, "on" | "blocking" | "state" | "info" | "neutral" | "meter"> = { + proposed: "state", + approved: "state", enqueued: "meter", done: "on", failed: "blocking", @@ -186,7 +186,7 @@ function ProposalRow({ {p.status === "done" && p.channel && <p className="font-mono text-[11px] text-[var(--color-dim)]">channel {p.channel}</p>} {waits && canDecide && ( <div className="flex flex-wrap items-center gap-2"> - <Button size="sm" variant="primary" disabled={busy} aria-label={`Yes to ${p.id}`} onClick={() => decide(p.id, true)}> + <Button size="sm" variant="outline" disabled={busy} aria-label={`Yes to ${p.id}`} onClick={() => decide(p.id, true)}> Yes </Button> <Button size="sm" variant="destructive" disabled={busy} aria-label={`No to ${p.id}`} onClick={() => decide(p.id, false, why)}> @@ -330,7 +330,7 @@ export default function ResearchSlot({ )} <Button size="sm" - variant="primary" + variant="outline" disabled={busy} onClick={() => void post({ task: "sweep", article, iteration: n, model, ...extractorBody(model, extractorModel, extractor) })} > diff --git a/umtool/components/notes/AnchoredNotes.tsx b/umtool/components/notes/AnchoredNotes.tsx @@ -41,7 +41,7 @@ export default function AnchoredNotes({ type="button" data-action="toggle-notes" onClick={() => setOpen((o) => !o)} - className={openCount ? badgeVariants({ variant: "open", size: "sm" }) : "ink-link"} + className={openCount ? badgeVariants({ variant: "state", size: "sm" }) : "ink-link"} > {openCount ? `${openCount} open ${openCount === 1 ? "note" : "notes"}` : mine.length ? `${label} (${mine.length})` : `+ ${label.replace(/s$/, "")}`} </button> diff --git a/umtool/components/projects/ClipBench.tsx b/umtool/components/projects/ClipBench.tsx @@ -2162,7 +2162,7 @@ export default function ClipBench({ data }: { data: ClipBenchData }) { ready {data.ready} of {data.needing} needing judgement </span> {!data.fetched && ( - <span className={badgeVariants({ variant: "open", size: "sm" })} data-clip-unfetched=""> + <span className={badgeVariants({ variant: "state", size: "sm" })} data-clip-unfetched=""> not fetched yet </span> )} diff --git a/umtool/components/projects/CutPage.tsx b/umtool/components/projects/CutPage.tsx @@ -136,6 +136,7 @@ export default async function CutPage({ </div> <div className="px-4 pb-4"> <ProvenancePanel + project={project.id} song={song.id} cut={cutName} prov={prov} diff --git a/umtool/components/projects/MediaDrafts.tsx b/umtool/components/projects/MediaDrafts.tsx @@ -538,11 +538,11 @@ export default function MediaDrafts({ <GateLine view={view} /> {!link.ok ? ( <p data-draft-unlinked="" title={link.why} className="m-0 text-[12px] text-muted"> - Not from an article iteration — Draft with is off here. + Drafting is off: no article iteration made this project. </p> ) : link.status !== "done" ? ( <p data-draft-unlinked="" className="m-0 text-[12px] text-muted"> - {link.article} i{link.n} is {link.status} — Draft with waits for it to finish. + Drafting waits for {link.article} i{link.n}, which is {link.status}. </p> ) : ( policyError && ( diff --git a/umtool/components/projects/SongProject.tsx b/umtool/components/projects/SongProject.tsx @@ -58,7 +58,7 @@ export default async function SongProject({ note={`${song.present}/${song.cuts.length} cuts · ${song.variantCount} variants`} > {tab === "overview" && <OverviewTab project={project} song={song} frame={frame} covers={thumbs} />} - {tab === "cuts" && <CutsTab song={song} notes={notes} />} + {tab === "cuts" && <CutsTab projectId={project.id} song={song} notes={notes} />} {tab === "spec" && <SpecTab song={song} notes={notes} />} {tab === "cover" && <CoverTab song={song} view={thumbs} notes={notes} />} {tab === "notes" && <NotesTab projectId={project.id} song={song} notes={notes} />} diff --git a/umtool/components/projects/StructureEditors.tsx b/umtool/components/projects/StructureEditors.tsx @@ -164,7 +164,7 @@ function TeaserEditor({ <label>tail wait <input value={tailWait} onChange={(e) => edit(setTailWait)(e.target.value)} className={`${input} w-14`} /></label> <label>dip fade <input value={fade} onChange={(e) => edit(setFade)(e.target.value)} className={`${input} w-14`} /></label> <label>black <input value={black} onChange={(e) => edit(setBlack)(e.target.value)} className={`${input} w-14`} /></label> - <button type="button" data-testid={`teaser-save-${t.id}`} disabled={busy} onClick={submit} className={buttonVariants({ variant: "primary", size: "sm" })}> + <button type="button" data-testid={`teaser-save-${t.id}`} disabled={busy} onClick={submit} className={buttonVariants({ variant: "outline", size: "sm" })}> Save teaser </button> {local && <span className="text-[var(--color-bad)]">{local}</span>} @@ -242,7 +242,7 @@ function PostRow({ post, fresh = false, busy, save, remove }: { post: Post; fres for (const k of POST_FIELDS) p[k] = d[k]; void save(p); }} - className={buttonVariants({ variant: "primary", size: "sm" })} + className={buttonVariants({ variant: "outline", size: "sm" })} > {fresh ? "Add post" : "Save post"} </button> @@ -301,7 +301,7 @@ function FactcheckEditor({ doc, busy, save }: { doc: Doc; busy: boolean; save: ( </div> <div className="flex items-center gap-2 text-[var(--color-dim)]"> <label>stamp seconds <input value={seconds} placeholder={String(doc.factcheckResolved.stamp.seconds)} onChange={(e) => setSeconds(e.target.value)} className={`${input} w-14`} /></label> - <button type="button" data-testid="fc-save" disabled={busy} onClick={submit} className={buttonVariants({ variant: "primary", size: "sm" })}> + <button type="button" data-testid="fc-save" disabled={busy} onClick={submit} className={buttonVariants({ variant: "outline", size: "sm" })}> Save labels </button> </div> diff --git a/umtool/components/projects/report/shared.tsx b/umtool/components/projects/report/shared.tsx @@ -32,7 +32,7 @@ export const hms = (t: number) => { export const TONE: Record<Severity, BadgeVariants["variant"]> = { blocking: "blocking", - open: "open", + open: "state", info: "info", }; diff --git a/umtool/components/projects/song/CutsTab.tsx b/umtool/components/projects/song/CutsTab.tsx @@ -3,14 +3,15 @@ import VerdictChip from "@/components/VerdictChip"; import NoteField from "@/components/NoteField"; import { probeAll, type Cut, type Song } from "@/lib/browse"; import { fmtAgo, fmtBytes, fmtDur } from "@/lib/format"; +import { cutHref } from "@/lib/hrefs"; import type { NoteMap } from "@/lib/notes"; // The Cuts tab: the four cut cards (poster, verdicts, the slot's and the // file's notes, the variants) and what matches no cut -- SongProject's left // column, moved unchanged (P4a-3). A cut's own page (/projects/<song>/<cut>, -// CutPage) is this tab's view of one cut. +// CutPage) is this tab's view of one cut, linked at the song's full path (P6). -export default async function CutsTab({ song, notes }: { song: Song; notes: NoteMap }) { +export default async function CutsTab({ projectId, song, notes }: { projectId: string; song: Song; notes: NoteMap }) { // Durations are worth an ffprobe HERE but not on the index: this page is a // handful of files and "which of these is the short cut" is exactly the // question it answers. Memoised by mtime in lib/browse.ts. @@ -23,7 +24,7 @@ export default async function CutsTab({ song, notes }: { song: Song; notes: Note return ( <div className="max-w-[1100px] space-y-3" data-song-cuts=""> {song.cuts.map((cut) => ( - <CutCard key={cut.name} song={song} cut={cut} info={info} notes={notes} /> + <CutCard key={cut.name} projectId={projectId} song={song} cut={cut} info={info} notes={notes} /> ))} {song.unattributed.length > 0 && ( @@ -46,11 +47,13 @@ export default async function CutsTab({ song, notes }: { song: Song; notes: Note } function CutCard({ + projectId, song, cut, info, notes, }: { + projectId: string; song: Song; cut: Cut; info: Record<string, { duration: number; width: number; height: number }>; @@ -85,7 +88,7 @@ function CutCard({ <div className="min-w-0 flex-1 space-y-1"> <div className="flex flex-wrap items-baseline gap-2"> <Link - href={`/projects/${song.id}/${cut.name}`} + href={cutHref(projectId, cut.name)} className="ink-link font-mono text-[13px]" > {cut.name} diff --git a/umtool/components/ui/badge.tsx b/umtool/components/ui/badge.tsx @@ -16,7 +16,9 @@ import { cn } from "@/lib/utils"; // primary action). // - `sm` is a STATUS TAG: mono, caps, in the colour of what it reports. // The variants name ROLES (app/globals.css): blocking/open are the reject and -// doubt words, `meter` is a measurement, neutral/info are ink. +// doubt words, `meter` is a measurement, neutral/info are ink, and `state` is a +// state that is not a judgement (in the making, running, open, waiting): a +// dashed ink edge, never a verdict colour. // --------------------------------------------------------------------------- export const badgeVariants = cva( @@ -30,6 +32,7 @@ export const badgeVariants = cva( open: "border-doubt-text text-doubt-text", info: "border-seam-2 text-muted", meter: "border-meter text-meter", + state: "border-dashed border-muted text-text-2", }, size: { sm: "px-1.5 py-px font-mono text-[10px] uppercase tracking-wider", diff --git a/umtool/e2e/article-iterations.spec.ts b/umtool/e2e/article-iterations.spec.ts @@ -44,6 +44,9 @@ test("an article in the making: listed as such on Work, opened as its piece, its // The article piece (P4a-2) opens on its Overview, the iterations summarised there. await expect(page).toHaveURL(new RegExp(`${urls.articleHref(ZETA)}$`)); await expect(page.locator("[data-article-meta] [data-status]")).toHaveAttribute("data-status", "pending"); + // In the making is a state, not a judgement: the neutral state tag, never a verdict colour (P6). + await expect(page.locator("[data-article-meta] [data-status]")).toHaveClass(/border-dashed/); + await expect(page.locator("[data-article-meta] [data-status]")).not.toHaveClass(/doubt/); await expect(page.locator("[data-piece-iterations='4']")).toBeVisible(); await page.getByTestId("piece-tab-iterations").click(); @@ -100,7 +103,9 @@ test("use, revise, copy with model, cancel: each through the editor, the list fo await page.goto(urls.articleHref({ site: "articles", id: ARTICLE }, { tab: "iterations" })); await expect(card(page, 1)).toHaveAttribute("data-status", "done", { timeout: 20_000 }); - // USE THIS ITERATION: the registry writes the article's report.json. + // USE THIS ITERATION: the registry writes the article's report.json. An + // outline (P6): the tab's filled action is the Next card's, not a card's. + await expect(card(page, 1).getByRole("button", { name: "Use this iteration" })).not.toHaveClass(/signal/); await card(page, 1).getByRole("button", { name: "Use this iteration" }).click(); await expect(page.getByRole("status").filter({ hasText: "the article is i1" })).toBeVisible(); await expect(card(page, 1).locator("[data-current='article']")).toBeVisible(); diff --git a/umtool/e2e/media-surfaces.spec.ts b/umtool/e2e/media-surfaces.spec.ts @@ -97,7 +97,7 @@ test("Draft with <model> per section: the job followed, the badge, the last run, // A project made from no iteration offers no draft, and says why. await page.goto(urls.section("reports/youtube-fixture", "drafts")); - await expect(page.getByRole("region", { name: "Media drafts" }).locator("[data-draft-unlinked]")).toHaveText("Not from an article iteration — Draft with is off here."); + await expect(page.getByRole("region", { name: "Media drafts" }).locator("[data-draft-unlinked]")).toHaveText("Drafting is off: no article iteration made this project."); }); test("Draft everything: every draft in order on the model chosen, a refused one passed, the panels skipped, then the fast build, the podcast and out/youtube.txt", async ({ page }) => { diff --git a/umtool/e2e/piece.spec.ts b/umtool/e2e/piece.spec.ts @@ -381,7 +381,7 @@ test("the Media tab: every drafted field with where it came from, approve per fi await expect(media.locator("[data-draft-row]")).toHaveCount(3); // Made from no iteration, it drafts nothing: the sections with fields, in Draft everything's order. await expect(media.locator("[data-media-section]")).toHaveCount(2); - await expect(media.locator("[data-draft-unlinked]")).toHaveText("Not from an article iteration — Draft with is off here."); + await expect(media.locator("[data-draft-unlinked]")).toHaveText("Drafting is off: no article iteration made this project."); const m01 = media.locator("[data-draft-row='onscreen/m01/onscreen']"); await expect(m01.locator("[data-draft-text]")).toContainText("She will not sell"); diff --git a/umtool/e2e/song-piece.spec.ts b/umtool/e2e/song-piece.spec.ts @@ -56,6 +56,11 @@ test("the frame: title, trail, the Spec → Cuts → Done stepper, five tabs, th await expect(page.locator("[data-cut]")).toHaveCount(0); await expect(page.locator("[data-op]")).toHaveCount(0); await expect(page.locator("[data-note-for=song]")).toHaveCount(0); + // An open decision is a state: its chip is the neutral state tag, never the doubt colour (P6). + const openChip = page.locator("[data-decision][data-severity=open]").first().locator("span").first(); + await expect(openChip).toHaveText(/open/i); + await expect(openChip).toHaveClass(/border-dashed/); + await expect(openChip).not.toHaveClass(/doubt/); }); test("a song with a hole is at Cuts, and Work files it where its stepper says", async ({ page }) => { @@ -91,14 +96,18 @@ test("the Next card is the song's top Inbox call, and its one action goes where await expect(action).toHaveText(top!.action.label); }); -test("a song's calls land on their tab: the spec's on Spec, a cover's on Cover, a cut's on its page", async ({ request }) => { +test("a song's calls land on their tab: the spec's on Spec, a cover's on Cover, a cut's on its page -- at the full path", async ({ request }) => { const items = ((await (await request.get("/api/browse/decisions?project=alpha")).json()) as { items: { kind: string; href: string }[] }).items; const WHERE: Record<string, string> = { "spec-problem": "spec", "no-plan": "spec", unattributed: "cuts", "thumb-unaccepted": "cover" }; const songWide = items.filter((d) => WHERE[d.kind]); expect(songWide.length, "alpha names no plan, so at least that call").toBeGreaterThan(0); - for (const d of songWide) expect(d.href, d.kind).toBe(`/projects/alpha?tab=${WHERE[d.kind]}`); - for (const d of items.filter((x) => x.kind === "unjudged-variant" || x.kind === "stale-recipe")) { - expect(d.href, d.kind).toMatch(/^\/projects\/alpha\/(wide|wide-short|vertical|vertical-short)(\?|$)/); + // The song's canonical address is its full path (P6); the basename stays the + // decision's project, the notes' target. + for (const d of songWide) expect(d.href, d.kind).toBe(urls.projectHref(ALPHA, { tab: WHERE[d.kind] })); + const cutCalls = items.filter((x) => x.kind === "unjudged-variant" || x.kind === "stale-recipe"); + expect(cutCalls.length).toBeGreaterThan(0); + for (const d of cutCalls) { + expect(d.href, d.kind).toMatch(new RegExp(`^/projects/${ALPHA}/(wide|wide-short|vertical|vertical-short)(\\?|$)`)); } }); @@ -110,6 +119,9 @@ test("the tab is the URL: ?tab=, a note's target, a bad tab the Overview, and th await expect(tab(page, "cuts")).toHaveAttribute("aria-current", "page"); await expect(page.locator("[data-cut]")).toHaveCount(4); await expect(page.locator("[data-song-slot]")).toHaveCount(0); + // A cut card links the cut at the song's full path (P6), as the Overview's + // slots and the picker do; the basename still resolves (below, and the 1366 test). + await expect(page.locator("[data-cut=wide]").getByRole("link", { name: "wide", exact: true })).toHaveAttribute("href", urls.cutHref(ALPHA, "wide")); await page.goto(urls.songSection("alpha", "spec")); await expect(page.locator("[data-op=trim-hooks]")).toBeVisible(); @@ -148,6 +160,8 @@ test("a cut's page is a view of the Cuts tab: the frame, the four cuts beside th const picker = page.locator("[data-song-cut-picker=wide]"); await expect(picker.locator("[aria-current=page]")).toHaveText("wide"); await expect(page.locator("[data-loudness='wide.mp4']")).toBeVisible(); + // The bench's controls are outlines; Signal is only focus and the lit line (P6). + await expect(page.locator("main button[class*='color-sel'], main a[class*='border-[var(--color-sel)]']")).toHaveCount(0); // The trail's project id is the way back to the song. await expect(page.getByRole("navigation", { name: "Breadcrumb" }).getByRole("link", { name: ALPHA })).toHaveAttribute( "href", diff --git a/umtool/lib/browse.ts b/umtool/lib/browse.ts @@ -28,6 +28,17 @@ import { acceptedFor, readThumbAccepted, type ThumbDoc } from "./thumbs"; /** The root the whole feature hangs off. `SONG_REPORTS_DIR` already moves it. */ export const BROWSE_ROOT = path.join(SONG_REPORTS, "videos"); +/** + * A song's project id -- its path under REPORTS_ROOT, the one canonical address + * (`/projects/<id>`, `/projects/<id>/<cut>`) -- from the basename the song + * readers key by. A song outside REPORTS_ROOT keeps its basename, which the + * project resolver takes as an alias when it is unique. + */ +export function songProjectId(name: string): string { + const rel = path.relative(REPORTS_ROOT, path.join(BROWSE_ROOT, name)); + return rel && !rel.startsWith("..") && !path.isAbsolute(rel) ? rel.split(path.sep).join("/") : name; +} + // The cut list is FIXED, not derived from the directory. // // mortal-kombat and mario-rpg have no vertical.mp4, and a scan-derived list diff --git a/umtool/lib/decisions.ts b/umtool/lib/decisions.ts @@ -1,4 +1,5 @@ -import { readSong, resolveRendition, thumbAliasesFor } from "./browse"; +import { readSong, resolveRendition, songProjectId, thumbAliasesFor } from "./browse"; +import { cutHref as cutPageHref, projectHref } from "./hrefs"; import { cachedLoudness } from "./loudness"; import { DEFAULT_TARGET, loudnessVerdict } from "./loudness-types"; import { buildStatus, readManifest } from "./manifest"; @@ -139,8 +140,10 @@ export async function decisionsForSong(id: string): Promise<Decision[]> { // A song-wide call opens the song piece's tab its section is on (P4a-3, // lib/pieces/song-tabs.mjs): the spec's on Spec, a stray variant on Cuts, a // cover on Cover. A cut's call opens the cut's page (the Cuts tab's view). - const songHref = (section: string) => `/projects/${id}?tab=${songTabOfSection(section)}`; - const cutHref = (cut: string) => `/projects/${id}/${cut}`; + // Both on the song's canonical address, its full path (P6); the basename + // stays the decision's `project`, the notes' target. + const songHref = (section: string) => projectHref(songProjectId(id), { tab: songTabOfSection(section) }); + const cutHref = (cut: string) => cutPageHref(songProjectId(id), cut); const target = { lufs: spec.loudness?.targetLufs ?? DEFAULT_TARGET.lufs, truePeak: spec.loudness?.truePeak ?? DEFAULT_TARGET.truePeak,