Archilyzer · Source

archilyzer

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

commit 67a9bd9f7f9bd05b5efdaaae531ba77517003867
parent d2d51b0eeee4604f8d09b8a015efb1db37088126
Author: I Mean I'm Just Saying <imeanimjustsaying@kiwifarms.st>
Date:   Wed, 14 Oct 2026 05:57:02 -0400

umtool: Signal only on the lit line and the one primary action — r28's links and states on the piece page in ink and the role tokens; its hrefs through lib/hrefs; benches back to the Cut; a project-wide decision links its tab

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

Diffstat:
Mumtool/app/articles/page.tsx | 2+-
Mumtool/components/articles/ChainPanel.tsx | 2+-
Mumtool/components/articles/IterationsTab.tsx | 4++--
Mumtool/components/articles/NewArticleForm.tsx | 4++--
Mumtool/components/articles/ResearchSlot.tsx | 2+-
Mumtool/components/projects/ClaimBenchPage.tsx | 2+-
Mumtool/components/projects/ClipBenchPage.tsx | 2+-
Mumtool/components/projects/DeliverSection.tsx | 2+-
Mumtool/components/projects/DraftPanel.tsx | 5+++--
Mumtool/components/projects/DraftsReview.tsx | 5+++--
Mumtool/components/projects/NarrationPage.tsx | 7++++---
Mumtool/components/projects/OnscreenSection.tsx | 8++++----
Mumtool/components/projects/ReportBuildChain.tsx | 2+-
Mumtool/components/projects/ReviewPage.tsx | 5+++--
Mumtool/components/projects/StructureEditors.tsx | 2+-
Mumtool/components/projects/TakesPage.tsx | 4++--
Mumtool/components/projects/report/BuildTab.tsx | 14++++++++------
Mumtool/components/projects/report/CutTab.tsx | 27++++++++++++++-------------
Mumtool/components/projects/report/HistoryTab.tsx | 4++--
Mumtool/components/projects/report/MediaTab.tsx | 5+++--
Mumtool/components/projects/report/SourcesTab.tsx | 7++++---
Mumtool/lib/projects/report.mjs | 26++++++++++++++++++++++++--
22 files changed, 86 insertions(+), 55 deletions(-)

diff --git a/umtool/app/articles/page.tsx b/umtool/app/articles/page.tsx @@ -73,7 +73,7 @@ export default async function ArticlesPage({ searchParams }: { searchParams: Pro <ul className="flex flex-col gap-1 text-[12px]"> {pending.map((p) => ( <li key={p.id} data-pending-article={p.id} data-status={p.newest?.status ?? "none"} className="flex flex-wrap items-baseline gap-2"> - <Link href={`/articles/${p.id}?tab=iterations`} className="font-mono text-[var(--color-text)] hover:text-[var(--color-sel)]"> + <Link href={`/articles/${p.id}?tab=iterations`} className="font-mono text-[var(--color-text)] hover:underline"> {p.id} </Link> {p.newest && ( diff --git a/umtool/components/articles/ChainPanel.tsx b/umtool/components/articles/ChainPanel.tsx @@ -112,7 +112,7 @@ export default function ChainPanel({ {chain.steps.map((s, i) => ( <li key={s.name} data-chain-step={s.name} data-step-status={s.status} title={s.detail ?? undefined} className="flex items-center gap-2"> <span className="num w-5 text-right text-[var(--color-dim)]">{i + 1}</span> - <span className={s.name === startAt && !running ? "text-[var(--color-sel)]" : s.optional ? "italic" : ""}>{s.label}</span> + <span className={s.name === startAt && !running ? "font-semibold text-[var(--color-text)]" : s.optional ? "italic" : ""}>{s.label}</span> {s.status !== "pending" && ( <span className={badgeVariants({ variant: STATUS_VARIANT[s.status] ?? "neutral", size: "sm" })}>{s.status}</span> )} diff --git a/umtool/components/articles/IterationsTab.tsx b/umtool/components/articles/IterationsTab.tsx @@ -232,7 +232,7 @@ function IterationCard({ data-iteration={it.n} data-kind={it.kind} data-status={it.status} - className={`rounded border p-3 ${it.currentReport || it.currentVideo ? "border-[var(--color-sel)]" : "border-[var(--color-line)]"} bg-[var(--color-panel)]`} + className={`rounded border p-3 ${it.currentReport || it.currentVideo ? "border-[var(--color-muted)]" : "border-[var(--color-line)]"} bg-[var(--color-panel)]`} > <header className="flex flex-wrap items-baseline gap-x-2 gap-y-1"> <h3 className="font-mono text-[15px] text-[var(--color-text)]">{it.label}</h3> @@ -539,7 +539,7 @@ export default function IterationsTab({ {compare.length === 2 && ( <Link href={`/articles/${article}/compare?a=${Math.min(...compare)}&b=${Math.max(...compare)}`} - className="ml-auto text-[var(--color-sel)] hover:underline" + className="ink-link ml-auto" > Compare i{Math.min(...compare)} and i{Math.max(...compare)} </Link> diff --git a/umtool/components/articles/NewArticleForm.tsx b/umtool/components/articles/NewArticleForm.tsx @@ -59,7 +59,7 @@ function ChannelPicker({ value, onChange }: { value: string[]; onChange: (v: str type="button" data-picked={s} aria-label={`remove ${nameOf(s)}`} - className="rounded border border-[var(--color-sel)] px-1.5 py-0.5 text-[12px] text-[var(--color-sel)] hover:bg-[var(--color-panel-2)]" + className="rounded border border-[var(--color-muted)] bg-[var(--color-panel-2)] px-1.5 py-0.5 text-[12px] text-[var(--color-text)] hover:bg-[var(--color-panel-2)]" onClick={() => toggle(s)} > {nameOf(s)} × @@ -86,7 +86,7 @@ function ChannelPicker({ value, onChange }: { value: string[]; onChange: (v: str type="button" aria-pressed={value.includes(c.slug)} title={`${c.slug}${c.sites.length ? ` · on ${c.sites.join(", ")}` : " · on no site"}`} - className={`rounded border px-1.5 py-0.5 text-[12px] hover:bg-[var(--color-panel-2)] ${value.includes(c.slug) ? "border-[var(--color-sel)] text-[var(--color-sel)]" : "border-[var(--color-line)]"}`} + className={`rounded border px-1.5 py-0.5 text-[12px] hover:bg-[var(--color-panel-2)] ${value.includes(c.slug) ? "border-[var(--color-muted)] bg-[var(--color-panel-2)] text-[var(--color-text)]" : "border-[var(--color-line)]"}`} onClick={() => toggle(c.slug)} > {c.name} diff --git a/umtool/components/articles/ResearchSlot.tsx b/umtool/components/articles/ResearchSlot.tsx @@ -161,7 +161,7 @@ function ProposalRow({ <ul className="flex flex-wrap gap-x-3 text-[11px]" aria-label={`${p.id} evidence`}> {p.evidence.map((href) => ( <li key={href}> - <a href={href} target="_blank" rel="noreferrer noopener" className="break-all text-[var(--color-sel)] hover:underline"> + <a href={href} target="_blank" rel="noreferrer noopener" className="ink-link break-all"> {href} </a> </li> diff --git a/umtool/components/projects/ClaimBenchPage.tsx b/umtool/components/projects/ClaimBenchPage.tsx @@ -92,7 +92,7 @@ export default async function ClaimBenchPage({ rail="collapsed" crumbs={[ { href: browseHref(), label: "projects" }, - { href: projectHref(project.id), label: project.name }, + { href: projectHref(project.id, { tab: "cut" }), label: project.name }, { label: claimId }, ]} note={`claim ${i + 1} of ${ledger.length} · ${outstanding} unadjudicated`} diff --git a/umtool/components/projects/ClipBenchPage.tsx b/umtool/components/projects/ClipBenchPage.tsx @@ -172,7 +172,7 @@ export default async function ClipBenchPage({ rail="collapsed" crumbs={[ { href: browseHref(), label: "projects" }, - { href: projectHref(project.id), label: project.name }, + { href: projectHref(project.id, { tab: "cut" }), label: project.name }, { label: clipId }, ]} // The progress reading moved INTO the bench, where pressing `y` can diff --git a/umtool/components/projects/DeliverSection.tsx b/umtool/components/projects/DeliverSection.tsx @@ -116,7 +116,7 @@ export default async function DeliverSection({ className="border-t border-[var(--color-line)] align-top" > <td className="px-1.5 py-1"> - <span className="font-mono text-[var(--color-sel)]">{s.letter}</span>{" "} + <span className="font-mono text-[var(--color-text)]">{s.letter}</span>{" "} <span className="text-[var(--color-dim)]">{s.heading ?? "—"}</span> </td> <td className="num px-1.5 py-1">{s.total}</td> diff --git a/umtool/components/projects/DraftPanel.tsx b/umtool/components/projects/DraftPanel.tsx @@ -5,6 +5,7 @@ import { useRouter } from "next/navigation"; import { useCallback, useEffect, useRef, useState } from "react"; import { badgeVariants } from "@/components/ui/badge"; import { Button } from "@/components/ui/button"; +import { reviewHref } from "@/lib/hrefs"; import { DraftAlternatives, DraftBadge, announceDraftsChanged, useDrafts } from "./drafts"; import { announceManifestChanged } from "./timelineApi"; import type { DraftRowView, DraftRunSummary, ProjectIteration } from "@/lib/articles/projectDraft"; @@ -243,7 +244,7 @@ function DraftRow({ </div> )} {!row.address && run && run.alternatives > 0 && ( - <Link href={`/browse/${project}/review`} className="text-[11px] text-[var(--color-sel)] hover:underline"> + <Link href={reviewHref(project)} className="ink-link text-[11px]"> {run.alternatives} alternative(s) kept — review them </Link> )} @@ -309,7 +310,7 @@ export default function DraftPanel({ {link.ok && ( <span className="text-[11px] text-[var(--color-dim)]"> steps on{" "} - <Link href={`/articles/${link.article}?tab=iterations`} className="font-mono text-[var(--color-sel)] hover:underline"> + <Link href={`/articles/${link.article}?tab=iterations`} className="ink-link font-mono"> {link.article} i{link.n} </Link> </span> diff --git a/umtool/components/projects/DraftsReview.tsx b/umtool/components/projects/DraftsReview.tsx @@ -1,6 +1,7 @@ "use client"; import Link from "next/link"; +import { narrationHref, projectHref } from "@/lib/hrefs"; import { DraftAlternatives, DraftBadge, useDrafts, type DraftsView } from "./drafts"; // `/browse/<project>/review`'s list (release 28, M0): every drafted field of @@ -39,7 +40,7 @@ export default function DraftsReview({ project, initial }: { project: string; in {drafted.length === 0 && loose.length === 0 && ( <p data-drafts-empty="" className="text-[12px] text-[var(--color-dim)]"> Nothing in this cut was drafted.{" "} - <Link href={`/browse/${project}`} className="text-[var(--color-sel)] hover:underline"> + <Link href={projectHref(project, { tab: "media" })} className="ink-link"> back to {project} </Link> </p> @@ -55,7 +56,7 @@ export default function DraftsReview({ project, initial }: { project: string; in <span className="font-mono text-[12px] text-[var(--color-text)]">{where(r.entry, r.field)}</span> <span className="micro">{r.label}</span> {r.field === "narration" && ( - <Link href={`/browse/${project}/narration`} className="text-[11px] text-[var(--color-sel)] hover:underline"> + <Link href={narrationHref(project)} className="ink-link text-[11px]"> edit and play on the narration page </Link> )} diff --git a/umtool/components/projects/NarrationPage.tsx b/umtool/components/projects/NarrationPage.tsx @@ -1,5 +1,6 @@ import Link from "next/link"; import BrowseHeader from "@/components/BrowseHeader"; +import { projectHref, projectsHref } from "@/lib/hrefs"; import { readManifest } from "@/lib/projects/report.mjs"; import { manifestToken } from "@/lib/report/manifest.mjs"; import { narrationReviewView } from "@/lib/report/narration-review.mjs"; @@ -21,8 +22,8 @@ export default async function NarrationPage({ project }: { project: ProjectRef } <div className="flex h-full flex-col"> <BrowseHeader crumbs={[ - { href: "/browse", label: "projects" }, - { href: `/browse/${project.id}`, label: project.id }, + { href: projectsHref(), label: "projects" }, + { href: projectHref(project.id), label: project.id }, { label: "narration" }, ]} note={ @@ -37,7 +38,7 @@ export default async function NarrationPage({ project }: { project: ProjectRef } {view.rows.length === 0 ? ( <p data-narration-empty="" className="text-[12px] text-[var(--color-dim)]"> No card in this cut carries a narration.{" "} - <Link href={`/browse/${project.id}`} className="text-[var(--color-sel)] hover:underline"> + <Link href={projectHref(project.id, { tab: "media" })} className="ink-link"> back to {project.id} </Link> </p> diff --git a/umtool/components/projects/OnscreenSection.tsx b/umtool/components/projects/OnscreenSection.tsx @@ -1398,7 +1398,7 @@ export default function OnscreenSection({ <button type="button" onClick={() => jump(row.id)} - className={`font-mono text-[11px] hover:underline ${isCurrent ? "text-[var(--color-sel)]" : "text-[var(--color-text)]"}`} + className={`font-mono text-[11px] hover:underline ${isCurrent ? "font-semibold text-[var(--color-text)]" : "text-[var(--color-text-2)]"}`} title="show this entry in the preview" > {row.id} @@ -1585,7 +1585,7 @@ export default function OnscreenSection({ target="_blank" rel="noreferrer noopener" data-testid="onscreen-post-link" - className="text-[11px] text-[var(--color-sel)] hover:underline" + className="ink-link text-[11px]" > open the post ↗ </a> @@ -1629,7 +1629,7 @@ export default function OnscreenSection({ <button type="button" data-testid="onscreen-post-jump" - className="num font-mono text-[var(--color-sel)] hover:underline" + className="ink-link num font-mono" onClick={() => setT(Math.min(schedule.total, Math.round(((p.timing!.in ?? p.timing!.appear ?? 0) + (p.timing!.in != null ? 1.5 : 0.25)) * 1000) / 1000))} title="show this post in the preview" > @@ -1875,7 +1875,7 @@ export default function OnscreenSection({ </span> </div> <div className="flex flex-wrap items-center gap-2 text-[11px] text-[var(--color-dim)]"> - <span className="font-mono text-[var(--color-sel)]" data-testid="onscreen-current"> + <span className="font-mono text-[var(--color-text)]" data-testid="onscreen-current"> {current?.id ?? "—"} </span> {schedule.estimated ? ( diff --git a/umtool/components/projects/ReportBuildChain.tsx b/umtool/components/projects/ReportBuildChain.tsx @@ -35,7 +35,7 @@ type Preset = { id: string; label: string }; const CLIP_STATE = { pending: "border-[var(--color-line)] text-[var(--color-dim)]", fetching: "border-[var(--color-meter)] text-[var(--color-meter)]", - cutting: "border-[var(--color-sel)] text-[var(--color-sel)]", + cutting: "border-[var(--color-text-2)] text-[var(--color-text)]", done: "border-[var(--color-good)] text-[var(--color-good)]", failed: "border-[var(--color-bad)] text-[var(--color-bad)]", } as const; diff --git a/umtool/components/projects/ReviewPage.tsx b/umtool/components/projects/ReviewPage.tsx @@ -1,4 +1,5 @@ import BrowseHeader from "@/components/BrowseHeader"; +import { projectHref, projectsHref } from "@/lib/hrefs"; import { readManifest } from "@/lib/projects/report.mjs"; import { manifestToken } from "@/lib/report/manifest.mjs"; import { draftsView } from "@/lib/report/drafts.mjs"; @@ -19,8 +20,8 @@ export default async function ReviewPage({ project }: { project: ProjectRef }) { <div className="flex h-full flex-col"> <BrowseHeader crumbs={[ - { href: "/browse", label: "projects" }, - { href: `/browse/${project.id}`, label: project.id }, + { href: projectsHref(), label: "projects" }, + { href: projectHref(project.id), label: project.id }, { label: "review" }, ]} note={ diff --git a/umtool/components/projects/StructureEditors.tsx b/umtool/components/projects/StructureEditors.tsx @@ -193,7 +193,7 @@ function PostsEditor({ <div data-testid="posts-editor" className="space-y-1"> <div className="flex items-center gap-2"> <span className="micro">posts — {posts.length}</span> - <button type="button" data-testid="post-add" onClick={() => setAdding((a) => !a)} className="text-[11px] text-[var(--color-sel)] hover:underline"> + <button type="button" data-testid="post-add" onClick={() => setAdding((a) => !a)} className="ink-link text-[11px]"> + post </button> </div> diff --git a/umtool/components/projects/TakesPage.tsx b/umtool/components/projects/TakesPage.tsx @@ -24,7 +24,7 @@ export default async function TakesPage({ project }: { project: ProjectRef }) { rail="collapsed" crumbs={[ { href: browseHref(), label: "projects" }, - { href: projectHref(project.id), label: project.id }, + { href: projectHref(project.id, { tab: "cut" }), label: project.id }, { label: "takes" }, ]} note={takes.length ? `${takes.length} takes · ${judged} judged` : undefined} @@ -33,7 +33,7 @@ export default async function TakesPage({ project }: { project: ProjectRef }) { {takes.length === 0 ? ( <p data-takes-empty="" className="text-[12px] text-[var(--color-dim)]"> No takes yet.{" "} - <Link href={`/projects/${project.id}`} className="ink-link"> + <Link href={projectHref(project.id, { tab: "cut" })} className="ink-link"> back to {project.id} </Link> </p> diff --git a/umtool/components/projects/report/BuildTab.tsx b/umtool/components/projects/report/BuildTab.tsx @@ -1,5 +1,6 @@ import Link from "next/link"; import { fmtAgo, fmtBytes } from "@/lib/format"; +import { mixHref } from "@/lib/hrefs"; import OnscreenSection from "../OnscreenSection"; import ReportBuildChain from "../ReportBuildChain"; import type { ReportTabProps } from "./shared"; @@ -13,16 +14,17 @@ export default function BuildTab({ project, detail }: ReportTabProps) { return ( <> {build.built && ( - <div className="text-right text-[11px] text-[var(--color-dim)]"> - <div className="font-mono text-[var(--color-text)]">{build.slug}.mp4</div> - <div className="num"> + <div className="flex flex-wrap items-baseline gap-x-3 gap-y-1 text-[12px] text-[var(--color-dim)]" data-final-video=""> + <span className="micro">final video</span> + <span className="font-mono text-[var(--color-text)]">{build.slug}.mp4</span> + <span className="num"> {fmtBytes(build.finalSize)} · {fmtAgo(build.finalMtimeMs)} - </div> + </span> {/* No window: the whole thing is the point of a deliverable link. */} <Link - href={`/mix?body=${encodeURIComponent(build.finalPath)}&from=${encodeURIComponent(project.id)}`} + href={mixHref({ body: build.finalPath, from: project.id })} data-mix-deliverable="" - className="text-[var(--color-sel)] hover:underline" + className="ink-link" > open in mix </Link> diff --git a/umtool/components/projects/report/CutTab.tsx b/umtool/components/projects/report/CutTab.tsx @@ -8,6 +8,7 @@ import { } from "@/lib/projects/report.mjs"; import { listTakes } from "@/lib/report/takes.mjs"; import { buttonVariants } from "@/components/ui/button"; +import { clipBenchHref, mixHref as toolsMixHref, projectHref, takesHref } from "@/lib/hrefs"; import FetchUnfetchedButton from "../FetchUnfetchedButton"; import { RowControls, RowNotes, TimelineList } from "../TimelineEditor"; import { Pill, TONE, hms, type ReportTabProps } from "./shared"; @@ -74,7 +75,7 @@ export default async function CutTab({ project, detail, search }: ReportTabProps } q.set("from", project.id); q.set("clip", e.id); - return `/mix?${q}`; + return `${toolsMixHref()}?${q}`; }; return ( @@ -94,9 +95,9 @@ export default async function CutTab({ project, detail, search }: ReportTabProps first clip is already judged (or not fetched) would otherwise open on a clip `n` immediately leaves. */} <Link - href={`/browse/${project.id}/clip/${walkStart}`} + href={clipBenchHref(project.id, walkStart)} data-walk-start={walkStart} - className={buttonVariants({ variant: "primary", size: "lg" })} + className={buttonVariants({ variant: "go", size: "lg" })} > Walk the cut → start at {walkStart} </Link> @@ -114,7 +115,7 @@ export default async function CutTab({ project, detail, search }: ReportTabProps on their own page. Only when there is a takes/ to look at. */} {takes.exists && ( <Link - href={`/browse/${project.id}/takes`} + href={takesHref(project.id)} data-takes-link={takes.takes.length} className={buttonVariants({ size: "lg" })} > @@ -188,7 +189,7 @@ export default async function CutTab({ project, detail, search }: ReportTabProps > <div className="flex flex-wrap items-baseline gap-2 text-[12px]"> <RowControls id={e.id} at={at} /> - <span className="font-mono text-[var(--color-sel)]">{e.id}</span> + <span className="font-mono text-[var(--color-text)]">{e.id}</span> <span className="num font-mono text-[11px] text-[var(--color-dim)]"> {e.video} {hms(e.start)}–{hms(e.end)} ({(e.end - e.start).toFixed(1)}s) </span> @@ -222,7 +223,7 @@ export default async function CutTab({ project, detail, search }: ReportTabProps <Link href={mixHref(e)!} data-mix-link={e.id} - className="text-[11px] text-[var(--color-sel)] hover:underline" + className="ink-link text-[11px]" > mix </Link> @@ -234,9 +235,9 @@ export default async function CutTab({ project, detail, search }: ReportTabProps </span> )} <Link - href={`/browse/${project.id}/clip/${e.id}`} + href={clipBenchHref(project.id, e.id)} data-bench-link={e.id} - className="text-[11px] text-[var(--color-sel)] hover:underline" + className="ink-link text-[11px]" > bench → </Link> @@ -267,8 +268,8 @@ export default async function CutTab({ project, detail, search }: ReportTabProps </TimelineList> <div className="mt-2"> <Link - href={`/browse/${project.id}${showAll ? "" : "?all=1"}`} - className="text-[11px] text-[var(--color-sel)] hover:underline" + href={projectHref(project.id, { tab: "cut", all: !showAll })} + className="ink-link text-[11px]" > {showAll ? "hide quotes" : "show every quote"} </Link> @@ -308,8 +309,8 @@ export default async function CutTab({ project, detail, search }: ReportTabProps nobody complained about. */} {c.verdict !== "incorrect" && <Pill>note · confirmed</Pill>}{" "} <Link - href={`/browse/${project.id}/clip/${c.id}`} - className="font-mono text-[11px] text-[var(--color-sel)] hover:underline" + href={clipBenchHref(project.id, c.id)} + className="ink-link font-mono text-[11px]" > {c.id} </Link>{" "} @@ -320,7 +321,7 @@ export default async function CutTab({ project, detail, search }: ReportTabProps href={c.href} target="_blank" rel="noreferrer" - className="text-[11px] text-[var(--color-sel)] hover:underline" + className="ink-link text-[11px]" > the moment </a> diff --git a/umtool/components/projects/report/HistoryTab.tsx b/umtool/components/projects/report/HistoryTab.tsx @@ -101,7 +101,7 @@ export default async function HistoryTab({ project, detail }: ReportTabProps) { <dt className="micro">{k}</dt> <dd className="num break-all text-[var(--color-dim)]"> {typeof v === "string" && /^https?:\/\//.test(v) ? ( - <a href={v} target="_blank" rel="noreferrer" className="text-[var(--color-sel)] hover:underline"> + <a href={v} target="_blank" rel="noreferrer" className="ink-link"> {v} </a> ) : ( @@ -131,7 +131,7 @@ export default async function HistoryTab({ project, detail }: ReportTabProps) { ))} {noteFiles.map((n, i) => ( <details key={n} data-note-file={n}> - <summary className="cursor-pointer font-mono text-[12px] text-[var(--color-sel)]">{n}</summary> + <summary className="cursor-pointer font-mono text-[12px] text-[var(--color-text-2)] hover:text-[var(--color-text)]">{n}</summary> <div className="mt-1 max-h-[50vh] overflow-y-auto"> <Markdown text={noteTexts[i]} /> </div> diff --git a/umtool/components/projects/report/MediaTab.tsx b/umtool/components/projects/report/MediaTab.tsx @@ -4,6 +4,7 @@ import { draftedFields, isCodeDraft } from "yt-dlp-transcript-common/lib/report/ import { readAlternatives } from "@/lib/report/drafts.mjs"; import { draftRowsOf, draftRuns, projectIteration } from "@/lib/articles/projectDraft"; import { buttonVariants } from "@/components/ui/button"; +import { narrationHref, reviewHref } from "@/lib/hrefs"; import DraftPanel from "../DraftPanel"; import YoutubeSection from "../YoutubeSection"; import type { ReportTabProps } from "./shared"; @@ -33,7 +34,7 @@ export default async function MediaTab({ project, detail }: ReportTabProps) { some card carries one. */} {narrated > 0 && ( <Link - href={`/browse/${project.id}/narration`} + href={narrationHref(project.id)} data-narration-link={narrated} className={buttonVariants({ size: "lg" })} > @@ -44,7 +45,7 @@ export default async function MediaTab({ project, detail }: ReportTabProps) { draft task wrote one, or kept an alternative. */} {(draftedCount > 0 || alternativesCount > 0) && ( <Link - href={`/browse/${project.id}/review`} + href={reviewHref(project.id)} data-review-link={draftedCount} className={buttonVariants({ size: "lg" })} > diff --git a/umtool/components/projects/report/SourcesTab.tsx b/umtool/components/projects/report/SourcesTab.tsx @@ -1,6 +1,7 @@ import Link from "next/link"; import CheckSourcesButton from "@/components/dashboard/CheckSourcesButton"; import { sourcesOf } from "@/lib/projects/report.mjs"; +import { clipBenchHref } from "@/lib/hrefs"; import TagCitedButton from "../TagCitedButton"; import { Pill, type ReportTabProps } from "./shared"; @@ -73,7 +74,7 @@ export default async function SourcesTab({ project, detail }: ReportTabProps) { className="border-t border-[var(--color-line)] align-top" > <td className="px-1.5 py-1"> - <a href={r.cite.override ?? r.cite.derived} target="_blank" rel="noreferrer" className="font-mono text-[var(--color-sel)] hover:underline"> + <a href={r.cite.override ?? r.cite.derived} target="_blank" rel="noreferrer" className="ink-link font-mono"> {r.key} </a> {r.title && <div className="truncate text-[var(--color-dim)]" style={{ maxWidth: "24rem" }}>{r.title}</div>} @@ -82,7 +83,7 @@ export default async function SourcesTab({ project, detail }: ReportTabProps) { {r.clips.map((c, i) => ( <span key={c}> {i > 0 && " "} - <Link href={`/browse/${project.id}/clip/${c}`} className="text-[var(--color-sel)] hover:underline"> + <Link href={clipBenchHref(project.id, c)} className="ink-link"> {c} </Link> </span> @@ -121,7 +122,7 @@ export default async function SourcesTab({ project, detail }: ReportTabProps) { {r.cite.differs ? ( <span className="text-[var(--color-dim)]"> <Pill>citeUrl</Pill>{" "} - <a href={r.cite.override!} target="_blank" rel="noreferrer" className="font-mono text-[var(--color-sel)] hover:underline"> + <a href={r.cite.override!} target="_blank" rel="noreferrer" className="ink-link font-mono"> override </a> </span> diff --git a/umtool/lib/projects/report.mjs b/umtool/lib/projects/report.mjs @@ -781,6 +781,22 @@ export const REPORT_DECISION_KINDS = [ "storage-mismatch", ]; +/** + * The piece page's tab a project-wide decision is settled on, or null for the + * Overview. Plain names, not imported from lib/pieces/tabs.mjs: this file is + * the CLI's too, and the tab ids are part of the page's URL contract. + * + * @param {string} kind + * @param {string} target + */ +export function decisionTab(kind, target) { + if (kind === "stale-build" || kind === "unbuilt") return "build"; + if (kind === "storage-unreachable" || kind === "storage-mismatch") return target === "out" ? "build" : "deliver"; + if (kind === "manifest-invalid" && target === "storage.deliverables") return "deliver"; + if (kind === "no-punctuation") return "sources"; + return null; +} + export async function reportDecisions(ctx, summary) { const { id, dir } = ctx; const s = summary ?? (await summariseReport(ctx)); @@ -791,8 +807,14 @@ export async function reportDecisions(ctx, summary) { const out = []; if (!m) return out; - const add = (kind, target, why, severity, extra = {}) => - out.push({ kind, project: id, target, why, href, severity, at, ...extra }); + // A decision about the project as a whole links the piece page's tab that + // settles it (lib/pieces/tabs.mjs): a build on Build, the deliverables' + // storage on Deliver, an unpunctuated source on Sources; the rest the + // Overview. A clip's or a claim's links its bench. + const add = (kind, target, why, severity, extra = {}) => { + const tab = decisionTab(kind, target); + out.push({ kind, project: id, target, why, href: tab ? `${href}?tab=${tab}` : href, severity, at, ...extra }); + }; const shadowExists = await hasShadowChannels(dir); const channelsDir = channelsDirFor(dir, m, { shadowExists });