Archilyzer · Source

archilyzer

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

commit 77908a76494be2086a96dc3ab02f19ef47a3e998
parent d87ea613d3ce012e57f4602df7c62aad41496ee7
Author: I Mean I'm Just Saying <imeanimjustsaying@kiwifarms.st>
Date:   Wed, 14 Oct 2026 00:50:44 -0400

umtool: article views as link tabs, evidence quotes and posts on the reader, links in ink; e2e/shell.spec.ts

The article's views (article · source · evidence · iterations) are the
Tabs primitive. The evidence panel's quote, post and cue list sit on the
reader surface. Links that wore Signal as their colour are ink with a
quiet underline (.ink-link): Signal is the lit line and the one primary
action, never a link colour. The dashboard's panels are the Panel
primitive. The dev indicator moves to the bottom-right, off the rail's
foot.

shell.spec covers the rail on every top-level page with the right place
lit, the song group, a bench without the rail, the theme cookie both
ways (served stamped after a reload), j/k on a lit list with focus
following, and the head's glide under reduced motion.

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

Diffstat:
Mumtool/app/articles/[report]/compare/page.tsx | 2+-
Mumtool/app/browse/[...path]/page.tsx | 2+-
Mumtool/app/browse/find/page.tsx | 2+-
Mumtool/app/browse/sources/page.tsx | 2+-
Mumtool/app/globals.css | 14++++++++++++++
Mumtool/app/sites/[site]/page.tsx | 2+-
Mumtool/components/FaceDeck.tsx | 4++--
Mumtool/components/MomentMarks.tsx | 2+-
Mumtool/components/PhraseConsole.tsx | 2+-
Mumtool/components/PlanDiffPanel.tsx | 2+-
Mumtool/components/ProvenancePanel.tsx | 8++++----
Mumtool/components/ShortlistBar.tsx | 4++--
Mumtool/components/SpecSheet.tsx | 2+-
Mumtool/components/ThumbBench.tsx | 4++--
Mumtool/components/articles/ArticleBody.tsx | 2+-
Mumtool/components/articles/ArticlePage.tsx | 44++++++++++++++++++++------------------------
Mumtool/components/articles/ArticleTable.tsx | 2+-
Mumtool/components/articles/EvidencePanel.tsx | 24+++++++++++++-----------
Mumtool/components/dashboard/DecisionsPanel.tsx | 2+-
Mumtool/components/dashboard/DeliverablesPanel.tsx | 2+-
Mumtool/components/dashboard/NowLive.tsx | 2+-
Mumtool/components/dashboard/Panel.tsx | 23++++++++++++-----------
Mumtool/components/dashboard/SourcesPanel.tsx | 2+-
Mumtool/components/notes/AnchoredNotes.tsx | 2+-
Mumtool/components/notes/NoteThread.tsx | 4++--
Mumtool/components/notes/TimedNotes.tsx | 4++--
Mumtool/components/projects/ClaimBench.tsx | 4++--
Mumtool/components/projects/ClipBench.tsx | 6+++---
Mumtool/components/projects/CutPage.tsx | 2+-
Mumtool/components/projects/DeliverSection.tsx | 4++--
Mumtool/components/projects/PodcastExport.tsx | 6+++---
Mumtool/components/projects/SweepProject.tsx | 2+-
Mumtool/components/projects/TakesPage.tsx | 2+-
Aumtool/e2e/shell.spec.ts | 129+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Mumtool/next.config.ts | 3+++
35 files changed, 234 insertions(+), 89 deletions(-)

diff --git a/umtool/app/articles/[report]/compare/page.tsx b/umtool/app/articles/[report]/compare/page.tsx @@ -161,7 +161,7 @@ export default async function ComparePage({ <main className="deck-main flex-1 p-4"> <p role="alert" className="text-[12px] text-[var(--color-bad)]"> {!a || !b ? "name two iterations: ?a=<n>&b=<n>" : `no iteration ${!left ? `i${a}` : `i${b}`}`} —{" "} - <Link href={`/articles/${report}?tab=iterations`} className="text-[var(--color-sel)] hover:underline"> + <Link href={`/articles/${report}?tab=iterations`} className="ink-link"> the iterations </Link> </p> diff --git a/umtool/app/browse/[...path]/page.tsx b/umtool/app/browse/[...path]/page.tsx @@ -57,7 +57,7 @@ export default async function BrowsePathPage({ <li key={p.id}> <Link href={`/browse/${p.id}${segments.slice(1).map((s) => `/${s}`).join("")}`} - className="font-mono text-[12px] text-[var(--color-sel)] hover:underline" + className="font-mono text-[12px] ink-link" > /browse/{p.id} </Link> diff --git a/umtool/app/browse/find/page.tsx b/umtool/app/browse/find/page.tsx @@ -142,7 +142,7 @@ export default async function FindPage({ searchParams }: { searchParams: Promise as broken. */} {filler && ( <p className="text-[12px]"> - <Link href="/sort" className="text-[var(--color-sel)] hover:underline"> + <Link href="/sort" className="ink-link"> The fillers are in /sort </Link> <span className="text-[var(--color-dim)]"> diff --git a/umtool/app/browse/sources/page.tsx b/umtool/app/browse/sources/page.tsx @@ -78,7 +78,7 @@ export default async function SourcesPage() { href={v.link} target="_blank" rel="noreferrer" - className="text-[var(--color-sel)] underline" + className="ink-link" > {v.title || v.video} </a> diff --git a/umtool/app/globals.css b/umtool/app/globals.css @@ -485,6 +485,20 @@ canvas.grabbable { background: var(--signal); } + /* A link in running text or a row: ink, with a quiet underline that wakes on + hover. Signal is not a link colour -- it is kept for the lit line and the + one primary action (canvas critique, "Signal only on the lit line"). */ + .ink-link { + color: var(--text-2); + text-decoration: underline; + text-decoration-color: var(--seam-2); + text-underline-offset: 3px; + } + .ink-link:hover { + color: var(--text); + text-decoration-color: currentColor; + } + /* ── the lit line (components/ui/lit-list.tsx; canvas .lines/.ln/.head) ── */ .lit-list { position: relative; diff --git a/umtool/app/sites/[site]/page.tsx b/umtool/app/sites/[site]/page.tsx @@ -97,7 +97,7 @@ export default async function SitePage({ <ul className="space-y-1"> {linked.map((p) => ( <li key={p.id} data-video-project={p.id} className="flex flex-wrap items-baseline gap-2 rounded border border-[var(--color-line)] bg-[var(--color-panel)] px-3 py-1.5 text-[12px]"> - <Link href={`/browse/${p.id}`} className="font-mono text-[var(--color-sel)] hover:underline"> + <Link href={`/browse/${p.id}`} className="font-mono ink-link"> {p.id} </Link> <span className="text-[var(--color-dim)]">{p.articles.map((a) => a.title).join(", ")}</span> diff --git a/umtool/components/FaceDeck.tsx b/umtool/components/FaceDeck.tsx @@ -597,7 +597,7 @@ export default function FaceDeck({ href={entry.link} target="_blank" rel="noreferrer" - className="text-[11px] text-[var(--color-sel)] underline" + className="text-[11px] ink-link" > the moment </a> @@ -704,7 +704,7 @@ export default function FaceDeck({ setGuess(null); }} data-take-guess - className="text-[var(--color-sel)] underline" + className="ink-link" > take it </button>{" "} diff --git a/umtool/components/MomentMarks.tsx b/umtool/components/MomentMarks.tsx @@ -145,7 +145,7 @@ export default function MomentMarks({ <button type="button" onClick={() => onSeek(m.t)} - className="num text-[11px] text-[var(--color-sel)] underline" + className="num text-[11px] ink-link" title="seek here" > {ts(m.t)} diff --git a/umtool/components/PhraseConsole.tsx b/umtool/components/PhraseConsole.tsx @@ -386,7 +386,7 @@ export default function PhraseConsole({ href={h.archive} target="_blank" rel="noreferrer" - className="font-mono text-[11px] text-[var(--color-sel)] hover:underline" + className="font-mono text-[11px] ink-link" > in the archive </a> diff --git a/umtool/components/PlanDiffPanel.tsx b/umtool/components/PlanDiffPanel.tsx @@ -241,7 +241,7 @@ function Side({ row }: { row: PlanDelta["a"] }) { href={row.link} target="_blank" rel="noreferrer" - className="font-mono text-[var(--color-sel)] underline" + className="font-mono ink-link" title={row.title} > {row.clipId} diff --git a/umtool/components/ProvenancePanel.tsx b/umtool/components/ProvenancePanel.tsx @@ -144,7 +144,7 @@ export default function ProvenancePanel({ {prov.videos.length > 0 && ( <p className="num mt-1 text-[11px] text-[var(--color-dim)]" data-concentration> {concentrationLine(shares(prov.videos.map((v) => v.clips)))} ·{" "} - <Link href="/browse/sources" className="text-[var(--color-sel)] underline"> + <Link href="/browse/sources" className="ink-link"> across every song </Link> </p> @@ -221,7 +221,7 @@ export default function ProvenancePanel({ href={v.link} target="_blank" rel="noreferrer" - className="num text-[var(--color-sel)] underline" + className="num ink-link" > {fmtDur(v.firstSrcStart)} </a> @@ -252,7 +252,7 @@ export default function ProvenancePanel({ showing the first {shown.length} by song time — {hidden} not shown.{" "} <Link href={`${href(planParam)}${planParam ? "&" : "?"}notes=all`} - className="text-[var(--color-sel)] underline" + className="ink-link" > show all {prov.rows.length} </Link> @@ -295,7 +295,7 @@ export default function ProvenancePanel({ href={r.link} target="_blank" rel="noreferrer" - className="text-[var(--color-sel)] underline" + className="ink-link" title={r.title} > archive diff --git a/umtool/components/ShortlistBar.tsx b/umtool/components/ShortlistBar.tsx @@ -153,13 +153,13 @@ export default function ShortlistBar({ <span className="ml-auto flex items-center gap-2"> <a href={`/api/shortlist?list=${encodeURIComponent(list.slug)}&format=json`} - className="font-mono text-[11px] text-[var(--color-sel)] hover:underline" + className="font-mono text-[11px] ink-link" > export json </a> <a href={`/api/shortlist?list=${encodeURIComponent(list.slug)}&format=md`} - className="font-mono text-[11px] text-[var(--color-sel)] hover:underline" + className="font-mono text-[11px] ink-link" > markdown </a> diff --git a/umtool/components/SpecSheet.tsx b/umtool/components/SpecSheet.tsx @@ -109,7 +109,7 @@ export default function SpecSheet({ className="flex flex-wrap items-baseline gap-2 text-[12px]" > {o.href && !o.blocked ? ( - <Link href={o.href} className="text-[var(--color-sel)] underline"> + <Link href={o.href} className="ink-link"> {o.label} </Link> ) : ( diff --git a/umtool/components/ThumbBench.tsx b/umtool/components/ThumbBench.tsx @@ -135,7 +135,7 @@ export default function ThumbBench({ href={v.link} target="_blank" rel="noreferrer" - className="text-[var(--color-sel)] underline" + className="ink-link" > {v.video} </a> @@ -155,7 +155,7 @@ export default function ThumbBench({ <Link href={`/browse/faces?cover=${encodeURIComponent(c.name)}`} data-judge-faces={c.name} - className="text-[11px] text-[var(--color-sel)] hover:underline" + className="text-[11px] ink-link" > judge {c.corners.length === 1 ? "this face" : `these ${c.corners.length} faces`} → </Link> diff --git a/umtool/components/articles/ArticleBody.tsx b/umtool/components/articles/ArticleBody.tsx @@ -33,7 +33,7 @@ function CiteLink({ href, children }: AnchorHTMLAttributes<HTMLAnchorElement>) { const id = href?.startsWith(CITE_SCHEME) ? href.slice(CITE_SCHEME.length).trim() : null; if (id === null) { return ( - <a href={href} target="_blank" rel="noopener noreferrer" className="text-[var(--color-sel)] underline decoration-[var(--color-sel)]/40"> + <a href={href} target="_blank" rel="noopener noreferrer" className="ink-link"> {children} </a> ); diff --git a/umtool/components/articles/ArticlePage.tsx b/umtool/components/articles/ArticlePage.tsx @@ -10,6 +10,7 @@ import ArticleReader from "@/components/articles/ArticleReader"; import WorkspacePanel from "@/components/articles/WorkspacePanel"; import IterationsView from "@/components/articles/IterationsView"; import { badgeVariants } from "@/components/ui/badge"; +import { Tabs } from "@/components/ui/tabs"; import { articleView } from "@/lib/articles/article"; import { articleHref } from "@/lib/articles/href"; import { articleWorkspaceListing, openWorkspaceFile } from "@/lib/articles/files"; @@ -84,7 +85,7 @@ export default async function ArticlePage({ {r?.updated && <span>updated {r.updated}</span>} {head && <span data-revisions={head.revision}>{head.revision} revision{head.revision === 1 ? "" : "s"}</span>} {links.linked.map((p: { id: string }) => ( - <Link key={p.id} href={`/browse/${p.id}`} data-project-link={p.id} className="font-mono text-[var(--color-sel)] hover:underline"> + <Link key={p.id} href={`/browse/${p.id}`} data-project-link={p.id} className="font-mono ink-link"> {p.id} </Link> ))} @@ -93,27 +94,22 @@ export default async function ArticlePage({ {p.id} (possible) </Link> ))} - <nav className="ml-auto flex gap-2" aria-label="article views"> - <Link href={base} aria-current={tab === "article" ? "page" : undefined} className={tab === "article" ? "text-[var(--color-sel)]" : "hover:text-[var(--color-text)]"}> - article - </Link> - <Link href={`${base}?tab=source`} aria-current={tab === "source" ? "page" : undefined} className={tab === "source" ? "text-[var(--color-sel)]" : "hover:text-[var(--color-text)]"}> - source - </Link> - <Link href={`${base}/evidence`} className="hover:text-[var(--color-text)]"> - evidence - </Link> - {store && ( - <Link - href={`${base}?tab=iterations`} - aria-current={tab === "iterations" ? "page" : undefined} - className={tab === "iterations" ? "text-[var(--color-sel)]" : "hover:text-[var(--color-text)]"} - > - iterations - </Link> - )} - </nav> - {store && <DeleteArticle article={reportId} published={published} />} + {/* The article's views as link tabs: each an address, the current one lit. */} + <Tabs + label="article views" + className="order-last w-full" + items={[ + { href: base, label: "article", current: tab === "article" }, + { href: `${base}?tab=source`, label: "source", current: tab === "source" }, + { href: `${base}/evidence`, label: "evidence" }, + ...(store ? [{ href: `${base}?tab=iterations`, label: "iterations", current: tab === "iterations" }] : []), + ]} + /> + {store && ( + <span className="ml-auto"> + <DeleteArticle article={reportId} published={published} /> + </span> + )} {source && ( <div className="w-full font-mono text-[11px]" title={source.how}> {source.draft && <span>draft {source.draft}</span>} @@ -183,7 +179,7 @@ export default async function ArticlePage({ <div className="space-y-4"> {meta} {hasSlides(slideView) && ( - <section data-slide-lint={lint.length + slideProblems.length} className="rounded border border-[var(--color-line)] bg-[var(--color-panel)] px-3 py-2 text-[12px]"> + <section data-slide-lint={lint.length + slideProblems.length} className="rounded-[3px] border border-seam bg-panel px-4 py-3 text-[12px]"> <div className="micro">slides</div> {lint.length + slideProblems.length === 0 ? ( <p className="mt-1 text-[var(--color-dim)]">nothing to fix</p> @@ -196,7 +192,7 @@ export default async function ArticlePage({ ))} {lint.map((l, i) => ( <li key={`l${i}`} data-lint={l.key}> - <Link href={`${base}?rv=slides#${l.anchorId}`} className="font-mono text-[11px] text-[var(--color-sel)] hover:underline"> + <Link href={`${base}?rv=slides#${l.anchorId}`} className="font-mono text-[11px] ink-link"> {l.key} </Link>{" "} <span className="text-[var(--color-text)]">{l.message}</span> diff --git a/umtool/components/articles/ArticleTable.tsx b/umtool/components/articles/ArticleTable.tsx @@ -85,7 +85,7 @@ export default function ArticleTable({ articles }: { articles: ArticleRow[] }) { </td> <td className="py-1.5 pl-3 pr-3"> {a.projects.linked.map((p) => ( - <Link key={p.id} href={`/browse/${p.id}`} data-project-link={p.id} className="block font-mono text-[11px] text-[var(--color-sel)] hover:underline"> + <Link key={p.id} href={`/browse/${p.id}`} data-project-link={p.id} className="block font-mono text-[11px] ink-link"> {p.id} </Link> ))} diff --git a/umtool/components/articles/EvidencePanel.tsx b/umtool/components/articles/EvidencePanel.tsx @@ -71,8 +71,10 @@ const EvidencePanel = forwardRef< return ( <div data-evidence={ev.cite} className="space-y-2 text-[12px]"> - <blockquote className="border-l-2 border-[var(--color-sel)] pl-2 text-[13px] text-[var(--color-text)]"> - {number !== undefined && <span className="mr-1 font-mono text-[11px] text-[var(--color-sel)]">[{number}]</span>}“{ev.quote}” + {/* The source's words on the READER (app/globals.css); our notes about + them stay on the desk around it. */} + <blockquote className="reader m-0 rounded-[2px] px-3.5 py-2.5 font-serif text-[16px] leading-snug"> + {number !== undefined && <span className="mr-1.5 font-mono text-[11px] text-reader-signal">[{number}]</span>}“{ev.quote}” </blockquote> <div className="text-[var(--color-dim)]"> {[ev.speaker ?? ev.record?.channelTitle, ev.date, ev.label].filter(Boolean).join(" · ")} @@ -84,7 +86,7 @@ const EvidencePanel = forwardRef< </div> {ev.record?.title && <div className="text-[var(--color-dim)]">{ev.record.title}</div>} {ev.originalUrl && ( - <a href={ev.originalUrl} target="_blank" rel="noopener noreferrer" className="text-[var(--color-sel)] hover:underline"> + <a href={ev.originalUrl} target="_blank" rel="noopener noreferrer" className="ink-link"> original ↗ </a> )} @@ -129,28 +131,28 @@ const EvidencePanel = forwardRef< ) : null} {ev.post && ( - <div data-post className="space-y-1 rounded border border-[var(--color-line)] p-2"> - {ev.post.author && <div className="text-[var(--color-dim)]">{ev.post.author}</div>} - {ev.post.text && <p className="whitespace-pre-wrap text-[var(--color-text)]">{ev.post.text}</p>} + <div data-post className="reader space-y-1 rounded-[2px] px-3.5 py-2.5"> + {ev.post.author && <div className="text-[12px] text-reader-dim">{ev.post.author}</div>} + {ev.post.text && <p className="whitespace-pre-wrap font-serif text-[15px] leading-snug">{ev.post.text}</p>} {ev.post.shot && ( // eslint-disable-next-line @next/next/no-img-element - <img src={ev.post.shot} alt="capture of the post" className="w-full rounded border border-[var(--color-line)]" /> + <img src={ev.post.shot} alt="capture of the post" className="w-full rounded-[2px] border border-reader-seam" /> )} </div> )} {ev.cues.length > 0 ? ( - <ol data-cues className="space-y-0.5"> + <ol data-cues className="reader space-y-0.5 rounded-[2px] py-1.5"> {ev.cues.map((c) => ( <li key={c.start} data-cited={c.cited ? "true" : undefined}> <button type="button" onClick={() => seek(c.start)} disabled={!play} - className={`flex w-full gap-2 rounded px-1 text-left ${c.cited ? "bg-[var(--color-panel-2)] text-[var(--color-text)]" : "text-[var(--color-dim)]"} enabled:hover:text-[var(--color-text)]`} + className={`flex w-full items-baseline gap-3 border-l-[3px] px-2.5 py-px text-left ${c.cited ? "border-reader-signal bg-[color-mix(in_srgb,var(--reader-signal)_9%,transparent)] text-reader-ink" : "border-transparent text-reader-2"} enabled:hover:text-reader-ink`} > - <span className="num shrink-0 font-mono text-[10px] leading-5">{fmt(c.start)}</span> - <span>{c.text}</span> + <span className={`num shrink-0 font-mono text-[10.5px] ${c.cited ? "font-semibold text-reader-signal" : "text-reader-dim"}`}>{fmt(c.start)}</span> + <span className="font-serif text-[15px] leading-snug">{c.text}</span> </button> </li> ))} diff --git a/umtool/components/dashboard/DecisionsPanel.tsx b/umtool/components/dashboard/DecisionsPanel.tsx @@ -36,7 +36,7 @@ export default function DecisionsPanel({ decisions }: { decisions: Decision[] }) className="flex flex-wrap items-baseline gap-1.5 text-[11px]" > <span className={badgeVariants({ variant: TONE[d.severity], size: "sm" })}>{d.severity}</span> - <Link href={d.href} className="font-mono text-[var(--color-sel)] hover:underline"> + <Link href={d.href} className="font-mono ink-link"> {d.project} </Link> <span className="truncate text-[var(--color-dim)]"> diff --git a/umtool/components/dashboard/DeliverablesPanel.tsx b/umtool/components/dashboard/DeliverablesPanel.tsx @@ -22,7 +22,7 @@ export default function DeliverablesPanel({ projects }: { projects: ProjectSumma {newest && ( <span> newest{" "} - <Link href={`/browse/${newest.id}`} className="font-mono text-[var(--color-sel)] hover:underline"> + <Link href={`/browse/${newest.id}`} className="font-mono ink-link"> {newest.id} </Link>{" "} <span className="num">{fmtAgo(newest.newestMtimeMs)}</span> diff --git a/umtool/components/dashboard/NowLive.tsx b/umtool/components/dashboard/NowLive.tsx @@ -68,7 +68,7 @@ export default function NowLive({ initial }: { initial: ActivityItem | null }) { return ( <div data-now={now.state} data-now-id={now.id} className="space-y-1.5"> <div className="flex flex-wrap items-baseline gap-2 text-[12px]"> - <Link href={now.href} className="font-mono text-[var(--color-sel)] hover:underline"> + <Link href={now.href} className="font-mono ink-link"> {now.label} </Link> <span className="micro">{now.source}</span> diff --git a/umtool/components/dashboard/Panel.tsx b/umtool/components/dashboard/Panel.tsx @@ -1,6 +1,7 @@ import Link from "next/link"; +import { Panel as UiPanel } from "@/components/ui/panel"; -/** The dashboard's one box shape: a micro title, an optional "all →", a body. */ +/** The dashboard's one box shape: a micro title, an optional "all →", a body (components/ui/panel.tsx). */ export default function Panel({ title, testid, @@ -15,19 +16,19 @@ export default function Panel({ className?: string; }) { return ( - <section + <UiPanel data-panel={testid} - className={`rounded border border-[var(--color-line)] bg-[var(--color-panel)] px-3 py-2 ${className}`} - > - <div className="mb-1.5 flex items-baseline"> - <h2 className="micro">{title}</h2> - {more && ( - <Link href={more.href} className="ml-auto text-[11px] text-[var(--color-sel)] hover:underline"> + title={title} + aside={ + more && ( + <Link href={more.href} className="ink-link text-[12px]"> {more.label} </Link> - )} - </div> + ) + } + className={className} + > {children} - </section> + </UiPanel> ); } diff --git a/umtool/components/dashboard/SourcesPanel.tsx b/umtool/components/dashboard/SourcesPanel.tsx @@ -20,7 +20,7 @@ export default function SourcesPanel({ <ul className="space-y-0.5" data-sources-list={attr}> {items.map((p) => ( <li key={p.id} data-source-project={p.id} className="flex flex-wrap gap-2 text-[11px]"> - <Link href={`/browse/${p.id}`} className="font-mono text-[var(--color-sel)] hover:underline"> + <Link href={`/browse/${p.id}`} className="font-mono ink-link"> {p.id} </Link> <span className="text-[var(--color-dim)]"> 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" }) : "text-[var(--color-sel)] hover:underline"} + className={openCount ? badgeVariants({ variant: "open", 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/notes/NoteThread.tsx b/umtool/components/notes/NoteThread.tsx @@ -45,11 +45,11 @@ export function NoteThread({ </button> </> ) : ( - <button type="button" data-note-action="reopen" disabled={busy} onClick={() => void write({ op: "status", id: note.id, status: "open" })} className="text-[var(--color-sel)] hover:underline disabled:opacity-40"> + <button type="button" data-note-action="reopen" disabled={busy} onClick={() => void write({ op: "status", id: note.id, status: "open" })} className="ink-link disabled:opacity-40"> reopen </button> )} - <button type="button" data-note-action="reply" disabled={busy} onClick={() => setReply((r) => (r === null ? "" : null))} className="text-[var(--color-sel)] hover:underline disabled:opacity-40"> + <button type="button" data-note-action="reply" disabled={busy} onClick={() => setReply((r) => (r === null ? "" : null))} className="ink-link disabled:opacity-40"> reply </button> {note.author === "operator" && ( diff --git a/umtool/components/notes/TimedNotes.tsx b/umtool/components/notes/TimedNotes.tsx @@ -170,7 +170,7 @@ export default function TimedNotes({ <button type="button" onClick={() => seek(n.anchor.t)} - className="num text-[11px] text-[var(--color-sel)] underline" + className="num text-[11px] ink-link" title="seek here" > {ts(n.anchor.t)} @@ -183,7 +183,7 @@ export default function TimedNotes({ )} {r?.approx && <span className={badgeVariants({ variant: "info", size: "sm" })}>approx</span>} {r?.url && ( - <a href={r.url} target="_blank" rel="noreferrer" className="text-[11px] text-[var(--color-sel)] hover:underline"> + <a href={r.url} target="_blank" rel="noreferrer" className="text-[11px] ink-link"> source </a> )} diff --git a/umtool/components/projects/ClaimBench.tsx b/umtool/components/projects/ClaimBench.tsx @@ -300,12 +300,12 @@ export default function ClaimBench({ data }: { data: ClaimBenchData }) { </div> <div className="flex-1" /> {data.prev ? ( - <Link className="text-[11px] text-[var(--color-sel)] hover:underline" href={`/browse/${data.project}/claim/${data.prev}`}> + <Link className="text-[11px] ink-link" href={`/browse/${data.project}/claim/${data.prev}`}> ← {data.prev} </Link> ) : null} {data.next ? ( - <Link className="text-[11px] text-[var(--color-sel)] hover:underline" href={`/browse/${data.project}/claim/${data.next}`}> + <Link className="text-[11px] ink-link" href={`/browse/${data.project}/claim/${data.next}`}> {data.next} → </Link> ) : null} diff --git a/umtool/components/projects/ClipBench.tsx b/umtool/components/projects/ClipBench.tsx @@ -1883,7 +1883,7 @@ export default function ClipBench({ data }: { data: ClipBenchData }) { <Link data-clip-nav="prev" href={`/browse/${data.project}/clip/${data.prev}`} - className="text-[var(--color-sel)] hover:underline" + className="ink-link" > ← {data.prev} </Link> @@ -1894,7 +1894,7 @@ export default function ClipBench({ data }: { data: ClipBenchData }) { <Link data-clip-nav="next" href={`/browse/${data.project}/clip/${data.next}`} - className="text-[var(--color-sel)] hover:underline" + className="ink-link" > {data.next} → </Link> @@ -2794,7 +2794,7 @@ export default function ClipBench({ data }: { data: ClipBenchData }) { <li key={sb.id} data-sibling={sb.id} className="leading-snug"> <Link href={`/browse/${data.project}/clip/${sb.id}`} - className="font-mono text-[var(--color-sel)] hover:underline" + className="font-mono ink-link" > {sb.id} </Link>{" "} diff --git a/umtool/components/projects/CutPage.tsx b/umtool/components/projects/CutPage.tsx @@ -87,7 +87,7 @@ export default async function CutPage({ <div className="p-4 text-[12px] text-[var(--color-dim)]"> Nothing here yet — no <code className="font-mono">{cutName}.mp4</code> and no variants named for it.{" "} - <Link href={`/browse/${song.id}`} className="text-[var(--color-sel)] underline"> + <Link href={`/browse/${song.id}`} className="ink-link"> back to {song.id} </Link> </div> diff --git a/umtool/components/projects/DeliverSection.tsx b/umtool/components/projects/DeliverSection.tsx @@ -222,7 +222,7 @@ export default async function DeliverSection({ <Link href={`/browse/${project.id}/clip/${c.id}`} data-need-cut-id={c.id} - className="font-mono text-[var(--color-sel)] hover:underline" + className="font-mono ink-link" > {c.id} </Link> @@ -270,7 +270,7 @@ export default async function DeliverSection({ <div key={c.id} data-incorrect={c.id} className="text-[11px] leading-snug"> <Link href={`/browse/${project.id}/clip/${c.id}`} - className="font-mono text-[var(--color-sel)] hover:underline" + className="font-mono ink-link" > {c.id} </Link>{" "} diff --git a/umtool/components/projects/PodcastExport.tsx b/umtool/components/projects/PodcastExport.tsx @@ -80,17 +80,17 @@ export default function PodcastExport({ {state === "running" || state === "busy" ? "rendering the podcast…" : files.m4a ? "re-render podcast" : "podcast"} </button> {files.m4a && ( - <a href={href("m4a", true)} data-podcast-file="m4a" className="font-mono text-[var(--color-sel)] hover:underline"> + <a href={href("m4a", true)} data-podcast-file="m4a" className="font-mono ink-link"> podcast.m4a </a> )} {files.mp3 && ( - <a href={href("mp3", true)} data-podcast-file="mp3" className="font-mono text-[var(--color-sel)] hover:underline"> + <a href={href("mp3", true)} data-podcast-file="mp3" className="font-mono ink-link"> podcast.mp3 </a> )} {files.notes && ( - <a href={href("notes")} target="_blank" rel="noreferrer" data-podcast-file="notes" className="font-mono text-[var(--color-sel)] hover:underline"> + <a href={href("notes")} target="_blank" rel="noreferrer" data-podcast-file="notes" className="font-mono ink-link"> show-notes.md </a> )} diff --git a/umtool/components/projects/SweepProject.tsx b/umtool/components/projects/SweepProject.tsx @@ -64,7 +64,7 @@ export default async function SweepProject({ project }: { project: ProjectRef }) </p> )} - <Link href="/browse" className="text-[12px] text-[var(--color-sel)] hover:underline"> + <Link href="/browse" className="text-[12px] ink-link"> ← every project </Link> </main> diff --git a/umtool/components/projects/TakesPage.tsx b/umtool/components/projects/TakesPage.tsx @@ -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={`/browse/${project.id}`} className="text-[var(--color-sel)] hover:underline"> + <Link href={`/browse/${project.id}`} className="ink-link"> back to {project.id} </Link> </p> diff --git a/umtool/e2e/shell.spec.ts b/umtool/e2e/shell.spec.ts @@ -0,0 +1,129 @@ +import { test, expect, type Page } from "@playwright/test"; +import * as urls from "./urls"; + +// --------------------------------------------------------------------------- +// The shell (plans/umtool-redesign.md, P1): the rail on every page, the place +// you are in lit, a bench without it, the theme choice surviving a reload in +// both directions, and the lit line's keys and motion. +// --------------------------------------------------------------------------- + +const rail = (page: Page) => page.locator("[data-app-rail]"); +const place = (page: Page, name: string) => + rail(page).getByRole("navigation", { name: "Main" }).getByRole("link", { name, exact: true }); + +// Every top-level page today, and the rail entry it lights. +const PLACES: { url: string; lit: string }[] = [ + { url: urls.homeHref(), lit: "home" }, + { url: urls.browseHref(), lit: "browse" }, + { url: urls.decisionsHref(), lit: "decisions" }, + { url: urls.articlesHref(), lit: "articles" }, + { url: urls.sitesHref(), lit: "articles" }, + { url: urls.mixHref(), lit: "mix" }, + { url: urls.findHref(), lit: "find" }, +]; + +for (const { url, lit } of PLACES) { + test(`${url} has the rail, with ${lit} lit`, async ({ page }) => { + const res = await page.goto(url); + expect(res?.status()).toBe(200); + await expect(rail(page)).toBeVisible(); + await expect(place(page, lit)).toHaveAttribute("aria-current", "page"); + // Exactly one place is lit. + await expect(rail(page).locator("nav[aria-label=Main] > a[aria-current=page]")).toHaveCount(1); + // The page head: one Breadcrumb nav, the page's name its h1. + await expect(page.getByRole("navigation", { name: "Breadcrumb" }).locator("h1")).toHaveCount(1); + }); +} + +test("a song pile lights the song group, and its menu opens in the rail", async ({ page }) => { + await page.goto(urls.pileHref("sort")); + const group = rail(page).locator("[data-nav-group=song]"); + await expect(group.getByRole("button")).toHaveAttribute("aria-current", "page"); + await expect(rail(page).locator("nav[aria-label=Main] > a[aria-current=page]")).toHaveCount(0); + await group.getByRole("button").click(); + await expect(group.getByRole("menuitem", { name: "sort", exact: true })).toHaveAttribute("aria-current", "page"); +}); + +test("a bench collapses the rail; its head still links home", async ({ page }) => { + await page.goto(urls.clipBenchHref("reports/report-fixture", "c01")); + await expect(page.locator("[data-app-header=bench]")).toBeVisible(); + await expect(rail(page)).toHaveCount(0); + await expect(page.locator("[data-app-header=bench]").getByRole("link", { name: "umtool home" })).toHaveAttribute("href", "/"); +}); + +test("the theme choice is a cookie the server stamps on <html>, both ways", async ({ page, context }) => { + const themeCookie = async () => (await context.cookies()).find((c) => c.name === "umtool-theme")?.value ?? null; + const control = (page: Page) => rail(page).getByRole("group", { name: "Theme" }); + + await page.goto(urls.homeHref()); + await expect(page.locator("html")).not.toHaveAttribute("data-theme", /.+/); + await expect(control(page).getByRole("button", { name: "Auto" })).toHaveAttribute("aria-pressed", "true"); + + // Light: stamped at once, and served stamped after a reload. + await control(page).getByRole("button", { name: "Light" }).click(); + await expect(page.locator("html")).toHaveAttribute("data-theme", "light"); + expect(await themeCookie()).toBe("light"); + let html = await (await page.request.get(urls.browseHref())).text(); + expect(html).toMatch(/<html[^>]*data-theme="light"/); + await page.reload(); + await expect(page.locator("html")).toHaveAttribute("data-theme", "light"); + await expect(control(page).getByRole("button", { name: "Light" })).toHaveAttribute("aria-pressed", "true"); + + // Dark wins over a light system too: the explicit choice goes both ways. + await page.emulateMedia({ colorScheme: "light" }); + await control(page).getByRole("button", { name: "Dark" }).click(); + await expect(page.locator("html")).toHaveAttribute("data-theme", "dark"); + expect(await themeCookie()).toBe("dark"); + await page.reload(); + await expect(page.locator("html")).toHaveAttribute("data-theme", "dark"); + const ground = await page.evaluate(() => getComputedStyle(document.documentElement).getPropertyValue("--ground").trim()); + expect(ground).toBe("#0c0a08"); + + // Auto: the cookie goes, the attribute goes, and the system decides again. + await control(page).getByRole("button", { name: "Auto" }).click(); + await expect(page.locator("html")).not.toHaveAttribute("data-theme", /.+/); + expect(await themeCookie()).toBeNull(); + await page.reload(); + await expect(page.locator("html")).not.toHaveAttribute("data-theme", /.+/); + const lightGround = await page.evaluate(() => getComputedStyle(document.documentElement).getPropertyValue("--ground").trim()); + expect(lightGround).toBe("#f1efec"); + html = await (await page.request.get(urls.browseHref())).text(); + expect(html).not.toMatch(/<html[^>]*data-theme=/); +}); + +test("j and k move the lit line, and focus goes with it", async ({ page }) => { + await page.goto(urls.decisionsHref()); + const list = page.locator("[data-lit-list]").first(); + await expect(list).toHaveAttribute("data-hydrated", ""); + const lines = list.locator("[data-lit-line]"); + expect(await lines.count()).toBeGreaterThan(2); + await expect(lines.nth(0)).toHaveAttribute("data-lit", ""); + // From anywhere on the page: the decision list is the page's one list. + await page.locator("body").press("j"); + await expect(lines.nth(1)).toHaveAttribute("data-lit", ""); + await expect(lines.nth(0)).not.toHaveAttribute("data-lit", ""); + await expect(lines.nth(1)).toBeFocused(); + await page.keyboard.press("j"); + await expect(lines.nth(2)).toHaveAttribute("data-lit", ""); + await page.keyboard.press("k"); + await expect(lines.nth(1)).toHaveAttribute("data-lit", ""); + // Exactly one line is lit, and it is the one Tab stop into the list. + await expect(list.locator("[data-lit-line][data-lit]")).toHaveCount(1); + await expect(lines.nth(1)).toHaveAttribute("tabindex", "0"); + await expect(lines.nth(0)).toHaveAttribute("tabindex", "-1"); + // The head sits on the lit line. + const line = await lines.nth(1).boundingBox(); + await expect.poll(async () => Math.round((await list.locator(".lit-head").boundingBox())?.y ?? -1)).toBe(Math.round(line!.y)); +}); + +test("the head glides, and does not under reduced motion", async ({ page }) => { + const duration = () => + page.locator("[data-lit-list] .lit-head").first().evaluate((el) => getComputedStyle(el).transitionDuration); + await page.goto(urls.decisionsHref()); + await expect(page.locator("[data-lit-list] .lit-head[data-placed]").first()).toBeAttached(); + expect(await duration()).toMatch(/^0\.12s/); + await page.emulateMedia({ reducedMotion: "reduce" }); + await page.reload(); + await expect(page.locator("[data-lit-list] .lit-head[data-placed]").first()).toBeAttached(); + expect(await duration()).toMatch(/^0s/); +}); diff --git a/umtool/next.config.ts b/umtool/next.config.ts @@ -19,6 +19,9 @@ const nextConfig: NextConfig = { // fail the whole module graph. Every page importing lib/projects then 500s // with "Can't resolve 'cbor-x'", which names a package nothing here uses. serverExternalPackages: ["lmdb"], + // The dev indicator defaults to the bottom-left corner, which is the rail's + // foot -- it sat over the theme control. The live umtool runs `next dev`. + devIndicators: { position: "bottom-right" }, // Every old page address and where it lives now: ONE table, redirects.mjs, // which e2e/redirects.spec.ts (P3) reads too. Empty until P3 moves a page. async redirects() {