commit aa7809736ac923473b55d45606945610e6c2937d parent 847af24971d04ec2a4f0b7461bfa2832915af9b2 Author: I Mean I'm Just Saying <imeanimjustsaying@kiwifarms.st> Date: Wed, 14 Oct 2026 19:46:40 -0400 Merge main (P6b live, f84f644d) into ux/r61 Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Diffstat:
116 files changed, 904 insertions(+), 525 deletions(-)
diff --git a/editor/CHANGELOG.md b/editor/CHANGELOG.md @@ -5,6 +5,12 @@ - **`enumerate_matches` takes `ids`.** Only the pages that hold those recordings are read, so the scan is bounded by them rather than by the scope; the footer says how many the scope holds. A sweep restricted to given recordings (a refresh's update, a triage's escalation) now scans only theirs. - **A tick no longer waits hours on a paused transcription.** When the transcription workers are paused or none is enabled, a refresh's or tick's fetch skips `transcribe-bucket` and says "transcription is paused (…) — N recordings wait; a later run reads them once transcribed" as a warning. A fetch step that was cancelled is a warning; "nothing new to transcribe" is no longer one. - **`pnpm ops report-schedule --json '{"action": "reset-triage", "id": "<schedule>"}'`** discards a schedule's triage state — its triage runs (from run `"k"` on; default all), its `seen.json` (so the next run counts new from its start date) and the quiet editions those runs covered (so the next tick covers those windows again) — answering the plan first; `"confirm": true` does it. Refused while a tick runs. The schedule, its cadence, its tick log and every edition article stay. +- **umtool's old addresses are permanent redirects now (308).** Every row of `umtool/redirects.mjs` — `/browse…`, `/articles`, `/sites`, `/articles/new`, `/drafts`, `/mix`, `/sort`…`/keeps`, `/bench` and the editor's `/?from=` hand-off to Create — answers 308 instead of 307. A browser caches a 308 forever, so these rows are never repointed or removed. A project that an article claims still lands on its article with a 307: that one follows the article. +- **In umtool no action is a Signal outline or a verdict colour.** Signal is the focus, the lit line, a selection and the one filled action on a page. Create's article form (**Start sweep** / **Start research**) and the projects index's new-project form submit with it. Deletes, removals, cancels and Settings · system's **Prune…** are ink outlines, guarded by their plan and confirm. A toggle that is on (a pressed verdict, a reason, a star, a chip) wears the panel ground. The song tools' hand-made teal and green buttons (find, trims, faces, mix, the deck, the phrase console), a note's **Resolve** and the projects index's red **blocking** facet are gone. A clip not fetched yet, one that ends mid-sentence and one the widener would move are tagged as open findings, not in amber. +- **umtool's buttons say what they do, in sentence case, and every page has a title.** Some examples: the Build tab's **Show the command** / **Build** / **Cancel build**, **Tag N videos**, **Take snapshot**, **Fetch N unfetched clips via the editor**, the Deliver tab's **Cut N confirmed clips from cache**, the clip bench's controls, a note's **Resolve** / **Reply** / **Delete**, **Copy citation** (was "cite"), **Mark this moment**, **Promote … to …**. "Draft with" now reads whole: **Draft**, then the model. Pages under a place have proper titles (Archive, Runs, Find, Faces, Song piles, Sort, Verdict bench, Compare, Evidence). The faces, sources, mix and find pages no longer open with an explanatory paragraph. +- **Work lists a watch as its own kind.** A watch was listed under Series; it now has a **Watch** chip in the kind facet (`/work?kind=watch`). +- **Settings · generation's Spend today reads "2026-10-14 UTC"** (it said "2026-10-14UTC"). +- **`umtool/e2e/visual-audit.spec.ts` checks every page against the colour rules.** It opens 64 pages, covering every place, every tab of an article, a project and a song, each bench, each Create form, each tool and both Settings pages. On each, in both themes, it checks that no action is a Signal outline or in a verdict colour, that there is at most one filled action, and that nothing scrolls sideways at 1366 wide. It then walks Inbox → piece → bench → piece → Inbox by keyboard alone and checks the focus ring at every stop. With `P6B_SHOTS=<dir>` it also saves every page at 1366×768 and 1440×900 in both themes. - **umtool's research board no longer loses or misreads keys pressed while it saves.** A key pressed while a move, a claim, a note or the speaker check is still saving now waits for the save and then acts on the redrawn board. `e` + a claim + Enter saves the claim instead of running its letters as commands (which had renamed the case). Two quick `s` presses toggle the speaker check twice. A `j` lands after the moved quote. The board's saves now run one at a time, in order, so an older answer can no longer undo a newer one. Needs a restart of umtool. - **umtool's docs follow the redesign.** `umtool/docs/` has a sheet per place — `inbox.md`, `research.md`, `work.md`, `piece.md`, `tools.md`, `settings.md` — and `refresh.md` and `recurring.md`; the README lists the places, Create's lines and every old address with where it lands now. The dashboard, browse, decisions, sites and projects sheets are folded into them. - **umtool's Settings · system says its status in lines.** The tools and free disk, the roots, the index ("51 records · rebuilt 3 min ago", once — the tools panel no longer repeats it), umtool's own jobs, the projects by state, the deliverables, the sources nobody has checked (**Re-check N projects**), then storage last. **Check** / **Check again** probe the tools. diff --git a/plans/FACTS.md b/plans/FACTS.md @@ -9443,7 +9443,8 @@ parsed to 0 cues, indexing the video textless) is CLOSED by `200a3105` (transcri `songProjectId` in `lib/browse.ts`). - **Redirects are ONE table**, `umtool/redirects.mjs`, read by `next.config.ts`'s `redirects()` (checked before the filesystem, the query passed through, the request's query FIRST) and by `e2e/redirects.spec.ts`. 16 rows, all - 307 (`permanent: false`) until P6b flips them to 308: `/` with `?from=` → `/create`; `/articles/new` and + **308** (`permanent: true`) since P6b (307 before) — a browser caches a 308 forever, so a row is never repointed + or removed: `/` with `?from=` → `/create`; `/articles/new` and `/drafts` → `/create?make=article`; `/browse` → `/work`; `/browse/decisions` → `/`; `/browse/{find,faces,sources}`, `/browse/trim/:set` → `/tools/…`; `/browse/at` → `/projects/at`; `/browse/:path*` → `/projects/:path*` (after the reserved rows); `/articles` → @@ -9455,5 +9456,7 @@ parsed to 0 cues, indexing the video textless) is CLOSED by `200a3105` (transcri - **A song's canonical address is its full path** (`/projects/<REPORTS_ROOT-relative path>`, `/…/<cut>`); the basename resolves only when unique (`resolveProjectPath`, `lib/projects.ts`). - **Colour is a role, and verdict colours are judgements only** (`umtool/app/globals.css`): Signal is focus, the lit - line and ONE filled action per view (`buttonVariants` `go`); every other action is an `outline`; a state that is - not a judgement wears `badgeVariants` `state` (a dashed ink edge); Meter is measurement. + line and ONE filled action per view (`buttonVariants` `go`); every other action is an `outline` (a delete too: its + plan and confirm guard it, there is no red button and no Signal outline since P6b); a toggle that is on is + `pressed` (the panel ground); a state that is not a judgement wears `badgeVariants` `state` (a dashed ink edge); + Meter is measurement. `e2e/visual-audit.spec.ts` measures every page's actions by computed colour. diff --git a/plans/umtool-redesign.md b/plans/umtool-redesign.md @@ -442,9 +442,11 @@ edition reviewed with the operator before the schedule is left on. | R4 refresh | `ux/r4` → `main` `08fee8e1` | LIVE 2026-10-14 (editor nFiNyOdI…, umtool -HUqAEPA…) | | R5 recurring reports | `ux/r5` → `main` `0bf4aacd` | LIVE 2026-10-14 (editor 379S-Sk9…, umtool vWDhtigj…) | | R6 triage first | `ux/r6` → `main` `326beacf` | LIVE 2026-10-14 (editor i-wNjJfg…) | -| Co-host pilot | — | in progress (orchestrator, with the operator) | -| P6a cleanup, docs, audit | `ux/p6a` | shipped on the branch (before R6) | -| P6b 308s, screenshot audit | — | after R6 | +| Board races fix | `ux/board-race` → `main` `d9c119e2` | LIVE 2026-10-14 | +| P6a cleanup, docs, audit | `ux/p6a` → `main` `7fb90e6e` | LIVE 2026-10-14 (umtool VUNZhrt6…) | +| P6b 308s, screenshot audit | `ux/p6b` → `main` `850e0989` | LIVE 2026-10-14 (umtool Te2jR-P8…) | +| R6.1 honest tier 0 + R4.1 | `ux/r61` | in progress (found by the pilot's first tick) | +| Co-host pilot | — | schedule `co-host-updates` made and PAUSED; tick 1 a false quiet (tier 0 capped); re-run after R6.1, then the operator's review | ### P2a, as shipped @@ -3238,3 +3240,146 @@ keys held while the board settles and replayed on the redrawn board, the lit lin `data-autofocus` field. Gates: `board.spec` 5/5 alone; full umtool e2e on the merged tip 471 passed, 0 failed, 6 skipped. umtool built and restarted (`scripts/board-umtool.sh`); live `/research` and a case page 200. + +### P6b, as shipped + +**What.** The last phase: the redirects become permanent, the list P6a and the rollouts left for P6b is cleared, and +every place and tab is audited against the canvas (v2) at 1366×768 and 1440×900 in both themes, with an e2e spec that +holds the colour roles from now on. No URL moved. + +- **308s.** Every `umtool/redirects.mjs` row is `permanent: true`, 16 rows. The `has` rule `/?from=` → `/create` is kept + (the editor's `VideoPanel`/`VideoNavStrip` still link it), now a 308 too. `redirects.spec` asserts 308 and the Location + for every row (with and without a query) and that each destination answers 200; the hrefs unit test asserts + `permanent: true`. **Browsers cache a 308 forever:** from now on a row is never repointed or removed, only added. + The claimed project's page `redirect()` (`/projects/<path>` → its article, `claimedProjectRedirect`) stays a 307 on + purpose: it follows state (an article can stop claiming a project). +- **The inherited list.** + - The `primary` and `destructive` button variants are gone; `pressed` (the panel ground) is new. NewArticleForm's + submit is the page's one `go` and names its result (**Start sweep** / **Start research**); the `/projects` + new-project submit is `go`; ActionPlan's trigger and confirm are outlines; **Prune…** is an outline (plan-then-confirm + guards it, as **Delete schedule**). DeletePlan, a job's Cancel, ResearchSlot's **No**, a quote's or a post's removal, + the board's remove confirm and the Build tab's cancel/replace are outlines; a pressed **Rejected** is `pressed` like a + pressed **Approved**. + - Hand-rolled Signal and verdict colours: TrimBench (Play selection, Save/Clear trim, the trimmed hooks in the kept + colour), FaceDeck (Commit, the pressed verdict and reasons, the preview's frame, "on the shipped cover"), Deck (Play + whole window, Keep it, Drop it anyway in red, the "another sound" toggle), MixBench (Play, Render in green), + PhraseConsole (timecodes, stars), WordSelector ("labelled"), ShortlistBar, ClaimBench's and TakesBench's toggles, + BuildChain (Run the chain, "running"), TimedNotes' Mark, ArticleReader's filter, RunView's running status, the find + page (Find, the pager, chips), the compare page's change bars and "only here", a note's Resolve and Add note (kept + colour) and its Delete's red hover, the projects index's red **blocking** facet. Kept on purpose: Signal on focus, + the lit line, a list's current item (`aria-current`), a selection on a waveform, the article reader's floating + **Note** on a selection, a composer's **Save note**. + - Lower-case labels → sentence case naming the result: the Build tab's **Show the command** / **Build** (was "run") / + **Cancel build** / **Stamp it aside and build**; **Tag N videos**; **Mark this moment**, **Promote … to …**, + **Retire** / **Restore**, **Save note**, **Copy citation** (was "cite"), **Measure the rest**, **Compare**, **Blind + A/B**, **Match variant**, **Accept — spends N videos**; `/projects`' **+ New project**, **Filter**, **Clear**, + **Work**, **Inbox**, **Copy the whole picture**; the deck's, the trim bench's, the mix bench's and the faces deck's + buttons and verdict words; the clip bench's controls; the Deliver tab's **Cut N confirmed clips from cache** / + **Build share batch**; **Take snapshot**; **Fetch N unfetched clips via the editor**; a note's **Resolve**, + **Won't fix**, **Reopen**, **Reply**, **Edit**, **Delete**. + - Spend today read "2026-10-14UTC": the date and "UTC" were two text nodes that rendered with no space between them; it is one + string now. + - **A watch is its own kind on Work** (`kind=watch`, the row says "watch"; `lib/work.ts`, the facet); triage-first.spec + checks it under Watch and not under Series. + - Triage docs: `triage.md` covered the watch shape; it now names the `worth-researching` decision kind and Work's + Watch kind; `recurring.md` and `work.md` name the Watch kind. Links and anchors checked by a script (the only misses + were inline-code examples and an anchor in `report-to-video/README.md`, both fine). + - `components/dashboard/` and `lib/dashboard.ts` are renamed: InboxList and ResumeChip → `components/inbox/`, Lifecycle → + `components/piece/`, SlashFocus → `components/shell/`, ToolList → `components/tools/`, CheckSourcesButton → + `components/system/`, `lib/dashboard.ts` → `lib/system/status.ts`; every import moved. + - Clipped copy: "Draft with" sat beside its model select, so it read as a sentence cut off before the model. The button + is now **Draft** and "with" sits before the model. No other dangling "with" in the copy (grep). +- **Page titles and lead paragraphs (found by the audit).** A page under a place had a lower-case title (archive, runs, + find, faces, song piles, sources, verdict bench, trim, the deck's sort/salvage/verify/keeps, compare, evidence): each is + sentence case, and the place crumbs over them (Research, Runs, Tools, Projects, Song piles) too; an id or a piece's name + is spelled as it is. The faces page's explanatory paragraph, the sources page's, the mix page's instruction line and + find's empty-state essay go (tools.md keeps what they said); the faces page keeps its one status line. +- **Docs.** README's places table names each place once with its addresses (Inbox, Research, Work, a site, a piece, a + series or watch and its triage runs, the benches, Create, Tools, Settings); its old-address paragraph and FACTS' + redirect table say 308; FACTS' colour line says there is no red button and no Signal outline. + +| sha | what | +|---|---| +| `5d1705b8` | every redirects.mjs row 308; `redirects.spec`, `hrefs.test.mjs` | +| `936770f7` | `components/dashboard` and `lib/dashboard.ts` renamed by what they are | +| `e84ad32f` | a watch is its own Work kind; `triage-first.spec` | +| `798b3622` | no Signal outline, no red button (`primary`/`destructive` gone, `pressed` new), the inherited labels, Draft with | +| `73c525da` | docs: the places once each, the Watch kind, `worth-researching`; FACTS: 308, the colour line | +| `c12ca26d` | page titles in sentence case, no lead paragraphs on the tools; `find`, `faces`, `research` specs | +| `b5c44ddd` | `e2e/visual-audit.spec.ts`: 64 pages × both themes by computed colour, the keyboard-only pass | +| `e1bf8a64` | the audit's fixes: the rest of the labels, open findings as `state`, the spend line, the blocking facet; `clip-bench`, `article-notes`, `triage` specs | +| `26cc4408` | the triage page's crumb and the refresh dialog's status line back to `main` (the R6.1 lane owns them) | +| `277c130b` | the run page's crumbs (RunView's header) say Research / Runs | + +**Audit** (job scratch `p6b-shots/`: `before/` = the first audit build, mid-way through the inherited list; `pass2/`, `pass3/`; +`after/`, `after-r5/`, `after-r6/` = the full run at the tip. Each page at 1366×768 and 1440×900, dark and light, on the e2e +fixture build). The spec measures the colour roles and the fit; the table is what the eye found against the canvas. + +| Page | State before | Fixed / left | +|---|---|---| +| Inbox | the canvas's: one big count, groups, one filled action (Retry run) | — | +| Research, results + reader | canvas | — | +| Research · a case (board) | canvas; "? Speaker not checked" in doubt is the canvas's own `.flag` | — | +| Research · archive | title "archive" | fixed: Archive | +| Research · runs, a run page | titles "runs"; the run's running status in Signal | fixed | +| Work | canvas | fixed: Watch kind | +| `/projects` | red **blocking** facet; lower-case Filter/Work/Inbox/+ new project/copy the whole picture; Signal-outline submit | fixed | +| A site (`/sites/priv`) | canvas | — | +| Article piece: Overview, Article, Iterations | FAILED / BLOCKING / ✕ check words are judgements, kept | left: "+ note", "show every quote" small lower-case links | +| Article piece: Cut, Build, Deliver, Sources, History, Media | "not fetched yet" / "ends mid-sentence" / "widener would move it" in doubt; lower-case Build, Deliver, History, Sources buttons; "Draft with" read clipped | fixed | +| Project piece (report video), all seven tabs | as the article's Cut…History | fixed (same components) | +| Song piece: Overview, Cuts, Spec, Cover, Notes; a cut page | lower-case copy this song / save(d) / blind A/B / match / accept; the cover's rule-break warning in reject is a judgement | fixed | +| Clip bench | lower-case controls (save window, play selection, reset, cut to quote, fetch to …) | fixed; left: the sibling bands' Signal tint (a selection overlay, ClipBench internals) | +| Claim, narration, takes, drafts-review benches | fit 1366×768; takes' "listen" | fixed: Listen; left: the claim bench's option values (media, coffee, employees …) are values | +| Create and each form (research, article, board, recurring/watch, the four video lines, song) | Start was a Signal outline | fixed: Start sweep / Start research filled | +| Series page, a triage page | R6.1's lane | left for the orchestrator: the triage page's crumb "work" (twice, `app/series/[id]/triage/[k]/page.tsx`, `TriageView.tsx`) | +| The refresh dialog | R6.1's lane | left for the orchestrator: its started line is `text-signal-text` (a status in Signal, `RefreshDialog.tsx:256`) | +| Tools | tool names lower case (sort, salvage, find …) | left: tool names are the tools' ids, in the rail and the list alike (`shell.spec` reads them exact) | +| Find, mix, faces, sources, trim, song piles, the deck's piles, verdict bench | lower-case titles; Signal-outline Find / Play / Commit / Run the chain; green Render / Save trim; lead paragraphs | fixed | +| Settings · generation | "2026-10-14UTC"; preset names code / balanced / api / local | fixed the date; left: the presets are the policy's ids, spelled so everywhere (chip, Create) and read exact by `settings.spec` | +| Settings · system | Prune… in the reject word | fixed: outline | + +1366×768 fit: no page scrolls sideways (measured, both themes). **Keyboard-only pass** (in the spec): Inbox `j`/`k` +light the first card with the focus on it, Tab reaches **Retry run**, Enter opens zeta's Iterations; `4` opens its Cut +tab; Tab to **Walk the cut**, Enter opens clip bench a1; Tab to **← zeta**, Enter returns to the piece; ⌘K, "Inbox", +Enter returns to `/`. Every Tab stop shows a focus ring. + +**Gates.** + +| Gate | Result | +|---|---| +| repo-wide `tsc --noEmit` | clean at `5d1705b8`, `798b3622`, `e1bf8a64`; `pnpm --filter umtool typecheck` clean at every commit | +| umtool unit (`node --test umtool/lib/*.test.mjs umtool/lib/*/*.test.mjs umtool/report-to-video/*.test.mjs`) | 860 tests: 858 pass, 2 skipped, 0 fail | +| `pnpm --filter umtool test` | 31/31 | +| `pnpm run test:scripts` (reads the capped build's traces) | 1012 tests: 1010 pass, 2 skipped, 0 fail | +| `pnpm archilyzer docs cli --check` | clean | +| capped umtool `next build` (corpus linked, `MemoryMax=5G`, heavy slot `--build --estimate 5120`) | exit 0 at `e1bf8a64`: compiled 14.4 s, 41 s wall, 1.53 GB max RSS; the link removed | +| `visual-audit.spec` alone (three passes while fixing) | pass 1: 63 passed, 1 failed (the faces deck's current row, a lit item: the spec now exempts `aria-current`), 2.2 min; pass 2: 65/65; pass 3: 65/65 (2.3 min) | +| full umtool e2e, run 1, at `26cc4408` (detached, queued, with `P6B_SHOTS`, `R5_SHOTS`, `R6_SHOTS`) | **542 tests: 535 passed, 1 failed, 6 skipped** (the song-data skips), 12.0 min. The red: `media-surfaces.spec:40`, the cut's provenance line lacked `cut-draft.json` right after its draft job ended (`prov` was null while `row.drafted` was read): a read between the stub's manifest write and its draft-file write, in code this lane did not touch. The spec alone at the same tip **3× — 2/2, 2/2, 2/2** | +| full umtool e2e, run 2, at `26cc4408` | **542 tests: 536 passed, 0 failed, 6 skipped**, 13.3 min wall | +| `run-trace.spec` + `research.spec` at `277c130b` (the run page's crumbs) | 18/18 | +| common, editor, mcp | not touched | + +**Left.** +- R6.1's files, listed above for the orchestrator: the triage page's "work" crumb, the refresh dialog's Signal status line. +- Small lower-case affordance links ("+ note", "show every quote", "+ notes on this cover") and value labels (option + values, variant tags, preset ids, tool names): not actions that name a result. +- Failure and error words stay in the reject word (an error says what to fix); a check's ✓/✕ and a rule-break warning + are judgements. +- `media-surfaces.spec:40` went red once in two full runs (above): the provenance line read before the draft file was + there. A read-ordering race in the Media tab's refresh after a draft job, worth one look when the drafts view is next + touched; not reproduced in 3 runs alone. +- `triage-first.spec` gained this lane's Work-kind check (a watch under Watch, not Series): R6.1 may touch that spec too. + +### P6b rollout (orchestrator, 2026-10-14) + +Rulings: the `destructive` button variant is removed (a variant named for red that draws an ink outline would lie); +the benches' "Projects" crumb links `/projects`; the claimed-project page redirect stays a 307 (it follows state); the +leftovers in R6.1's files (the triage page's "work" crumb, the refresh dialog's Signal status line) go to R6.1. Gates on +`850e0989`: full umtool e2e 536 passed, 0 failed, 6 skipped (run 1's single red, `media-surfaces.spec:40`, a read +between the stub's two writes, 3/3 alone and green in run 2); the new `visual-audit.spec` over 64 pages in both themes. +`main` fast-forwarded to `850e0989`; umtool built (after waiting on the heavy slot for memory) and restarted +(`scripts/p6b-umtool.sh`). Live: all 16 `redirects.mjs` rows answer **308** to their destination, `/?from=<slug>/<id>` +included (→ `/create?from=…`); every place 200, `/work?kind=watch` 200; decisions API 833 rows, notes' hrefs end +`note=<id>`; the MCP `notes` tool lists the same 14 open notes. Browsers now cache these redirects for good. + diff --git a/umtool/app/articles/[report]/compare/page.tsx b/umtool/app/articles/[report]/compare/page.tsx @@ -88,7 +88,7 @@ function Side({ side, other, both }: { side: CompareSide; other: CompareSide; bo <div key={i} data-section={s.title} data-only={otherTitles.has(s.title) ? undefined : "here"}> <h4 className="text-[13px] font-semibold"> {s.title} - {!otherTitles.has(s.title) && <span className={`ml-2 ${badgeVariants({ variant: "open", size: "sm" })}`}>only here</span>} + {!otherTitles.has(s.title) && <span className={`ml-2 ${badgeVariants({ variant: "state", size: "sm" })}`}>only here</span>} </h4> <ul className="mt-1 space-y-1"> {s.findings.map((f, j) => { @@ -98,7 +98,7 @@ function Side({ side, other, both }: { side: CompareSide; other: CompareSide; bo key={j} data-finding data-changed={changed ? "yes" : undefined} - className={`border-l-2 pl-2 text-[13px] ${changed ? "border-[var(--color-sel)]" : "border-transparent text-[var(--color-dim)]"}`} + className={`border-l-2 pl-2 text-[13px] ${changed ? "border-muted" : "border-transparent text-[var(--color-dim)]"}`} > {f.text} {f.cites > 0 && <span className="num ml-1 text-[11px] text-[var(--color-dim)]">[{f.cites}]</span>} @@ -120,7 +120,7 @@ function Side({ side, other, both }: { side: CompareSide; other: CompareSide; bo {side.cut.entries.map((e, i) => { const changed = !otherCut.has(`${e.type}:${e.id}:${e.narration ?? e.quote ?? ""}`); return ( - <li key={i} data-cut-entry={e.id} data-changed={changed ? "yes" : undefined} className={`border-l-2 pl-2 ${changed ? "border-[var(--color-sel)]" : "border-transparent"}`}> + <li key={i} data-cut-entry={e.id} data-changed={changed ? "yes" : undefined} className={`border-l-2 pl-2 ${changed ? "border-muted" : "border-transparent"}`}> {e.type === "card" ? ( <> <span className="font-semibold">▌ {e.heading}</span> @@ -161,7 +161,7 @@ export default async function ComparePage({ const header = ( <AppShell active="articles" - crumbs={[{ href: articlesHref(), label: "articles" }, { href: iterations, label: report }, { label: "compare" }]} + crumbs={[{ href: articlesHref(), label: "articles" }, { href: iterations, label: report }, { label: "Compare" }]} meta={left && right ? `${left.label} and ${right.label}` : undefined} /> ); diff --git a/umtool/app/page.tsx b/umtool/app/page.tsx @@ -1,7 +1,7 @@ import Link from "next/link"; -import InboxList, { type InboxCard, type InboxGroup } from "@/components/dashboard/InboxList"; -import { UndoBar } from "@/components/dashboard/Lifecycle"; -import ResumeChip from "@/components/dashboard/ResumeChip"; +import InboxList, { type InboxCard, type InboxGroup } from "@/components/inbox/InboxList"; +import { UndoBar } from "@/components/piece/Lifecycle"; +import ResumeChip from "@/components/inbox/ResumeChip"; import AppShell from "@/components/shell/AppShell"; import { buttonVariants } from "@/components/ui/button"; import { machineCalls } from "@/lib/machine"; diff --git a/umtool/app/projects/[...path]/page.tsx b/umtool/app/projects/[...path]/page.tsx @@ -52,7 +52,7 @@ export default async function BrowsePathPage({ return ( <div className="flex h-full flex-col"> <AppShell active="projects" - crumbs={[{ href: "/projects", label: "projects" }, { label: segments.join("/") }]} + crumbs={[{ href: "/projects", label: "Projects" }, { label: segments.join("/") }]} note={`${resolved.ambiguous.length} projects answer to that name`} /> <main className="deck-main flex-1 p-4"> @@ -85,7 +85,7 @@ export default async function BrowsePathPage({ return ( <div className="flex h-full flex-col"> <AppShell active="projects" - crumbs={[{ href: "/projects", label: "projects" }, { label: folder.label }]} + crumbs={[{ href: "/projects", label: "Projects" }, { label: folder.label }]} note={`${mine.length} project${mine.length === 1 ? "" : "s"}`} /> <main className="deck-main flex-1 p-4"> diff --git a/umtool/app/projects/page.tsx b/umtool/app/projects/page.tsx @@ -1,5 +1,5 @@ import Link from "next/link"; -import { badgeVariants, type BadgeVariants } from "@/components/ui/badge"; +import { badgeVariants } from "@/components/ui/badge"; import { buttonVariants } from "@/components/ui/button"; import { EmptyState } from "@/components/ui/empty-state"; import { Input } from "@/components/ui/field"; @@ -11,7 +11,7 @@ import CopyButton from "@/components/CopyButton"; import ProjectGrid from "@/components/projects/ProjectGrid"; import { KINDS, decisionCounts, indexHealth, listFolders, listProjects } from "@/lib/projects"; import { PROJECT_STATES } from "@/lib/project-types"; -import { projectsNote } from "@/lib/dashboard"; +import { projectsNote } from "@/lib/system/status"; export const dynamic = "force-dynamic"; @@ -140,7 +140,6 @@ export default async function BrowsePage({ href={qs({ open: "blocking" })} on={open === "blocking"} label={`blocking ${nOf((p) => (counts.get(p.id)?.blocking ?? 0) > 0)}`} - tone="blocking" /> <Chip href={qs({ open: "1" })} @@ -172,11 +171,11 @@ export default async function BrowsePage({ className="w-60 font-mono text-[12.5px]" /> <button type="submit" className={buttonVariants({ size: "md" })}> - filter + Filter </button> {q && ( <Link href={qs({ q: "" })} className="ink-link text-[12px]"> - clear + Clear </Link> )} </form> @@ -184,13 +183,13 @@ export default async function BrowsePage({ <NewProjectMenu kinds={KINDS.map((k) => ({ id: k.id, label: k.label, scaffold: k.scaffold }))} open={!!sp.new} /> <div className="ml-auto flex items-center gap-2"> <Link href={workHref()} className={buttonVariants({ size: "md" })}> - work + Work </Link> <Link href={homeHref()} className={buttonVariants({ size: "md" })}> - inbox + Inbox </Link> <CopyButton - label="copy the whole picture" + label="Copy the whole picture" title="every project as markdown — spec, cuts, verdicts, notes and resolved marks" url="/api/browse/context" className={buttonVariants({ size: "md" })} @@ -234,12 +233,10 @@ function Chip({ href, on, label, - tone, }: { href: string; on: boolean; label: string; - tone?: BadgeVariants["variant"]; }) { return ( <Link @@ -248,7 +245,7 @@ function Chip({ // and it is the actual accessibility statement -- the colour is only the // visible half of it. aria-current={on ? "true" : undefined} - className={badgeVariants({ variant: on ? "on" : (tone ?? "neutral") })} + className={badgeVariants({ variant: on ? "on" : "neutral" })} > {label} </Link> diff --git a/umtool/app/research/[case]/page.tsx b/umtool/app/research/[case]/page.tsx @@ -30,7 +30,7 @@ export default async function CasePage({ params }: { params: Promise<{ case: str <BoardView initial={view} /> ) : ( <> - <AppHeader crumbs={[{ href: researchHref(), label: "research" }, { label: id }]} /> + <AppHeader crumbs={[{ href: researchHref(), label: "Research" }, { label: id }]} /> <div className="px-7 pt-6"> <EmptyState title={error?.status === 404 ? `No case “${id}”` : "This case cannot be read"}> <span role="alert">{error?.message}</span>{" "} diff --git a/umtool/app/research/archive/page.tsx b/umtool/app/research/archive/page.tsx @@ -34,7 +34,7 @@ export default async function ArchivePage({ searchParams }: { searchParams: Prom <div className="flex h-full flex-col"> <AppShell active="research" - crumbs={[{ href: researchHref(), label: "research" }, { label: "archive" }]} + crumbs={[{ href: researchHref(), label: "Research" }, { label: "Archive" }]} meta="what the archive can answer · by year" note={data ? `${data.rows.length} channels · ${data.years.length ? `${data.years[0]}–${data.years[data.years.length - 1]}` : "no dates"}` : undefined} /> diff --git a/umtool/app/research/runs/[article]/[n]/page.tsx b/umtool/app/research/runs/[article]/[n]/page.tsx @@ -40,7 +40,7 @@ export default async function RunPage({ <RunView key={`${view.article}/${view.n}/${view.run}`} initial={view} /> ) : ( <> - <AppHeader crumbs={[{ href: researchHref(), label: "research" }, { href: runsHref(), label: "runs" }, { label: `${article} i${n}` }]} /> + <AppHeader crumbs={[{ href: researchHref(), label: "Research" }, { href: runsHref(), label: "Runs" }, { label: `${article} i${n}` }]} /> <div className="px-7 pt-6"> <EmptyState title={error?.status === 404 ? `No run ${article} i${n}` : "This run cannot be read"}> <span role="alert">{error?.message}</span>{" "} diff --git a/umtool/app/research/runs/page.tsx b/umtool/app/research/runs/page.tsx @@ -18,7 +18,7 @@ export default async function RunsPage() { <div className="flex h-full flex-col"> <AppShell active="research" - crumbs={[{ href: researchHref(), label: "research" }, { label: "runs" }]} + crumbs={[{ href: researchHref(), label: "Research" }, { label: "Runs" }]} note={`${rows.length} ${rows.length === 1 ? "sweep" : "sweeps"}${live ? ` · ${live} running` : ""}`} /> <div className="min-h-0 flex-1 overflow-auto px-7 pb-6 pt-3"> diff --git a/umtool/app/settings/generation/page.tsx b/umtool/app/settings/generation/page.tsx @@ -65,9 +65,8 @@ export default async function GenerationPage() { <Panel title="Spend today" aside={ - <span className="text-muted-2"> - {day} UTC · the editor's ledger - </span> + // One string: the date and "UTC" rendered as two text nodes lost the space between them. + <span className="text-muted-2">{`${day} UTC · the editor's ledger`}</span> } data-spend-today={spend.usd.toFixed(2)} > diff --git a/umtool/app/settings/page.tsx b/umtool/app/settings/page.tsx @@ -1,5 +1,5 @@ import AppShell from "@/components/shell/AppShell"; -import ToolList from "@/components/dashboard/ToolList"; +import ToolList from "@/components/tools/ToolList"; import { generationPolicyHref, systemHref } from "@/lib/hrefs"; export const dynamic = "force-dynamic"; diff --git a/umtool/app/settings/system/page.tsx b/umtool/app/settings/system/page.tsx @@ -4,7 +4,7 @@ import { IndexPanel, RootsPanel, StoragePanel } from "@/components/system/Mainte import { ActivityPanel, DeliverablesPanel, ProjectsPanel, SourcesPanel } from "@/components/system/Status"; import ToolsPanel from "@/components/system/ToolsPanel"; import { listActivity, runningActivity } from "@/lib/activity"; -import { projectsNote, sourceBuckets, stateRows } from "@/lib/dashboard"; +import { projectsNote, sourceBuckets, stateRows } from "@/lib/system/status"; import { toolsCache } from "@/lib/doctor"; import { generationPolicyHref, settingsHref } from "@/lib/hrefs"; import { freeBytesUnder } from "@/lib/machine"; diff --git a/umtool/app/tools/bench/page.tsx b/umtool/app/tools/bench/page.tsx @@ -52,7 +52,7 @@ export default async function BenchPage({ searchParams }: { searchParams: Promis <div className="flex h-full flex-col"> <AppShell active="bench" - crumbs={[{ label: "tools", href: "/tools" }, { label: "verdict bench" }]} + crumbs={[{ label: "Tools", href: "/tools" }, { label: "Verdict bench" }]} note={`${runs.length} run${runs.length === 1 ? "" : "s"}`} /> <main className="deck-main flex-1 p-4 text-[12px]"> diff --git a/umtool/app/tools/faces/page.tsx b/umtool/app/tools/faces/page.tsx @@ -50,28 +50,17 @@ export default async function FacesPage({ searchParams }: { searchParams: Promis return ( <div className="flex h-full flex-col"> <AppShell active="faces" - crumbs={[{ href: "/tools", label: "tools" }, { label: "faces" }]} + crumbs={[{ href: "/tools", label: "Tools" }, { label: "Faces" }]} note={`${queue.length} corners · ${onAccepted} on accepted covers · ${Object.keys(verdicts.faces).length} judged`} /> <main className="deck-main flex-1 space-y-3 p-4"> - <p className="text-[12px] text-[var(--color-dim)]"> - Every corner on record, deduped by episode and moment, with the ones that ship - first. The dashed amber box is what <span className="num">facecrop.py</span> would - cut; the solid one is yours. Judging writes{" "} - <span className="num">face-verdicts.json</span>, which{" "} - <span className="num">make-thumb.mjs</span> reads — this page never touches the - thumb manifests. - {unrecorded > 0 && ( - <> - {" "} - <span className="text-[var(--color-dirty)]" data-unrecorded={unrecorded}> - {unrecorded} of them have no box recorded at all, so what they were cut from - is not known — only what they were cut near. - </span> - </> - )} - </p> + {/* No lead paragraph (the copy rule): only the status that changes what you can trust. */} + {unrecorded > 0 && ( + <p role="status" className="text-[12px] text-text-2" data-unrecorded={unrecorded}> + {unrecorded} corners have no box recorded: what they were cut from is not known, only what they were cut near. + </p> + )} <FaceDeck queue={queue} diff --git a/umtool/app/tools/find/page.tsx b/umtool/app/tools/find/page.tsx @@ -97,7 +97,7 @@ export default async function FindPage({ searchParams }: { searchParams: Promise <div className="flex h-full flex-col"> <AppShell active="find" - crumbs={[{ href: "/tools", label: "tools" }, { label: "find" }]} + crumbs={[{ href: "/tools", label: "Tools" }, { label: "Find" }]} note={`${episodes.length} episodes${result ? ` · ${result.corpus.words.toLocaleString()} words · ${result.ms}ms` : ""}`} /> @@ -119,9 +119,9 @@ export default async function FindPage({ searchParams }: { searchParams: Promise )} <button type="submit" - className="rounded border border-[var(--color-sel)] px-2.5 py-1 font-mono text-[12px] text-[var(--color-sel)]" + className="rounded border border-seam-2 px-2.5 py-1 text-[12px] text-text hover:border-muted" > - find + Find </button> <span className="micro"> strictly adjacent · up to {MAX_TERMS} terms · <kbd>/</kbd> to focus @@ -213,13 +213,13 @@ export default async function FindPage({ searchParams }: { searchParams: Promise <nav className="mt-3 flex items-center gap-2" aria-label="pages"> {query.page > 1 && ( <Link href={href({ page: String(query.page - 1) })} - className="rounded border border-[var(--color-line)] px-2 py-0.5 font-mono text-[11px] text-[var(--color-sel)]"> + className="rounded border border-[var(--color-line)] px-2 py-0.5 font-mono text-[11px] text-text hover:border-muted"> ← previous </Link> )} {query.page < pages && ( <Link href={href({ page: String(query.page + 1) })} data-next - className="rounded border border-[var(--color-line)] px-2 py-0.5 font-mono text-[11px] text-[var(--color-sel)]"> + className="rounded border border-[var(--color-line)] px-2 py-0.5 font-mono text-[11px] text-text hover:border-muted"> next → </Link> )} @@ -233,9 +233,7 @@ export default async function FindPage({ searchParams }: { searchParams: Promise {!result && ( <section data-find data-total="0" data-shown="0" data-collapsed="0" data-corpus-built="0"> <p className="text-[12px] text-[var(--color-dim)]"> - {episodes.length} episodes of word-level ASR, unindexed until something is asked of - them. Type a phrase: every occurrence comes back with the second it was said at, and - that second addresses the sound and the picture alike. + Nothing asked yet · {episodes.length} episodes of word-level ASR. </p> </section> )} @@ -251,7 +249,7 @@ function Chip({ href, on, label }: { href: string; on: boolean; label: string }) aria-current={on ? "true" : undefined} className={`rounded border px-1.5 py-0.5 font-mono text-[11px] ${ on - ? "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/app/tools/mix/page.tsx b/umtool/app/tools/mix/page.tsx @@ -27,7 +27,7 @@ export default async function MixPage({ <div className="flex h-full flex-col"> <AppShell active="mix" - crumbs={[{ label: "mix" }]} + crumbs={[{ href: "/tools", label: "Tools" }, { label: "Mix" }]} meta={ preset?.fromHref ? ( <Link @@ -38,9 +38,7 @@ export default async function MixPage({ ← {preset.from} {preset.clip ? ` / ${preset.clip}` : ""} </Link> - ) : ( - "set the handover and the end point, hear it, then render it" - ) + ) : null } note={<span className="num hidden lg:inline">{MEDIA_ROOTS.length} roots</span>} /> diff --git a/umtool/app/tools/page.tsx b/umtool/app/tools/page.tsx @@ -1,5 +1,5 @@ import AppShell from "@/components/shell/AppShell"; -import ToolList, { PILE_WHAT, type ToolEntry } from "@/components/dashboard/ToolList"; +import ToolList, { PILE_WHAT, type ToolEntry } from "@/components/tools/ToolList"; import { benchHref, facesHref, findHref, mixHref, pileHref, songToolsHref, sourcesHref, trimHref } from "@/lib/hrefs"; import { TRIM_SETS } from "@/lib/trim"; diff --git a/umtool/app/tools/song/page.tsx b/umtool/app/tools/song/page.tsx @@ -1,5 +1,5 @@ import AppShell from "@/components/shell/AppShell"; -import ToolList, { PILE_WHAT } from "@/components/dashboard/ToolList"; +import ToolList, { PILE_WHAT } from "@/components/tools/ToolList"; import { pileHref, toolsHref } from "@/lib/hrefs"; import { MODES } from "@/lib/types"; @@ -11,7 +11,7 @@ export const dynamic = "force-dynamic"; export default function SongToolsPage() { return ( <div className="flex h-full flex-col"> - <AppShell active="song" crumbs={[{ href: toolsHref(), label: "tools" }, { label: "song piles" }]} /> + <AppShell active="song" crumbs={[{ href: toolsHref(), label: "Tools" }, { label: "Song piles" }]} /> <main className="deck-main flex-1 px-4 pb-6 pt-4"> <ToolList groups={[{ title: "Piles", tools: MODES.map((m) => ({ href: pileHref(m), name: m, what: PILE_WHAT[m], testid: m })) }]} /> </main> diff --git a/umtool/app/tools/sources/page.tsx b/umtool/app/tools/sources/page.tsx @@ -22,7 +22,7 @@ export default async function SourcesPage() { <div className="flex h-full flex-col"> <AppShell active="sources" - crumbs={[{ href: "/tools", label: "tools" }, { label: "sources" }]} + crumbs={[{ href: "/tools", label: "Tools" }, { label: "Sources" }]} note={`${c.videos.length} episodes · ${c.builds} plans`} /> <main className="deck-main flex-1 p-4"> @@ -51,12 +51,8 @@ export default async function SourcesPage() { /> </dl> - <p className="mb-3 max-w-3xl text-[12px] text-[var(--color-dim)]"> - Placements are how much of the finished runtime an episode supplies; clips are how - much of the palette. One beloved clip used ninety times and ninety clips used once are - the same placement count and a very different corpus — so both are here, and neither - is summed with the other. - </p> + {/* Placements (runtime an episode supplies) and clips (palette) are + different units: both are shown, never summed. No lead paragraph. */} <table className="w-full border-collapse text-[12px]"> <thead> diff --git a/umtool/app/tools/trim/[set]/page.tsx b/umtool/app/tools/trim/[set]/page.tsx @@ -28,7 +28,7 @@ export default async function TrimPage({ params }: { params: Promise<{ set: stri return ( <div className="flex h-full flex-col"> <AppShell active="trim" - crumbs={[{ href: "/tools", label: "tools" }, { label: `trim: ${set.id}` }]} + crumbs={[{ href: "/tools", label: "Tools" }, { label: `Trim: ${set.id}` }]} note={`${catalogue.hooks.length} hooks · ${trims.length} trimmed`} /> <main className="deck-main flex-1"> diff --git a/umtool/app/work/page.tsx b/umtool/app/work/page.tsx @@ -1,6 +1,6 @@ import Link from "next/link"; -import { UndoBar, LifecycleButton } from "@/components/dashboard/Lifecycle"; -import SlashFocus from "@/components/dashboard/SlashFocus"; +import { UndoBar, LifecycleButton } from "@/components/piece/Lifecycle"; +import SlashFocus from "@/components/shell/SlashFocus"; import AppShell from "@/components/shell/AppShell"; import { badgeVariants } from "@/components/ui/badge"; import { buttonVariants } from "@/components/ui/button"; @@ -61,7 +61,7 @@ export default async function WorkPage({ searchParams }: { searchParams: Promise const href = (next: Partial<Search>) => workHref({ ...sp, deleted: undefined, freed: undefined, ...next }); const sites = [...new Set(all.map((r) => r.site).filter((s): s is string => !!s))].sort(); - const kinds = [{ id: "article", label: "Article" }, { id: "series", label: "Series" }, ...KINDS.map((k) => ({ id: k.id, label: k.label }))].filter( + const kinds = [{ id: "article", label: "Article" }, { id: "series", label: "Series" }, { id: "watch", label: "Watch" }, ...KINDS.map((k) => ({ id: k.id, label: k.label }))].filter( (k) => all.some((r) => r.kinds.includes(k.id)), ); const bySite = sp.by === "site"; diff --git a/umtool/components/BuildChain.tsx b/umtool/components/BuildChain.tsx @@ -129,15 +129,15 @@ export default function BuildChain({ setId }: { setId: string }) { onClick={() => post(true)} className="rounded border border-[var(--color-line)] px-2.5 py-1 text-[12px] text-[var(--color-dim)] hover:text-[var(--color-text)] disabled:opacity-40" > - show the commands + Show the commands </button> <button type="button" disabled={busy || !body || job?.state === "running"} onClick={() => post(false)} - className="rounded border border-[var(--color-sel)] px-2.5 py-1 text-[12px] text-[var(--color-sel)] disabled:opacity-40" + className="rounded border border-seam-2 px-2.5 py-1 text-[12px] text-text hover:border-muted disabled:opacity-40" > - run the chain + Run the chain </button> </div> @@ -159,7 +159,7 @@ export default function BuildChain({ setId }: { setId: string }) { <div className="micro mb-1"> step {i + 1} · {s.label} {job && job.stepIndex === i && job.state === "running" && ( - <span className="ml-2 text-[var(--color-sel)]">running</span> + <span className="ml-2 text-text-2">running</span> )} </div> <pre diff --git a/umtool/components/CutBench.tsx b/umtool/components/CutBench.tsx @@ -248,7 +248,7 @@ export default function CutBench({ : "border-[var(--color-line)] text-[var(--color-dim)] hover:text-[var(--color-text)]" }`} > - {blind ? "blind — labels hidden" : "blind A/B"} + {blind ? "Blind — labels hidden" : "Blind A/B"} </button> {!pair && ( <span className="text-[11px] text-[var(--color-dim)]"> @@ -375,7 +375,7 @@ export default function CutBench({ durations={durations} videoRef={a} onMatch={() => copyTime(b.current, a.current)} - matchLabel="← match variant" + matchLabel="← Match variant" notes={notes} /> <Pane @@ -386,7 +386,7 @@ export default function CutBench({ durations={durations} videoRef={b} onMatch={() => copyTime(a.current, b.current)} - matchLabel="match shipped →" + matchLabel="Match shipped →" notes={notes} /> </div> @@ -454,7 +454,7 @@ export default function CutBench({ onClick={() => act("promote", chosen.rel)} className={buttonVariants({ size: "md" })} > - promote {chosen.tag} to {cut} + Promote {chosen.tag} to {cut} </button> <button type="button" @@ -462,7 +462,7 @@ export default function CutBench({ onClick={() => act(chosen.retired ? "restore" : "retire", chosen.rel)} className="rounded border border-[var(--color-line)] px-2.5 py-1 text-[12px] text-[var(--color-dim)] hover:text-[var(--color-text)] disabled:opacity-40" > - {chosen.retired ? "restore" : "retire"} + {chosen.retired ? "Restore" : "Retire"} </button> {/* Say what promote DOES before it is pressed. It is reversible only because the current cut is moved aside rather than overwritten, diff --git a/umtool/components/Deck.tsx b/umtool/components/Deck.tsx @@ -2,6 +2,7 @@ import { useCallback, useEffect, useMemo, useRef, useState } from "react"; import AppHeader from "./shell/AppHeader"; +import { songToolsHref } from "@/lib/hrefs"; import PitchRail, { type CorpusPitch } from "./PitchRail"; import Waveform, { type Peaks } from "./Waveform"; import WordSelector, { type Vocab } from "./WordSelector"; @@ -1005,7 +1006,7 @@ export default function Deck({ page, vocab: initialVocab, reasons }: Props) { const header = useMemo( () => ( <AppHeader - crumbs={[{ label: "song" }, { label: mode }]} + crumbs={[{ href: songToolsHref(), label: "Song piles" }, { label: `${mode.charAt(0).toUpperCase()}${mode.slice(1)}` }]} meta={ <> {clips.length} on this page of {total} · {orderNote} @@ -1185,15 +1186,15 @@ export default function Deck({ page, vocab: initialVocab, reasons }: Props) { type="button" onClick={playView} disabled={!detail || detail.sourceMissing} - className="rounded border border-[var(--color-sel)] px-1.5 py-0.5 text-[var(--color-sel)] disabled:opacity-30" + className="rounded border border-seam-2 px-1.5 py-0.5 text-text hover:border-muted disabled:opacity-30" > - <kbd>A</kbd> play whole window + <kbd>A</kbd> Play whole window </button> <label title="after submitting, keep this window instead of advancing — for a second sound in the same stretch" className={`flex cursor-pointer items-center gap-1.5 rounded border px-1.5 py-0.5 ${ moreHere - ? "border-[var(--color-sel)] text-[var(--color-sel)]" + ? "border-muted bg-panel-2 text-text" : "border-[var(--color-line)]" }`} > @@ -1204,7 +1205,7 @@ export default function Deck({ page, vocab: initialVocab, reasons }: Props) { disabled={!detail} className="accent-[var(--color-sel)]" /> - <kbd>M</kbd> another sound in this window + <kbd>M</kbd> Another sound in this window </label> {captured.length ? ( <span className="num rounded border border-[var(--color-good)] px-1.5 text-[var(--color-good)]"> @@ -1370,17 +1371,17 @@ export default function Deck({ page, vocab: initialVocab, reasons }: Props) { setConfirmDrop(null); setPending(null); }} - className="rounded-md border border-[var(--color-sel)] px-3 py-2 text-sm text-[var(--color-sel)]" + className="rounded-md border border-seam-2 px-3 py-2 text-sm text-text hover:border-muted" > - <kbd>Esc</kbd> keep it + <kbd>Esc</kbd> Keep it </button> <button type="button" data-confirm-drop onClick={() => void commit(confirmDrop.verdict, confirmDrop.code, confirmDrop.text)} - className="rounded-md border border-[var(--color-bad)] px-3 py-2 text-sm text-[var(--color-bad)]" + className="rounded-md border border-seam-2 px-3 py-2 text-sm text-text hover:border-muted" > - drop it anyway + Drop it anyway </button> </div> </div> diff --git a/umtool/components/DeletePlan.tsx b/umtool/components/DeletePlan.tsx @@ -86,7 +86,7 @@ export default function DeletePlan({ if (phase.at === "closed") { return ( - <Button size={size} variant="destructive" onClick={() => void ask(false)}> + <Button size={size} variant="outline" onClick={() => void ask(false)}> {label} </Button> ); @@ -188,7 +188,7 @@ export default function DeletePlan({ {forceLabel} </label> )} - <Button size="sm" variant="destructive" disabled={blocked.length > 0 || phase.at === "deleting"} onClick={() => void confirm(plan)}> + <Button size="sm" variant="outline" disabled={blocked.length > 0 || phase.at === "deleting"} onClick={() => void confirm(plan)}> {phase.at === "deleting" ? "Deleting…" : "Confirm delete"} </Button> <Button diff --git a/umtool/components/FaceDeck.tsx b/umtool/components/FaceDeck.tsx @@ -584,7 +584,7 @@ export default function FaceDeck({ {idx + 1} of {queue.length} </span> {entry.onAccepted ? ( - <span className="text-[11px] text-[var(--color-sel)]" data-on-accepted="1"> + <span className="text-[11px] text-text" data-on-accepted="1"> on the shipped {entry.accepted.join(" + ")} cover </span> ) : ( @@ -634,7 +634,7 @@ export default function FaceDeck({ data-face-preview width={CORNER_PX} height={CORNER_PX} - className="h-[300px] w-[300px] rounded border border-[var(--color-sel)] bg-[var(--color-panel-2)]" + className="h-[300px] w-[300px] rounded border border-muted bg-[var(--color-panel-2)]" /> <p className="micro">the corner, at the size it is cut</p> @@ -734,11 +734,11 @@ export default function FaceDeck({ aria-pressed={pending === v} className={`rounded border px-2 py-0.5 font-mono text-[12px] ${ pending === v - ? "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)]" }`} > - {v} <span className="micro">{key}</span> + {v.charAt(0).toUpperCase() + v.slice(1)} <span className="micro">{key}</span> </button> ))} @@ -748,7 +748,7 @@ export default function FaceDeck({ data-reset-crop className="ml-2 rounded border border-[var(--color-line)] px-2 py-0.5 font-mono text-[12px] text-[var(--color-dim)] hover:text-[var(--color-text)]" > - reset to auto <span className="micro">r</span> + Reset to auto <span className="micro">r</span> </button> <button type="button" @@ -756,16 +756,16 @@ export default function FaceDeck({ data-suggest className="rounded border border-[var(--color-line)] px-2 py-0.5 font-mono text-[12px] text-[var(--color-dim)] hover:text-[var(--color-text)]" > - suggest the border <span className="micro">b</span> + Suggest the border <span className="micro">b</span> </button> <button type="button" disabled={!pending || busy} onClick={() => void commit()} data-commit - className="rounded border border-[var(--color-sel)] px-2 py-0.5 font-mono text-[12px] text-[var(--color-sel)] disabled:opacity-40" + className="rounded border border-seam-2 px-2 py-0.5 text-[12px] text-text hover:border-muted disabled:opacity-40" > - {busy ? "saving…" : "commit"} <span className="micro">↵</span> + {busy ? "Saving…" : "Commit"} <span className="micro">↵</span> </button> </div> @@ -781,7 +781,7 @@ export default function FaceDeck({ aria-pressed={code === i + 1} className={`rounded border px-1.5 py-0.5 font-mono text-[11px] ${ code === i + 1 - ? "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)]" }`} > @@ -795,7 +795,7 @@ export default function FaceDeck({ aria-pressed={code === OTHER_CODE} className={`rounded border px-1.5 py-0.5 font-mono text-[11px] ${ code === OTHER_CODE - ? "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/LastPage.tsx b/umtool/components/LastPage.tsx @@ -5,7 +5,7 @@ import { usePathname } from "next/navigation"; import { LAST_PAGE_KEY, isRecordable } from "@/lib/last-page"; // The recorder rides in the root layout and writes down where you are. What -// reads it back is components/dashboard/ResumeChip.tsx, which offers the URL as +// reads it back is components/inbox/ResumeChip.tsx, which offers the URL as // a link on the dashboard -- / stopped being a doorway when it became a page. // // Neither uses useSearchParams(). That hook demands a Suspense boundary, and diff --git a/umtool/components/LoudnessTable.tsx b/umtool/components/LoudnessTable.tsx @@ -87,7 +87,7 @@ export default function LoudnessTable({ data-measure-all className={`ml-auto ${buttonVariants({ size: "sm" })}`} > - {busy ? `measuring ${busy}…` : "measure the rest"} + {busy ? `Measuring ${busy}…` : "Measure the rest"} </button> )} </div> @@ -145,7 +145,7 @@ export default function LoudnessTable({ data-measure={r.rel} className="rounded border border-[var(--color-line)] px-1.5 py-0.5 text-[11px] text-[var(--color-dim)] hover:text-[var(--color-text)] disabled:opacity-40" > - {busy === r.rel ? "measuring…" : "not measured — measure"} + {busy === r.rel ? "Measuring…" : "Not measured — measure"} </button> )} </td> diff --git a/umtool/components/MixBench.tsx b/umtool/components/MixBench.tsx @@ -548,9 +548,9 @@ export default function MixBench({ preset = null }: { preset?: MixPresetProp }) type="button" onClick={() => (playing ? stop() : void play())} disabled={!body} - className="rounded border border-[var(--color-sel)] px-2 py-1 text-[var(--color-sel)] disabled:opacity-30" + className="rounded border border-seam-2 px-2 py-1 text-text hover:border-muted disabled:opacity-30" > - <kbd>space</kbd> {playing ? "stop" : "play"} + <kbd>space</kbd> {playing ? "Stop" : "Play"} </button> <button type="button" @@ -558,17 +558,17 @@ export default function MixBench({ preset = null }: { preset?: MixPresetProp }) disabled={!body} className="rounded border border-[var(--color-line)] px-2 py-1 disabled:opacity-30" > - <kbd>h</kbd> hear the handover + <kbd>h</kbd> Hear the handover </button> <button type="button" onClick={zoomHandover} className="rounded border border-[var(--color-line)] px-2 py-1"> - zoom to handover + Zoom to handover </button> <button type="button" onClick={() => setView({ from: 0, to: Math.max(4, duration) })} className="rounded border border-[var(--color-line)] px-2 py-1" > - fit + Fit </button> <span className="num"> playhead {playhead != null ? fmt(playhead) : "—"} · bg gain{" "} @@ -604,15 +604,15 @@ export default function MixBench({ preset = null }: { preset?: MixPresetProp }) disabled={!body} className="rounded border border-[var(--color-line)] px-3 py-2 text-[13px] disabled:opacity-30" > - show the command + Show the command </button> <button type="button" onClick={() => void submit(false)} disabled={!body || job?.state === "running"} - className="rounded border border-[var(--color-good)] px-3 py-2 text-[13px] text-[var(--color-good)] hover:bg-[color-mix(in_srgb,var(--color-good)_14%,transparent)] disabled:opacity-30" + className="rounded border border-seam-2 px-3 py-2 text-[13px] text-text hover:border-muted hover:bg-panel-2 disabled:opacity-30" > - {job?.state === "running" ? "rendering…" : "render"} + {job?.state === "running" ? "Rendering…" : "Render"} </button> </div> diff --git a/umtool/components/MomentMarks.tsx b/umtool/components/MomentMarks.tsx @@ -96,7 +96,7 @@ export default function MomentMarks({ data-mark className={buttonVariants({ size: "sm" })} > - mark this moment + Mark this moment </button> {marks.length > 0 && ( <CopyButton @@ -153,7 +153,7 @@ export default function MomentMarks({ </button> <span className="flex-1 text-[11px] text-[var(--color-text)]">{m.note}</span> <CopyButton - label="cite" + label="Copy citation" title="this moment, resolved to the clip playing there" url={ `/api/browse/context?song=${encodeURIComponent(song)}` + diff --git a/umtool/components/NewProjectMenu.tsx b/umtool/components/NewProjectMenu.tsx @@ -118,7 +118,7 @@ export default function NewProjectMenu({ if (!open) { return ( <Button type="button" size="sm" variant="outline" disabled={!hydrated} onClick={() => setOpen(true)} data-new-project className="border-dashed"> - + new project + + New project </Button> ); } @@ -241,7 +241,7 @@ export default function NewProjectMenu({ </label> )} <div className="flex items-center gap-2 pb-px"> - <Button type="submit" variant={inline ? "go" : "primary"} disabled={!hydrated || busy || !slug.trim()} data-new-create> + <Button type="submit" variant="go" disabled={!hydrated || busy || !slug.trim()} data-new-create> {busy ? "Creating…" : submitLabel} </Button> <Button type="button" variant="quiet" disabled={!hydrated} onClick={cancel}> diff --git a/umtool/components/NoteField.tsx b/umtool/components/NoteField.tsx @@ -130,7 +130,7 @@ export default function NoteField({ onClick={save} className={buttonVariants({ size: "sm" })} > - save + Save note </button> <button type="button" @@ -140,7 +140,7 @@ export default function NoteField({ }} className="text-[11px] text-[var(--color-dim)] hover:text-[var(--color-text)]" > - cancel + Cancel </button> <span className="num ml-auto text-[10px] text-[var(--color-dim)]"> {draft.length}/{NOTE_LIMIT} · <kbd>⌘⏎</kbd> diff --git a/umtool/components/PhraseConsole.tsx b/umtool/components/PhraseConsole.tsx @@ -289,7 +289,7 @@ export default function PhraseConsole({ void play(h, false); }} aria-label={`play ${h.text}`} - className="num rounded border border-[var(--color-line)] px-1.5 py-0.5 font-mono text-[11px] text-[var(--color-sel)] hover:border-[var(--color-sel)]" + className="num rounded border border-[var(--color-line)] px-1.5 py-0.5 font-mono text-[11px] text-text hover:border-muted" > {fmtTime(h.start)} </button> @@ -315,7 +315,7 @@ export default function PhraseConsole({ title={list ? `${stars.has(h.id) ? "remove from" : "add to"} ${list}` : "no shortlist selected"} className={`rounded border px-1.5 py-0.5 font-mono text-[11px] ${ stars.has(h.id) - ? "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/PlanDiffPanel.tsx b/umtool/components/PlanDiffPanel.tsx @@ -82,7 +82,7 @@ export default function PlanDiffPanel({ data-plandiff className={buttonVariants({ size: "sm" })} > - {busy ? "aligning…" : "compare"} + {busy ? "Aligning…" : "Compare"} </button> {a === b && <span className="text-[11px] text-[var(--color-dim)]">pick two different plans</span>} </div> diff --git a/umtool/components/ProvenancePanel.tsx b/umtool/components/ProvenancePanel.tsx @@ -314,7 +314,7 @@ export default function ProvenancePanel({ the arrangement -- no need to find it in a player first. */} <CopyButton - label="cite" + label="Copy citation" title="this moment in the arrangement, with its source clip and archive link" url={`/api/browse/context?song=${encodeURIComponent(song)}&clip=${encodeURIComponent(r.clipId)}`} /> diff --git a/umtool/components/ShortlistBar.tsx b/umtool/components/ShortlistBar.tsx @@ -112,7 +112,7 @@ export default function ShortlistBar({ aria-current={list?.slug === s.slug ? "true" : undefined} className={`num rounded border px-1.5 py-0.5 font-mono text-[11px] ${ list?.slug === s.slug - ? "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)]" }`} > @@ -145,7 +145,7 @@ export default function ShortlistBar({ disabled={busy || !name.trim()} className="rounded border border-[var(--color-line)] px-1.5 py-0.5 font-mono text-[11px] text-[var(--color-dim)] hover:text-[var(--color-text)] disabled:opacity-40" > - create + Create list </button> </form> diff --git a/umtool/components/SpecSheet.tsx b/umtool/components/SpecSheet.tsx @@ -138,7 +138,7 @@ export default function SpecSheet({ data-save-spec className={`ml-auto ${buttonVariants({ size: "md" })}`} > - {dirty ? "save" : "saved"} + {dirty ? "Save" : "Saved"} </button> </div> diff --git a/umtool/components/ThumbBench.tsx b/umtool/components/ThumbBench.tsx @@ -177,7 +177,7 @@ export default function ThumbBench({ data-accept={c.name} className={buttonVariants({ size: "sm" })} > - {busy === c.name ? "accepting…" : `accept — spends ${c.corners.length} videos`} + {busy === c.name ? "Accepting…" : `Accept — spends ${c.corners.length} videos`} </button> ) )} diff --git a/umtool/components/TrimBench.tsx b/umtool/components/TrimBench.tsx @@ -199,23 +199,23 @@ export default function TrimBench({ setId, label, hooks, initialTrims, hookNotes <button type="button" onClick={() => play(sel.from, sel.to)} - className="rounded border border-[var(--color-sel)] px-2.5 py-1 text-[12px] text-[var(--color-sel)]" + className="rounded border border-seam-2 px-2.5 py-1 text-[12px] text-text hover:border-muted" > - play selection + Play selection </button> <button type="button" onClick={() => play(Math.max(0, view.from), view.to)} className="rounded border border-[var(--color-line)] px-2.5 py-1 text-[12px] text-[var(--color-dim)] hover:text-[var(--color-text)]" > - play view + Play view </button> <button type="button" onClick={stop} className="rounded border border-[var(--color-line)] px-2.5 py-1 text-[12px] text-[var(--color-dim)] hover:text-[var(--color-text)]" > - stop + Stop </button> <span className="num text-[11px] text-[var(--color-meter)]"> {sel.from.toFixed(3)} – {sel.to.toFixed(3)}s ({(sel.to - sel.from).toFixed(3)}s) @@ -225,9 +225,9 @@ export default function TrimBench({ setId, label, hooks, initialTrims, hookNotes disabled={saving} onClick={commit} data-commit - className="ml-auto rounded border border-[var(--color-good)] px-2.5 py-1 text-[12px] text-[var(--color-good)] disabled:opacity-40" + className="ml-auto rounded border border-seam-2 px-2.5 py-1 text-[12px] text-text hover:border-muted disabled:opacity-40" > - {unchanged ? "clear trim" : "save trim"} + {unchanged ? "Clear trim" : "Save trim"} </button> </div> @@ -268,7 +268,7 @@ export default function TrimBench({ setId, label, hooks, initialTrims, hookNotes i === idx ? "border-[var(--color-sel)] text-[var(--color-sel)]" : e - ? "border-[var(--color-good)] text-[var(--color-good)]" + ? "border-muted text-text" : "border-[var(--color-line)] text-[var(--color-dim)] hover:text-[var(--color-text)]" }`} > diff --git a/umtool/components/VerdictChip.tsx b/umtool/components/VerdictChip.tsx @@ -135,7 +135,7 @@ export default function VerdictChip({ type="submit" className={buttonVariants({ size: "sm" })} > - save + Save note </button> </form> ) : ( diff --git a/umtool/components/VerdictRow.tsx b/umtool/components/VerdictRow.tsx @@ -110,7 +110,7 @@ export default function VerdictRow({ > <div className="flex items-center gap-2"> <kbd>{c.key}</kbd> - <span className="font-semibold">{c.label}</span> + <span className="font-semibold">{c.label.charAt(0).toUpperCase() + c.label.slice(1)}</span> </div> <div className="mt-0.5 text-[11px] text-[var(--color-dim)]">{c.hint}</div> </button> diff --git a/umtool/components/WordSelector.tsx b/umtool/components/WordSelector.tsx @@ -115,7 +115,7 @@ export default function WordSelector({ {!value && token ? ( <span className="text-[11px] text-[var(--color-dim)]">from ASR</span> ) : value ? ( - <span className="text-[11px] text-[var(--color-sel)]">labelled</span> + <span className="text-[11px] text-text-2">labelled</span> ) : null} {/* The binding, VISIBLE. It has always existed and lived only in a title attribute, so it was discoverable by hovering a control you diff --git a/umtool/components/articles/ArticleReader.tsx b/umtool/components/articles/ArticleReader.tsx @@ -433,7 +433,7 @@ export default function ArticleReader({ type="button" aria-pressed={filter === f} onClick={() => setFilter(f)} - className={`rounded border px-1.5 py-0.5 font-mono text-[11px] ${filter === f ? "border-[var(--color-sel)] text-[var(--color-sel)]" : "border-[var(--color-line)] text-[var(--color-dim)]"}`} + className={`rounded border px-1.5 py-0.5 font-mono text-[11px] ${filter === f ? "border-muted bg-panel-2 text-text" : "border-[var(--color-line)] text-[var(--color-dim)]"}`} > {f} {counts[f]} </button> diff --git a/umtool/components/articles/EvidencePage.tsx b/umtool/components/articles/EvidencePage.tsx @@ -45,7 +45,7 @@ export default async function EvidencePage({ <div className="flex h-full flex-col"> <AppShell active="articles" - crumbs={[...crumbs, { href: articleHref({ site, id: reportId }), label: reportId }, { label: "evidence" }]} + crumbs={[...crumbs, { href: articleHref({ site, id: reportId }), label: reportId }, { label: "Evidence" }]} note={`${items.length} citations`} /> <EvidenceWalk site={site} report={reportId} items={items} initial={at} initialNotes={initialNotes} diff --git a/umtool/components/articles/NewArticleForm.tsx b/umtool/components/articles/NewArticleForm.tsx @@ -324,8 +324,8 @@ export default function NewArticleForm({ /> </label> )} - <Button type="submit" variant="primary" size="lg" disabled={sending || !policy}> - {sending ? "Starting…" : "Start"} + <Button type="submit" variant="go" size="lg" disabled={sending || !policy}> + {sending ? "Starting…" : begin === "research" ? "Start research" : "Start sweep"} </Button> {onCancel && ( <Button type="button" variant="quiet" size="lg" onClick={onCancel}> diff --git a/umtool/components/articles/NoteCards.tsx b/umtool/components/articles/NoteCards.tsx @@ -32,7 +32,7 @@ export function Composer({ busy, onSave, onCancel, - saveLabel = "save note", + saveLabel = "Save note", }: { label: string; initial?: string; @@ -80,7 +80,7 @@ export function Composer({ {saveLabel} </button> <button type="button" onClick={onCancel} className="text-[12px] text-[var(--color-dim)] hover:text-[var(--color-text)]"> - cancel + Cancel </button> <span className="micro ml-auto">ctrl+enter</span> </div> @@ -152,7 +152,7 @@ export function NoteCard({ label="edit note" initial={note.text} busy={busy} - saveLabel="save" + saveLabel="Save" onSave={async (text) => { await write({ op: "edit", id: note.id, text }); onCancelEdit?.(); @@ -178,7 +178,7 @@ export function NoteCard({ <Composer label="reply" busy={busy} - saveLabel="reply" + saveLabel="Reply" onSave={async (text) => { await write({ op: "reply", id: note.id, text }); setReplying(false); @@ -190,23 +190,23 @@ export function NoteCard({ {note.status === "open" ? ( <> <Act onClick={() => write({ op: "status", id: note.id, status: "resolved" })} disabled={busy}> - resolve + Resolve </Act> <Act onClick={() => write({ op: "status", id: note.id, status: "wontfix" })} disabled={busy}> - won’t fix + Won’t fix </Act> </> ) : ( <Act onClick={() => write({ op: "status", id: note.id, status: "open" })} disabled={busy}> - reopen + Reopen </Act> )} <Act onClick={() => setReplying(true)} disabled={busy}> - reply + Reply </Act> {mine && onEdit && ( <Act onClick={onEdit} disabled={busy}> - edit + Edit </Act> )} <Act @@ -215,7 +215,7 @@ export function NoteCard({ }} disabled={busy} > - delete + Delete </Act> </div> )} diff --git a/umtool/components/articles/ResearchSlot.tsx b/umtool/components/articles/ResearchSlot.tsx @@ -189,7 +189,7 @@ function ProposalRow({ <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)}> + <Button size="sm" variant="outline" disabled={busy} aria-label={`No to ${p.id}`} onClick={() => decide(p.id, false, why)}> No </Button> <input aria-label={`why not ${p.id}`} className={`${field} w-64`} placeholder="why not (optional)" value={why} onChange={(e) => setWhy(e.target.value)} /> diff --git a/umtool/components/dashboard/InboxList.tsx b/umtool/components/dashboard/InboxList.tsx @@ -1,152 +0,0 @@ -"use client"; - -import Link from "next/link"; -import { useState } from "react"; -import { buttonVariants } from "@/components/ui/button"; -import { LitList } from "@/components/ui/lit-list"; -import { LitActions, LitGroup, LitLine } from "@/components/ui/lit-line"; -import { cn } from "@/lib/utils"; -import { LifecycleButton, MuteButton, type LifecycleState } from "./Lifecycle"; - -// --------------------------------------------------------------------------- -// The Inbox's cards as ONE lit list (canvas "Inbox"): a group head, then a -// line per card -- piece · what, why under it, the count in Meter, the ONE -// primary action (filled Signal on the lit line only, app/globals.css -// `.lit-go`), then Park and Mute. -// -// Park and Mark done are the piece's lifecycle (lib/lifecycle.ts); Mute is one -// kind of call on one piece (lib/mutes.ts, beside it). Both are the server's, -// so every page and the API agree; a muted or parked card is listed again under -// "Muted N" / "Show hidden" with Unmute / Reactivate. -// --------------------------------------------------------------------------- - -export type InboxCard = { - key: string; - piece: string | null; - title: string; - kind: string; - what: string; - why: string; - count: number; - severity: string; - action: { label: string; href: string }; - /** The piece's lifecycle (a hidden card's is parked or done). */ - lifecycle: LifecycleState; - /** This kind of call is muted on the piece: the action is Unmute. */ - muted?: boolean; - /** Mark done is the action (POST), not a link. */ - finish?: boolean; -}; - -export type InboxGroup = { - id: string; - label: string; - note?: string; - collapsed: boolean; - decisions: number; - hidden: number; - cards: InboxCard[]; -}; - -export default function InboxList({ groups }: { groups: InboxGroup[] }) { - const [open, setOpen] = useState<Record<string, boolean>>({}); - const shown = groups.filter((g) => g.cards.length > 0); - - if (shown.length === 0) { - return ( - <p data-empty="" className="py-6 text-[12.5px] text-text-2"> - Nothing waiting on you - </p> - ); - } - return ( - <LitList label="Inbox" global> - {shown.map((g) => - g.collapsed && !open[g.id] ? ( - <button - key={g.id} - type="button" - data-group={g.id} - data-collapsed="" - aria-expanded={false} - onClick={() => setOpen((o) => ({ ...o, [g.id]: true }))} - className="mt-[18px] flex w-full items-center gap-2.5 border-b border-seam py-2 pl-5 pr-3 text-left text-[12.5px] text-muted-2 hover:text-text" - > - <span className="micro">{g.label}</span> - <span className="font-mono text-[12px] text-meter">{g.decisions}</span> - <span className="truncate">{g.note}</span> - <span aria-hidden="true" className="ml-auto"> - ▸ - </span> - </button> - ) : ( - <LitGroup - key={g.id} - data-group={g.id} - className="mt-[18px]" - title={g.label} - count={g.cards.length} - note={ - g.collapsed ? ( - <button type="button" onClick={() => setOpen((o) => ({ ...o, [g.id]: false }))} className="hover:text-text"> - collapse ▾ - </button> - ) : ( - g.note - ) - } - > - {g.cards.map((c) => ( - <Card key={c.key} card={c} /> - ))} - </LitGroup> - ), - )} - </LitList> - ); -} - -function Card({ card: c }: { card: InboxCard }) { - const parked = c.lifecycle !== "active"; - return ( - <LitLine - id={c.key} - data-card={c.kind} - data-piece={c.piece ?? undefined} - data-severity={c.severity} - data-muted={c.muted ? "" : undefined} - className="grid grid-cols-[minmax(0,1fr)_56px_190px_112px] items-center gap-x-3.5" - > - <div className="min-w-0"> - <b className="block truncate font-medium text-inherit" data-card-title=""> - {c.title} <span className="font-normal text-muted-2">·</span> {c.what} - </b> - <small className="block truncate text-[12px] text-muted-2">{c.why}</small> - </div> - <span className="text-right font-mono text-[12.5px] font-medium text-meter" data-count={c.count}> - {c.count} - </span> - <span className="justify-self-end"> - {c.muted && c.piece ? ( - <MuteButton piece={c.piece} kind={c.kind} title={c.title} muted variant="outline" size="md" className="lit-go" /> - ) : parked && c.piece ? ( - <LifecycleButton piece={c.piece} title={c.title} from={c.lifecycle} to="active" label="Reactivate" variant="outline" size="md" className="lit-go" /> - ) : c.finish && c.piece ? ( - <LifecycleButton piece={c.piece} title={c.title} from={c.lifecycle} to="done" label="Mark done" variant="outline" size="md" className="lit-go" /> - ) : ( - <Link href={c.action.href} prefetch={false} data-action-link="" className={cn(buttonVariants({ variant: "outline", size: "md" }), "lit-go")}> - {c.action.label} - </Link> - )} - </span> - <LitActions className="gap-0.5"> - {!parked && !c.muted && c.piece && ( - <> - <LifecycleButton piece={c.piece} title={c.title} from={c.lifecycle} to="parked" label="Park" /> - <MuteButton piece={c.piece} kind={c.kind} title={c.title} muted={false} label={c.finish ? "Not yet" : "Mute"} /> - </> - )} - </LitActions> - </LitLine> - ); -} diff --git a/umtool/components/inbox/InboxList.tsx b/umtool/components/inbox/InboxList.tsx @@ -0,0 +1,152 @@ +"use client"; + +import Link from "next/link"; +import { useState } from "react"; +import { buttonVariants } from "@/components/ui/button"; +import { LitList } from "@/components/ui/lit-list"; +import { LitActions, LitGroup, LitLine } from "@/components/ui/lit-line"; +import { cn } from "@/lib/utils"; +import { LifecycleButton, MuteButton, type LifecycleState } from "@/components/piece/Lifecycle"; + +// --------------------------------------------------------------------------- +// The Inbox's cards as ONE lit list (canvas "Inbox"): a group head, then a +// line per card -- piece · what, why under it, the count in Meter, the ONE +// primary action (filled Signal on the lit line only, app/globals.css +// `.lit-go`), then Park and Mute. +// +// Park and Mark done are the piece's lifecycle (lib/lifecycle.ts); Mute is one +// kind of call on one piece (lib/mutes.ts, beside it). Both are the server's, +// so every page and the API agree; a muted or parked card is listed again under +// "Muted N" / "Show hidden" with Unmute / Reactivate. +// --------------------------------------------------------------------------- + +export type InboxCard = { + key: string; + piece: string | null; + title: string; + kind: string; + what: string; + why: string; + count: number; + severity: string; + action: { label: string; href: string }; + /** The piece's lifecycle (a hidden card's is parked or done). */ + lifecycle: LifecycleState; + /** This kind of call is muted on the piece: the action is Unmute. */ + muted?: boolean; + /** Mark done is the action (POST), not a link. */ + finish?: boolean; +}; + +export type InboxGroup = { + id: string; + label: string; + note?: string; + collapsed: boolean; + decisions: number; + hidden: number; + cards: InboxCard[]; +}; + +export default function InboxList({ groups }: { groups: InboxGroup[] }) { + const [open, setOpen] = useState<Record<string, boolean>>({}); + const shown = groups.filter((g) => g.cards.length > 0); + + if (shown.length === 0) { + return ( + <p data-empty="" className="py-6 text-[12.5px] text-text-2"> + Nothing waiting on you + </p> + ); + } + return ( + <LitList label="Inbox" global> + {shown.map((g) => + g.collapsed && !open[g.id] ? ( + <button + key={g.id} + type="button" + data-group={g.id} + data-collapsed="" + aria-expanded={false} + onClick={() => setOpen((o) => ({ ...o, [g.id]: true }))} + className="mt-[18px] flex w-full items-center gap-2.5 border-b border-seam py-2 pl-5 pr-3 text-left text-[12.5px] text-muted-2 hover:text-text" + > + <span className="micro">{g.label}</span> + <span className="font-mono text-[12px] text-meter">{g.decisions}</span> + <span className="truncate">{g.note}</span> + <span aria-hidden="true" className="ml-auto"> + ▸ + </span> + </button> + ) : ( + <LitGroup + key={g.id} + data-group={g.id} + className="mt-[18px]" + title={g.label} + count={g.cards.length} + note={ + g.collapsed ? ( + <button type="button" onClick={() => setOpen((o) => ({ ...o, [g.id]: false }))} className="hover:text-text"> + collapse ▾ + </button> + ) : ( + g.note + ) + } + > + {g.cards.map((c) => ( + <Card key={c.key} card={c} /> + ))} + </LitGroup> + ), + )} + </LitList> + ); +} + +function Card({ card: c }: { card: InboxCard }) { + const parked = c.lifecycle !== "active"; + return ( + <LitLine + id={c.key} + data-card={c.kind} + data-piece={c.piece ?? undefined} + data-severity={c.severity} + data-muted={c.muted ? "" : undefined} + className="grid grid-cols-[minmax(0,1fr)_56px_190px_112px] items-center gap-x-3.5" + > + <div className="min-w-0"> + <b className="block truncate font-medium text-inherit" data-card-title=""> + {c.title} <span className="font-normal text-muted-2">·</span> {c.what} + </b> + <small className="block truncate text-[12px] text-muted-2">{c.why}</small> + </div> + <span className="text-right font-mono text-[12.5px] font-medium text-meter" data-count={c.count}> + {c.count} + </span> + <span className="justify-self-end"> + {c.muted && c.piece ? ( + <MuteButton piece={c.piece} kind={c.kind} title={c.title} muted variant="outline" size="md" className="lit-go" /> + ) : parked && c.piece ? ( + <LifecycleButton piece={c.piece} title={c.title} from={c.lifecycle} to="active" label="Reactivate" variant="outline" size="md" className="lit-go" /> + ) : c.finish && c.piece ? ( + <LifecycleButton piece={c.piece} title={c.title} from={c.lifecycle} to="done" label="Mark done" variant="outline" size="md" className="lit-go" /> + ) : ( + <Link href={c.action.href} prefetch={false} data-action-link="" className={cn(buttonVariants({ variant: "outline", size: "md" }), "lit-go")}> + {c.action.label} + </Link> + )} + </span> + <LitActions className="gap-0.5"> + {!parked && !c.muted && c.piece && ( + <> + <LifecycleButton piece={c.piece} title={c.title} from={c.lifecycle} to="parked" label="Park" /> + <MuteButton piece={c.piece} kind={c.kind} title={c.title} muted={false} label={c.finish ? "Not yet" : "Mute"} /> + </> + )} + </LitActions> + </LitLine> + ); +} diff --git a/umtool/components/dashboard/ResumeChip.tsx b/umtool/components/inbox/ResumeChip.tsx diff --git a/umtool/components/notes/NoteThread.tsx b/umtool/components/notes/NoteThread.tsx @@ -37,24 +37,24 @@ export function NoteThread({ <span className="flex gap-1.5 text-[10px]"> {open ? ( <> - <button type="button" data-note-action="resolve" disabled={busy} onClick={() => void write({ op: "status", id: note.id, status: "resolved" })} className="text-[var(--color-good)] hover:underline disabled:opacity-40"> - resolve + <button type="button" data-note-action="resolve" disabled={busy} onClick={() => void write({ op: "status", id: note.id, status: "resolved" })} className="text-text hover:underline disabled:opacity-40"> + Resolve </button> <button type="button" data-note-action="wontfix" disabled={busy} onClick={() => void write({ op: "status", id: note.id, status: "wontfix" })} className="text-[var(--color-dim)] hover:underline disabled:opacity-40"> - won’t fix + Won’t fix </button> </> ) : ( <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 + Reopen </button> )} <button type="button" data-note-action="reply" disabled={busy} onClick={() => setReply((r) => (r === null ? "" : null))} className="ink-link disabled:opacity-40"> - reply + Reply </button> {note.author === "operator" && ( - <button type="button" data-note-action="delete" disabled={busy} onClick={() => void write({ op: "delete", id: note.id })} className="text-[var(--color-dim)] hover:text-[var(--color-bad)] disabled:opacity-40"> - delete + <button type="button" data-note-action="delete" disabled={busy} onClick={() => void write({ op: "delete", id: note.id })} className="text-[var(--color-dim)] hover:text-text disabled:opacity-40"> + Delete </button> )} </span> @@ -127,9 +127,9 @@ export function NoteComposer({ type="button" disabled={busy || !text.trim()} onClick={add} - className="rounded border border-[var(--color-good)] px-2 py-0.5 text-[11px] text-[var(--color-good)] disabled:opacity-40" + className="rounded border border-seam-2 px-2 py-0.5 text-[11px] text-text hover:border-muted disabled:opacity-40" > - add + Add note </button> </div> ); diff --git a/umtool/components/notes/TimedNotes.tsx b/umtool/components/notes/TimedNotes.tsx @@ -128,7 +128,7 @@ export default function TimedNotes({ data-action="mark" disabled={!video} onClick={mark} - className="rounded border border-[var(--color-sel)] px-2 py-0.5 text-[11px] text-[var(--color-sel)] disabled:opacity-40" + className="rounded border border-seam-2 px-2 py-0.5 text-[11px] text-text hover:border-muted disabled:opacity-40" > Mark <kbd>n</kbd> </button> diff --git a/umtool/components/dashboard/Lifecycle.tsx b/umtool/components/piece/Lifecycle.tsx diff --git a/umtool/components/piece/LifecycleChip.tsx b/umtool/components/piece/LifecycleChip.tsx @@ -1,6 +1,6 @@ "use client"; -import { LifecycleButton, type LifecycleState } from "@/components/dashboard/Lifecycle"; +import { LifecycleButton, type LifecycleState } from "@/components/piece/Lifecycle"; import { badgeVariants } from "@/components/ui/badge"; import { cn } from "@/lib/utils"; import Menu from "./Menu"; @@ -8,7 +8,7 @@ import Menu from "./Menu"; // The piece's lifecycle in its head (canvas "Piece · Overview", `Active ▾`): // the state as a chip, and the moves out of it -- Park and Mark done while it // is active, Reactivate (and Mark done) while it is parked, Reactivate once it -// is done. The same POST and Undo bar as the Inbox's (components/dashboard/ +// is done. The same POST and Undo bar as the Inbox's (components/piece/ // Lifecycle.tsx); the page re-reads on a change. const WORD: Record<LifecycleState, string> = { active: "Active", parked: "Parked", done: "Done" }; diff --git a/umtool/components/piece/NextCard.tsx b/umtool/components/piece/NextCard.tsx @@ -1,5 +1,5 @@ import Link from "next/link"; -import { LifecycleButton } from "@/components/dashboard/Lifecycle"; +import { LifecycleButton } from "@/components/piece/Lifecycle"; import { buttonVariants } from "@/components/ui/button"; import { Card } from "@/components/ui/panel"; import { readNextCall } from "@/lib/pieces/frame"; diff --git a/umtool/components/piece/PieceFrame.tsx b/umtool/components/piece/PieceFrame.tsx @@ -1,5 +1,5 @@ import Link from "next/link"; -import { UndoBar } from "@/components/dashboard/Lifecycle"; +import { UndoBar } from "@/components/piece/Lifecycle"; import AppShell from "@/components/shell/AppShell"; import { buttonVariants } from "@/components/ui/button"; import { Stepper } from "@/components/ui/stepper"; diff --git a/umtool/components/projects/ClaimBench.tsx b/umtool/components/projects/ClaimBench.tsx @@ -115,7 +115,7 @@ function Choice({ className={ "rounded border px-2 py-1 text-[11px] " + (value === o - ? "border-[var(--color-sel)] bg-[var(--color-sel)]/15 text-[var(--color-sel)]" + ? "border-muted bg-panel-2 text-text" : "border-[var(--color-line)] text-[var(--color-dim)] hover:text-[var(--color-fg)]") } > diff --git a/umtool/components/projects/ClaimBenchPage.tsx b/umtool/components/projects/ClaimBenchPage.tsx @@ -1,5 +1,5 @@ import { notFound } from "next/navigation"; -import { browseHref, claimBenchHref } from "@/lib/hrefs"; +import { projectsHref, claimBenchHref } from "@/lib/hrefs"; import { BenchFrame, BenchTop } from "./bench/BenchShell"; import ClaimBench, { type ClaimBenchData } from "./ClaimBench"; import { manifestToken } from "@/lib/report/manifest.mjs"; @@ -93,7 +93,7 @@ export default async function ClaimBenchPage({ kind="claim" top={ <BenchTop - trail={[{ href: browseHref(), label: "projects" }]} + trail={[{ href: projectsHref(), label: "Projects" }]} back={{ href: back, label: project.name }} kind="Claim bench" here={claimId} diff --git a/umtool/components/projects/ClipBench.tsx b/umtool/components/projects/ClipBench.tsx @@ -2125,7 +2125,7 @@ export default function ClipBench({ data }: { data: ClipBenchData }) { className="ml-auto text-reader-signal hover:underline" onClick={() => setPeekPad((n) => n + PEEK_STEP)} > - peek further (±{peekPad + PEEK_STEP} s) + Peek further (±{peekPad + PEEK_STEP} s) </button> </> )} @@ -2229,7 +2229,7 @@ export default function ClipBench({ data }: { data: ClipBenchData }) { disabled={!unsaved || !!busy} onClick={saveWindow} > - save window + Save window </button> <button type="button" @@ -2237,7 +2237,7 @@ export default function ClipBench({ data }: { data: ClipBenchData }) { className={buttonVariants({ size: "sm" })} onClick={() => void play(sel.from, sel.to)} > - play selection + Play selection </button> <button type="button" @@ -2247,7 +2247,7 @@ export default function ClipBench({ data }: { data: ClipBenchData }) { title={!unsaved && extendedFrom ? `undo the extension: back to ${hms(extendedFrom.start)} – ${hms(extendedFrom.end)}` : undefined} onClick={() => resetRef.current()} > - reset + Reset </button> {data.mixHref && ( // Built SERVER-SIDE, because a mix link carries an absolute path @@ -2293,7 +2293,7 @@ export default function ClipBench({ data }: { data: ClipBenchData }) { })} onClick={() => choosePlayback((pb) => ({ ...pb, auto: !pb.auto }))} > - auto-audition {playback.auto ? "on" : "off"} + Auto-audition {playback.auto ? "on" : "off"} </button> {/* What is playing, and what it measured. The attributes are the bench's record of its last playback, on the audio clock -- @@ -2362,7 +2362,7 @@ export default function ClipBench({ data }: { data: ClipBenchData }) { } onClick={() => void cutToQuote()} > - cut to quote + Cut to quote </button> {clip.cutStart != null && ( <button @@ -2372,7 +2372,7 @@ export default function ClipBench({ data }: { data: ClipBenchData }) { disabled={!!busy} onClick={() => void save({ cutStart: "", cutEnd: "", lockCut: false })} > - clear cut + Clear cut </button> )} </span> @@ -2402,7 +2402,7 @@ export default function ClipBench({ data }: { data: ClipBenchData }) { title="put the mute mark at the playhead" onClick={muteAtPlayhead} > - mute from here + Mute from here </button> <button type="button" @@ -2412,7 +2412,7 @@ export default function ClipBench({ data }: { data: ClipBenchData }) { title="the next click on the waveform places the mute mark (Esc cancels)" onClick={() => setMutePick((v) => !v)} > - {mutePick ? "click the waveform…" : "pick on waveform"} + {mutePick ? "Click the waveform…" : "Pick on waveform"} </button> {mute != null && ( <button @@ -2421,7 +2421,7 @@ export default function ClipBench({ data }: { data: ClipBenchData }) { className={buttonVariants({ size: "sm" })} onClick={clearMute} > - clear mute + Clear mute </button> )} </span> @@ -2523,7 +2523,7 @@ export default function ClipBench({ data }: { data: ClipBenchData }) { disabled={!!busy} onClick={() => void fetchMore({ padBefore: nextBefore, padAfter: keepAfter })} > - ← fetch to −{nextBefore} s + ← Fetch to −{nextBefore} s </button> )} {afterMaxed ? ( @@ -2540,7 +2540,7 @@ export default function ClipBench({ data }: { data: ClipBenchData }) { disabled={!!busy} onClick={() => void fetchMore({ padBefore: keepBefore, padAfter: nextAfter })} > - fetch to +{nextAfter} s → + Fetch to +{nextAfter} s → </button> )} {/* THE WHOLE RECORDING, when neither edge is the answer. Last, @@ -2552,7 +2552,7 @@ export default function ClipBench({ data }: { data: ClipBenchData }) { disabled={!!busy} onClick={() => void fetchWholeSource()} > - fetch whole source via editor + Fetch whole source via editor </button> </div> )} @@ -2731,7 +2731,7 @@ export default function ClipBench({ data }: { data: ClipBenchData }) { }) } > - save and lock + Save and lock </button> </p> )} @@ -2787,7 +2787,7 @@ export default function ClipBench({ data }: { data: ClipBenchData }) { else el.pause(); }} > - {segPaused ? "play" : "pause"} + {segPaused ? "Play" : "Pause"} </button> <input type="range" @@ -2842,7 +2842,7 @@ export default function ClipBench({ data }: { data: ClipBenchData }) { disabled={!!busy} onClick={() => void rerender()} > - re-render this clip + Re-render this clip </button> <p className="text-[11px] leading-snug text-[var(--color-dim)]"> One clip, no crossfade, no chapters — it overwrites this clip’s segment and diff --git a/umtool/components/projects/ClipBenchPage.tsx b/umtool/components/projects/ClipBenchPage.tsx @@ -1,5 +1,5 @@ import { notFound } from "next/navigation"; -import { browseHref, clipBenchHref } from "@/lib/hrefs"; +import { projectsHref, clipBenchHref } from "@/lib/hrefs"; import { BenchFrame, BenchTop } from "./bench/BenchShell"; import ClipBench, { type ClipBenchData } from "./ClipBench"; import { manifestToken } from "@/lib/report/manifest.mjs"; @@ -175,7 +175,7 @@ export default async function ClipBenchPage({ kind="clip" top={ <BenchTop - trail={[{ href: browseHref(), label: "projects" }]} + trail={[{ href: projectsHref(), label: "Projects" }]} back={{ href: back, label: project.name }} kind="Clip bench" here={clipId} diff --git a/umtool/components/projects/DeliverActions.tsx b/umtool/components/projects/DeliverActions.tsx @@ -169,7 +169,7 @@ export default function DeliverActions({ className={buttonVariants({ size: "sm" })} onClick={() => void post("cut")} > - cut {needCut} confirmed clip{needCut === 1 ? "" : "s"} from cache + Cut {needCut} confirmed clip{needCut === 1 ? "" : "s"} from cache </button> <span className="flex items-center gap-1"> @@ -188,7 +188,7 @@ export default function DeliverActions({ className={buttonVariants({ variant: "ghost", size: "sm" })} onClick={() => void post("share", { name })} > - build share batch ({candidates}) + Build share batch ({candidates}) </button> </span> diff --git a/umtool/components/projects/DraftPanel.tsx b/umtool/components/projects/DraftPanel.tsx @@ -156,8 +156,10 @@ export function DraftControl({ ) : ( <div className="flex flex-wrap items-center gap-2"> <Button size="sm" variant="outline" aria-label={`Draft ${row.label}`} disabled={!policy || sending || active} onClick={() => void start()}> - Draft with + Draft </Button> + {/* "Draft with <model>": the button names the result, the model is chosen beside it. */} + <span className="text-[11.5px] text-muted">with</span> <select aria-label={`model for ${row.label}`} className={`${field} font-mono`} value={model} onChange={(e) => setModel(e.target.value)} disabled={!policy}> {models.map((m) => ( <option key={m} value={m}> diff --git a/umtool/components/projects/FetchUnfetchedButton.tsx b/umtool/components/projects/FetchUnfetchedButton.tsx @@ -158,8 +158,8 @@ export default function FetchUnfetchedButton({ onClick={() => void run()} > {running - ? `fetching ${done + 1} of ${total}…` - : `fetch ${total} unfetched clip${total === 1 ? "" : "s"} via the editor`} + ? `Fetching ${done + 1} of ${total}…` + : `Fetch ${total} unfetched clip${total === 1 ? "" : "s"} via the editor`} </button> {running && ( <button diff --git a/umtool/components/projects/MediaDrafts.tsx b/umtool/components/projects/MediaDrafts.tsx @@ -190,7 +190,7 @@ function FieldLine({ aria-pressed={row.state === "rejected"} disabled={busy} title="reject this draft; the note says what is wrong" - className={buttonVariants({ variant: row.state === "rejected" ? "destructive" : "outline", size: "sm" })} + className={buttonVariants({ variant: row.state === "rejected" ? "pressed" : "outline", size: "sm" })} onClick={() => void run(row.state === "rejected" ? "clear" : "reject", row.state === "rejected" ? {} : { note })} > {row.state === "rejected" ? "Rejected" : "Reject"} diff --git a/umtool/components/projects/NarrationPage.tsx b/umtool/components/projects/NarrationPage.tsx @@ -27,7 +27,7 @@ export default async function NarrationPage({ project }: { project: ProjectRef } kind="narration" top={ <BenchTop - trail={[{ href: projectsHref(), label: "projects" }]} + trail={[{ href: projectsHref(), label: "Projects" }]} back={{ href: media, label: project.id }} kind="Narration" here="narration" diff --git a/umtool/components/projects/NarrationReview.tsx b/umtool/components/projects/NarrationReview.tsx @@ -371,7 +371,7 @@ function NarrationCard({ aria-pressed={r.state === "rejected"} disabled={!ready || busy || dirty} title="reject these words; the note says what is wrong" - className={buttonVariants({ variant: r.state === "rejected" ? "destructive" : "outline", size: "sm" })} + className={buttonVariants({ variant: r.state === "rejected" ? "pressed" : "outline", size: "sm" })} onClick={() => void run(() => act(r.id, r.state === "rejected" ? "clear" : "reject", r.state === "rejected" ? {} : { note }))} > {r.state === "rejected" ? "Rejected" : "Reject"} diff --git a/umtool/components/projects/OnscreenSection.tsx b/umtool/components/projects/OnscreenSection.tsx @@ -1347,7 +1347,7 @@ export default function OnscreenSection({ disabled={!!busy || dirtyIds.length === 0} onClick={() => void saveRows()} > - {dirtyIds.length ? `save ${dirtyIds.length} change${dirtyIds.length === 1 ? "" : "s"}` : "saved"} + {dirtyIds.length ? `Save ${dirtyIds.length} change${dirtyIds.length === 1 ? "" : "s"}` : "Saved"} </button> {dirtyIds.length > 0 && ( <button @@ -1526,7 +1526,7 @@ export default function OnscreenSection({ disabled={!!busy || dirtyPostIds.length === 0} onClick={() => void savePosts()} > - {dirtyPostIds.length ? `save ${dirtyPostIds.length} post${dirtyPostIds.length === 1 ? "" : "s"}` : "saved"} + {dirtyPostIds.length ? `Save ${dirtyPostIds.length} post${dirtyPostIds.length === 1 ? "" : "s"}` : "Saved"} </button> {dirtyPostIds.length > 0 && ( <button @@ -1879,7 +1879,7 @@ export default function OnscreenSection({ {current?.id ?? "—"} </span> {schedule.estimated ? ( - <span className={badgeVariants({ variant: "open", size: "sm" })} data-testid="onscreen-estimated"> + <span className={badgeVariants({ variant: "state", size: "sm" })} data-testid="onscreen-estimated"> estimated timing </span> ) : ( @@ -1987,10 +1987,10 @@ export default function OnscreenSection({ <button type="button" data-testid="onscreen-rerender-cancel" - className={buttonVariants({ variant: "destructive", size: "sm" })} + className={buttonVariants({ variant: "outline", size: "sm" })} onClick={() => void fetch(`/api/report/build?cancel=${job.id}`, { method: "POST" })} > - cancel + Cancel </button> )} </div> diff --git a/umtool/components/projects/ReportBuildChain.tsx b/umtool/components/projects/ReportBuildChain.tsx @@ -182,7 +182,7 @@ export default function ReportBuildChain({ if (j) setDry(j.steps as StepView[]); }} > - show the command + Show the command </button> <button type="button" @@ -199,16 +199,16 @@ export default function ReportBuildChain({ } }} > - run + Build </button> {job?.state === "running" && ( <button type="button" data-action="cancel" - className={buttonVariants({ variant: "destructive", size: "sm" })} + className={buttonVariants({ variant: "outline", size: "sm" })} onClick={() => void fetch(`/api/report/build?cancel=${job.id}`, { method: "POST" })} > - cancel + Cancel build </button> )} </div> @@ -296,7 +296,7 @@ export default function ReportBuildChain({ <button type="button" data-action="replace" - className={buttonVariants({ variant: "destructive", size: "sm" })} + className={buttonVariants({ variant: "outline", size: "sm" })} onClick={async () => { const j = await post("?replace=1"); if (j?.job) { @@ -307,7 +307,7 @@ export default function ReportBuildChain({ } }} > - stamp it aside and build + Stamp it aside and build </button> </> )} diff --git a/umtool/components/projects/ReportProject.tsx b/umtool/components/projects/ReportProject.tsx @@ -38,7 +38,7 @@ export default async function ReportProject({ if (!detail) { return ( <div className="flex h-full flex-col"> - <AppShell active="projects" crumbs={[{ href: "/projects", label: "projects" }, { label: project.id }]} /> + <AppShell active="projects" crumbs={[{ href: "/projects", label: "Projects" }, { label: project.id }]} /> <main className="deck-main flex-1 p-4"> <p className="text-[12px] text-[var(--color-bad)]"> <code className="font-mono">video.manifest.json</code> could not be parsed. @@ -58,7 +58,7 @@ export default async function ReportProject({ return ( <div className="flex h-full flex-col"> <PieceFrame - crumbs={[{ href: projectsHref(), label: "projects" }, { label: project.id }, { label: typeof m.title === "string" && m.title ? m.title : project.id }]} + crumbs={[{ href: projectsHref(), label: "Projects" }, { label: project.id }, { label: typeof m.title === "string" && m.title ? m.title : project.id }]} frame={frame} tab={tab} tabs={PIECE_TABS.map((t) => ({ ...t, href: projectHref(project.id, { tab: t.id }) }))} diff --git a/umtool/components/projects/ReviewPage.tsx b/umtool/components/projects/ReviewPage.tsx @@ -61,7 +61,7 @@ export default async function ReviewPage({ project }: { project: ProjectRef }) { kind="review" top={ <BenchTop - trail={[{ href: projectsHref(), label: "projects" }]} + trail={[{ href: projectsHref(), label: "Projects" }]} back={{ href: back, label: project.id }} kind="Drafts review" here="review" diff --git a/umtool/components/projects/SnapshotButton.tsx b/umtool/components/projects/SnapshotButton.tsx @@ -46,7 +46,7 @@ export default function SnapshotButton({ project }: { project: string }) { } }} > - snapshot + Take snapshot </button> {error && <span className="text-[11px] text-[var(--color-bad)]">{error}</span>} </span> diff --git a/umtool/components/projects/StructureEditors.tsx b/umtool/components/projects/StructureEditors.tsx @@ -247,7 +247,7 @@ function PostRow({ post, fresh = false, busy, save, remove }: { post: Post; fres {fresh ? "Add post" : "Save post"} </button> {remove && ( - <button type="button" data-testid="post-remove" disabled={busy} onClick={remove} className={buttonVariants({ variant: "destructive", size: "sm" })}> + <button type="button" data-testid="post-remove" disabled={busy} onClick={remove} className={buttonVariants({ variant: "outline", size: "sm" })}> Remove </button> )} diff --git a/umtool/components/projects/SweepProject.tsx b/umtool/components/projects/SweepProject.tsx @@ -25,7 +25,7 @@ export default async function SweepProject({ project }: { project: ProjectRef }) return ( <div className="flex h-full flex-col"> <AppShell active="projects" - crumbs={[{ href: "/projects", label: "projects" }, { label: project.id }]} + crumbs={[{ href: "/projects", label: "Projects" }, { label: project.id }]} note={`${citations} citation${citations === 1 ? "" : "s"} · no manifest`} /> <main className="deck-main flex-1 space-y-4 p-4"> diff --git a/umtool/components/projects/TagCitedButton.tsx b/umtool/components/projects/TagCitedButton.tsx @@ -171,8 +171,8 @@ export default function TagCitedButton({ project }: { project: string }) { onClick={() => void run()} > {busy - ? "asking the editor…" - : `${op === "add" ? "tag" : "untag"} ${scopeVideos} video${scopeVideos === 1 ? "" : "s"}`} + ? "Asking the editor…" + : `${op === "add" ? "Tag" : "Untag"} ${scopeVideos} video${scopeVideos === 1 ? "" : "s"}`} </button> </> )} diff --git a/umtool/components/projects/TakesBench.tsx b/umtool/components/projects/TakesBench.tsx @@ -63,7 +63,7 @@ const TONES = { off: "border-[var(--color-line)] text-[var(--color-dim)] hover:border-[var(--color-bad)] hover:text-[var(--color-bad)]", }, sel: { - on: "border-[var(--color-sel)] bg-[color-mix(in_srgb,var(--color-sel)_18%,transparent)] text-[var(--color-sel)]", + on: "border-muted bg-panel-2 text-text", off: "border-[var(--color-line)] text-[var(--color-dim)] hover:border-[var(--color-sel)] hover:text-[var(--color-sel)]", }, } as const; @@ -388,7 +388,7 @@ function TakeCard({ className={`ml-auto rounded border px-2 py-0.5 text-[11px] ${tone("sel", listening)}`} onClick={onListen} > - {listening ? "listening" : "listen"} + {listening ? "Listening" : "Listen"} </button> </div> {t.summary && <p className="text-[12px] text-[var(--color-text)]">{t.summary}</p>} diff --git a/umtool/components/projects/TakesPage.tsx b/umtool/components/projects/TakesPage.tsx @@ -1,6 +1,6 @@ import Link from "next/link"; import { BenchBody, BenchFrame, BenchTop } from "./bench/BenchShell"; -import { browseHref } from "@/lib/hrefs"; +import { projectsHref } from "@/lib/hrefs"; import { listTakes, readVerdicts } from "@/lib/report/takes.mjs"; import { pieceHrefOfProject } from "@/lib/pieces/article"; import type { ProjectRef } from "@/lib/project-types"; @@ -38,7 +38,7 @@ export default async function TakesPage({ project }: { project: ProjectRef }) { kind="takes" top={ <BenchTop - trail={[{ href: browseHref(), label: "projects" }]} + trail={[{ href: projectsHref(), label: "Projects" }]} back={{ href: back, label: project.id }} kind="Takes" here="takes" diff --git a/umtool/components/projects/drafts.tsx b/umtool/components/projects/drafts.tsx @@ -162,7 +162,7 @@ export function DraftBadge({ address, view, act, compact = false }: { address: s aria-pressed={row.state === "rejected"} disabled={!ready || busy} title="reject this draft; the note says what is wrong" - className={buttonVariants({ variant: row.state === "rejected" ? "destructive" : "outline", size: "sm" })} + className={buttonVariants({ variant: row.state === "rejected" ? "pressed" : "outline", size: "sm" })} onClick={() => void run(row.state === "rejected" ? "clear" : "reject", row.state === "rejected" ? {} : { note })} > {row.state === "rejected" ? "Rejected" : "Reject"} diff --git a/umtool/components/projects/report/CutTab.tsx b/umtool/components/projects/report/CutTab.tsx @@ -203,7 +203,7 @@ export default async function CutTab({ project, detail, search, tabHref }: Repor {e.fetched ? ( <Pill>cached</Pill> ) : ( - <Pill tone="open"> + <Pill tone={TONE.open}> not fetched yet </Pill> )} @@ -211,10 +211,10 @@ export default async function CutTab({ project, detail, search, tabHref }: Repor {!e.hasCues && ( <Pill tone={TONE.blocking}>no cues</Pill> )} - {midSentence && <Pill tone="open">ends mid-sentence</Pill>} + {midSentence && <Pill tone={TONE.open}>ends mid-sentence</Pill>} {e.noPunctuation && <Pill>source unpunctuated</Pill>} {e.proposed && ( - <Pill tone="open"> + <Pill tone={TONE.open}> widener would move it </Pill> )} @@ -251,12 +251,12 @@ export default async function CutTab({ project, detail, search, tabHref }: Repor </p> )} {midSentence && e.endCueText && ( - <p className="num mt-1 text-[11px] text-[var(--color-dirty)]"> + <p className="num mt-1 text-[11px] text-text-2"> cut lands inside: “…{String(e.endCueText).trim().slice(-64)}” </p> )} {e.proposed && ( - <p className="num mt-1 text-[11px] text-[var(--color-dirty)]"> + <p className="num mt-1 text-[11px] text-text-2"> resolve-windows would make it {hms(e.proposed.start)}–{hms(e.proposed.end)} — set <code className="font-mono">lock</code> if this window is deliberate </p> diff --git a/umtool/components/projects/report/SourcesTab.tsx b/umtool/components/projects/report/SourcesTab.tsx @@ -1,5 +1,5 @@ import Link from "next/link"; -import CheckSourcesButton from "@/components/dashboard/CheckSourcesButton"; +import CheckSourcesButton from "@/components/system/CheckSourcesButton"; import { sourcesOf } from "@/lib/projects/report.mjs"; import { clipBenchHref } from "@/lib/hrefs"; import TagCitedButton from "../TagCitedButton"; diff --git a/umtool/components/projects/song/OverviewTab.tsx b/umtool/components/projects/song/OverviewTab.tsx @@ -3,7 +3,7 @@ import { Suspense } from "react"; import CopyButton from "@/components/CopyButton"; import NextCard, { NextCardShell } from "@/components/piece/NextCard"; import { ProjectDecisions } from "@/components/projects/report/OverviewTab"; -import { PILE_WHAT } from "@/components/dashboard/ToolList"; +import { PILE_WHAT } from "@/components/tools/ToolList"; import { CUT_NAMES, type Song } from "@/lib/browse"; import { decisionsForProject } from "@/lib/projects"; import { fmtBytes } from "@/lib/format"; @@ -97,7 +97,7 @@ export default async function OverviewTab({ <h2 className="micro">This song</h2> <span className="ml-auto" data-song-copy=""> <CopyButton - label="copy this song" + label="Copy this song" title="this song as markdown — spec, cuts, verdicts, notes and resolved marks" url={`/api/browse/context?song=${encodeURIComponent(song.id)}`} /> diff --git a/umtool/components/projects/song/SongFrame.tsx b/umtool/components/projects/song/SongFrame.tsx @@ -70,7 +70,7 @@ export default function SongFrame({ }) { const title = frame.piece?.title ?? song.title; const crumbs: Crumb[] = [ - { href: projectsHref(), label: "projects" }, + { href: projectsHref(), label: "Projects" }, { label: project.id, ...(idHref ? { href: idHref } : {}) }, { label: title }, ]; diff --git a/umtool/components/research/BoardView.tsx b/umtool/components/research/BoardView.tsx @@ -495,7 +495,7 @@ export default function BoardView({ initial }: { initial: CaseView }) { return ( <> <AppHeader - crumbs={[{ href: researchHref(), label: "research" }, { label: doc.title }]} + crumbs={[{ href: researchHref(), label: "Research" }, { label: doc.title }]} meta={ <> <span className="micro mr-2">Research · case</span> @@ -723,7 +723,7 @@ export default function BoardView({ initial }: { initial: CaseView }) { type="submit" data-confirm="" disabled={ask?.kind !== "remove-quote" && ask?.kind !== "remove-section" && !askText.trim()} - className={buttonVariants({ variant: ask?.kind === "remove-quote" || ask?.kind === "remove-section" ? "destructive" : "go" })} + className={buttonVariants({ variant: ask?.kind === "remove-quote" || ask?.kind === "remove-section" ? "outline" : "go" })} > {ask?.kind === "add-section" ? "Add section" : ask?.kind === "remove-quote" ? "Remove quote" : ask?.kind === "remove-section" ? "Remove section" : "Rename"} </button> diff --git a/umtool/components/research/QuoteSlip.tsx b/umtool/components/research/QuoteSlip.tsx @@ -244,7 +244,7 @@ export default function QuoteSlip({ <button type="button" disabled={busy} className={buttonVariants({ variant: "quiet", size: "sm" })} onClick={() => onPatch({ speakerChecked: !q.speakerChecked })}> {q.speakerChecked ? "Mark speaker not checked" : "Mark speaker checked"} </button> - <button type="button" disabled={busy} className={buttonVariants({ variant: "destructive", size: "sm" })} onClick={onRemove}> + <button type="button" disabled={busy} className={buttonVariants({ variant: "outline", size: "sm" })} onClick={onRemove}> Remove </button> </div> diff --git a/umtool/components/research/RunView.tsx b/umtool/components/research/RunView.tsx @@ -416,8 +416,8 @@ export default function RunView({ initial }: { initial: View }) { <> <AppHeader crumbs={[ - { href: researchHref(), label: "research" }, - { href: runsHref(), label: "runs" }, + { href: researchHref(), label: "Research" }, + { href: runsHref(), label: "Runs" }, { href: articleHref({ site: ARTICLES_KEY, id: view.article }, { tab: "iterations" }), label: `${view.article} · ${view.label}` }, { label: h.question ?? h.title ?? `${view.article} ${view.label}` }, ]} @@ -500,7 +500,7 @@ export default function RunView({ initial }: { initial: View }) { )} <span> <span className="mr-2 text-seam-2">·</span> - <span className={view.status === "failed" ? "text-reject-text" : view.status === "done" ? "text-text-2" : "text-signal-text"} data-run-status={view.status}> + <span className={view.status === "failed" ? "text-reject-text" : view.status === "done" ? "text-text-2" : "text-text"} data-run-status={view.status}> {view.status} </span> </span> diff --git a/umtool/components/dashboard/SlashFocus.tsx b/umtool/components/shell/SlashFocus.tsx diff --git a/umtool/components/system/ActionPlan.tsx b/umtool/components/system/ActionPlan.tsx @@ -50,7 +50,6 @@ export default function ActionPlan({ subject, endpoint, body, - variant = "outline", }: { /** The trigger's words ("Move out", "Prune"). */ label: string; @@ -58,7 +57,6 @@ export default function ActionPlan({ subject: string; endpoint: string; body: Record<string, unknown>; - variant?: "outline" | "destructive"; }) { const router = useRouter(); const hydrated = useHydrated(); @@ -107,7 +105,7 @@ export default function ActionPlan({ if (phase.at === "closed") { return ( <span className="inline-flex flex-wrap items-center gap-2"> - <Button ref={trigger} size="sm" variant={variant} disabled={!hydrated} onClick={() => void ask()} data-plan-trigger={subject}> + <Button ref={trigger} size="sm" variant="outline" disabled={!hydrated} onClick={() => void ask()} data-plan-trigger={subject}> {label} </Button> {phase.done && ( @@ -184,7 +182,7 @@ export default function ActionPlan({ <Button ref={first} size="sm" - variant={variant === "destructive" ? "destructive" : "primary"} + variant="outline" disabled={phase.at === "working"} onClick={() => void confirm(plan)} data-plan-confirm="" diff --git a/umtool/components/dashboard/CheckSourcesButton.tsx b/umtool/components/system/CheckSourcesButton.tsx diff --git a/umtool/components/system/Maintenance.tsx b/umtool/components/system/Maintenance.tsx @@ -68,7 +68,7 @@ export function IndexPanel({ index }: { index: { ok: boolean; records: number; p {index.path && <p className="m-0 mt-1 truncate font-mono text-[11px] text-muted-2">{index.path}</p>} <div className="mt-2.5 flex flex-wrap items-start gap-2"> <ActionPlan label="Rebuild…" subject="index rebuild" endpoint="/api/system/index" body={{ action: "rebuild" }} /> - <ActionPlan label="Prune…" subject="index prune" endpoint="/api/system/index" body={{ action: "prune" }} variant="destructive" /> + <ActionPlan label="Prune…" subject="index prune" endpoint="/api/system/index" body={{ action: "prune" }} /> </div> </Panel> ); diff --git a/umtool/components/system/Status.tsx b/umtool/components/system/Status.tsx @@ -1,8 +1,8 @@ import Link from "next/link"; -import CheckSourcesButton from "@/components/dashboard/CheckSourcesButton"; +import CheckSourcesButton from "@/components/system/CheckSourcesButton"; import { Panel } from "@/components/ui/panel"; import type { ActivityItem } from "@/lib/activity"; -import { SOURCES_STALE_DAYS, type StateRow } from "@/lib/dashboard"; +import { SOURCES_STALE_DAYS, type StateRow } from "@/lib/system/status"; import { fmtAgo, fmtBytes } from "@/lib/format"; import { projectHref, projectsHref } from "@/lib/hrefs"; import type { ProjectSummary } from "@/lib/project-types"; diff --git a/umtool/components/system/ToolsPanel.tsx b/umtool/components/system/ToolsPanel.tsx @@ -4,7 +4,7 @@ import { useState } from "react"; import { buttonVariants } from "@/components/ui/button"; import { Panel } from "@/components/ui/panel"; import type { DoctorReport } from "@/lib/tool-types"; -import { fmtGB } from "@/lib/dashboard"; +import { fmtGB } from "@/lib/system/status"; import { fmtAgo } from "@/lib/format"; // Settings · system: the tools and the free disk. The tool list is the CACHE diff --git a/umtool/components/dashboard/ToolList.tsx b/umtool/components/tools/ToolList.tsx diff --git a/umtool/components/ui/button.tsx b/umtool/components/ui/button.tsx @@ -10,11 +10,12 @@ import { cn } from "@/lib/utils"; // operator came here to do. Never two on a screen. // - `outline` the default: every other action is an outline in ink. // - `quiet` no border; secondary moves like Park, prev / next. -// and three kept from before, restyled onto the roles: -// - `primary` an outline in Signal: an action that is interaction-led -// but not THE action (there are screens with several). -// - `destructive` an outline in the reject word; deletes are plan-then-confirm. -// - `ghost` an alias of `quiet`, for the call sites that already say it. +// and two more: +// - `pressed` a toggle that is on (aria-pressed): the panel ground, not a +// colour -- a state of a control is neither Signal nor a verdict. +// - `ghost` an alias of `quiet`, for the call sites that already say it. +// There is no Signal outline and no red button (P6b): a delete is guarded by +// its plan and its confirm, both outlines, never by a verdict colour. // // Hit sizes are the ones this app already uses. It is a bench somebody sits // with for hours, so nothing here is smaller than what the existing controls @@ -31,10 +32,7 @@ export const buttonVariants = cva( variant: { go: "border-signal bg-signal font-semibold text-on-signal hover:bg-[color-mix(in_srgb,var(--signal)_86%,var(--text))]", outline: "border-seam-2 text-text hover:border-muted hover:bg-panel-2", - primary: - "border-signal text-signal-text hover:bg-[color-mix(in_srgb,var(--signal)_14%,transparent)]", - destructive: - "border-reject-text text-reject-text hover:bg-[color-mix(in_srgb,var(--reject)_14%,transparent)]", + pressed: "border-muted bg-panel-2 text-text", quiet: "border-transparent text-muted-2 hover:text-text hover:bg-panel-2", ghost: "border-transparent text-muted-2 hover:text-text hover:bg-panel-2", }, diff --git a/umtool/components/ui/job-progress.tsx b/umtool/components/ui/job-progress.tsx @@ -152,7 +152,7 @@ export function JobProgress({ </span> )} {onCancel && live && ( - <Button size="sm" variant="destructive" className="ml-auto" aria-label={cancelName} onClick={onCancel}> + <Button size="sm" variant="outline" className="ml-auto" aria-label={cancelName} onClick={onCancel}> {cancelLabel} </Button> )} diff --git a/umtool/docs/README.md b/umtool/docs/README.md @@ -9,11 +9,14 @@ anywhere), Pinned, the **Running** list with today's API spend, and the theme (* |---|---|---| | Inbox | `/` (`?hidden=1`, `?muted=1`) | [inbox.md](inbox.md) | | Research | `/research`, `/research/<case>`, `/research/runs`, `/research/runs/<article>/<n>`, `/research/archive` | [research.md](research.md) | -| Work | `/work`, `/projects`, `/sites/<site>` | [work.md](work.md) | -| A piece | `/articles/<id>`, `/sites/<site>/<report>`, `/projects/<path>`, `/series/<id>` | [piece.md](piece.md) | +| Work | `/work`, `/projects` (the projects grid) | [work.md](work.md) | +| A site | `/sites/<site>` (`?ws=&rel=`) | [work.md](work.md) | +| A piece | `/articles/<id>`, `/sites/<site>/<report>`, `/projects/<path>` (`?tab=`); an article's `/evidence` and `/compare` | [piece.md](piece.md) | +| A series or watch | `/series/<id>`, a triage run `/series/<id>/triage/<k>` | [recurring.md](recurring.md), [triage.md](triage.md) | +| The benches | `/projects/<path>/clip/<id>`, `…/claim/<id>`, `…/narration`, `…/takes`, `…/review`; a song's cut `/projects/<path>/<cut>` | [piece.md](piece.md#the-benches) | +| Create | `/create` (`?make=`, `?from=`, `?case=`, `?article=`) | below | | Tools | `/tools`, `/tools/{find,mix,faces,sources,bench}`, `/tools/song[/<mode>]`, `/tools/trim/<set>` | [tools.md](tools.md) | | Settings | `/settings`, `/settings/generation`, `/settings/system` | [settings.md](settings.md) | -| Create | `/create` (`?make=`, `?from=`, `?case=`, `?article=`) | below | **Create** is one list, "What are you making?" — j/k move the lit line, Enter opens its form, Escape closes it; the open form is the address (`?make=`): @@ -35,7 +38,8 @@ prefilled. ## Old addresses -`umtool/redirects.mjs` is the one table (307 today; P6b makes them 308). The query string is kept. +`umtool/redirects.mjs` is the one table. Every row is permanent (308) since P6b, and a browser caches a 308 forever, +so a row is never repointed or removed. The query string is kept. | Old | Now | |---|---| diff --git a/umtool/docs/recurring.md b/umtool/docs/recurring.md @@ -48,7 +48,7 @@ Tick now, and Edit cadence and Delete schedule in its **⋯** menu. An edition's ## Where it shows -- **Work**: the **Recurring** facet (`/work?recurring=1`), the Series kind, the chip under a row's id. An edition is +- **Work**: the **Recurring** facet (`/work?recurring=1`), the Series and Watch kinds, the chip under a row's id. An edition is not a Work row; its series is. - **Inbox**: `tick-failed` (Your call, **Tick now**), `tick-held` (Your call, **Raise cap** → `/settings/generation`, "up to $x a tick"), `edition-ready` (Review, **Review edition** → the edition's iterations). An edition raises no diff --git a/umtool/docs/tools.md b/umtool/docs/tools.md @@ -10,8 +10,8 @@ a tool the rail opens Tools into its tools: find · mix · **song ▸** (the fou | Song piles | `/tools/song`, `/tools/song/<mode>` | the clip-judging deck, one pile at a time: `sort` (candidate clips never judged), `salvage` (clips parked as unclean, offered again), `verify` (accepted clips the risk check flagged, riskiest first), `keeps` (clips kept on purpose for a stray word, to side). `?limit=`, `?only=<ids>` | | Find | `/tools/find` | every occurrence of a word across the song corpus: a GET form (`?q=`, `?page=`, `?list=<shortlist>`), filters as links, so a view is one pasteable URL | | Mix | `/tools/mix` | the mix bench: set the handover and the end point, hear it, render it. A clip deep-links in with `?body=&start=&end=&from=&clip=` ([mix-from-a-project.md](mix-from-a-project.md)) | -| Faces | `/tools/faces` | every cover corner on record, deduped by episode and moment, the ones that ship first: judge the crop (`face-verdicts.json`, which `make-thumb.mjs` reads). `?cover=` / `?key=` open one | -| Sources | `/tools/sources` | where the song palette comes from: placements and clips per episode, the top episode, the top five, how many cover half | +| Faces | `/tools/faces` | every cover corner on record, deduped by episode and moment, the ones that ship first: judge the crop (`face-verdicts.json`, which `make-thumb.mjs` reads; the page never touches the thumb manifests). The dashed box is what `facecrop.py` would cut, the solid one yours. `?cover=` / `?key=` open one | +| Sources | `/tools/sources` | where the song palette comes from: placements (the finished runtime an episode supplies) and clips (the palette) per episode — different units, both shown, never summed — the top episode, the top five, how many cover half | | Trim | `/tools/trim/<set>` | a hook set's trims against the waveform, then **run the chain** (apply-hook-trims → pick-take → mix-hooks) | | Verdict bench | `/tools/bench` | could a model propose a fact-check verdict well enough to review: runs of `archilyzer reports bench-verdicts`, each model's agreement and recalls against the bar (**passes the bar** / **fails the bar**), confusion matrices, the items; the bar is set here (`settings.generation.verdicts`) | diff --git a/umtool/docs/triage.md b/umtool/docs/triage.md @@ -35,10 +35,12 @@ The default threshold is one strong flag, or three flags of any strength. with its line on the reader surface and the judge's reason, each dismissal with why, what escalated. Keys: `j`/`k` move, `y` right, `x` wrong, `u` unmark, `b` open the flags as a board. +- **Work** — a watch is its own kind, **Watch** (`/work?kind=watch`); its + found articles are its own, not Work rows. - **The run page** of an escalated sweep (`/research/runs/<article>/<n>`) — its first step is **triage first**, linking the run. - **The Inbox** — a watch that escalated is a **Worth researching** card (Your - call). Its action opens the board: an R2 case of the flags, each quote **by + call; the decision kind `worth-researching`, [inbox.md](inbox.md)). Its action opens the board: an R2 case of the flags, each quote **by triage**, whose hand-offs make an article or a video. The card goes once the board has a hand-off or every flag of the run is marked. diff --git a/umtool/docs/work.md b/umtool/docs/work.md @@ -2,7 +2,8 @@ ## `/work` — every piece -One lit list: every article (with the video projects it claims), every project no article claims, every series. An +One lit list: every article (with the video projects it claims), every project no article claims, every series and every +watch. An edition of a series is not a row; its series is. A row: the title and id (and a schedule's chip), the stage on a step bar, the kind ("article + report video" …), the lifecycle ("· looks done" when it does), open calls in Meter, and on the lit line **Park** / **Mark done** (or **Reactivate**). **+ Create** in the head. @@ -13,10 +14,10 @@ piece** (a GET search, `q`). | Facet | Key | Values | |---|---|---| | Stage | `stage` | `research`, `article`, `video`, `deliver` — the one stage rule ([piece.md](piece.md#the-stepper)); a song files Spec → article, Cuts → video, Done → deliver | -| Kind | `kind` | `article`, `series`, a project kind id (`report-video`, `song`, `sweep-report`); a project kind also finds the article whose video it is | +| Kind | `kind` | `article`, `series`, `watch` (a watch is stored like a series but is its own kind), a project kind id (`report-video`, `song`, `sweep-report`); a project kind also finds the article whose video it is | | Lifecycle | `life` | `active` (the default), `parked`, `done`, `all` | | Site | `site` | a site id (`articles` = the store); **site page →** opens `/sites/<site>` | -| Recurring | `recurring=1` | series and living reports | +| Recurring | `recurring=1` | series, watches and living reports | | View | `by=site`, `sort=name` | **By site** groups by site; **By name** sorts | | Also | `template`, `state`, `open`, `status`, `notes`, `audience` | the old lists' keys; each shows as a chip that takes itself off | diff --git a/umtool/e2e/article-notes.spec.ts b/umtool/e2e/article-notes.spec.ts @@ -148,7 +148,7 @@ test("section, whole-article and citation notes; resolve, reopen, reply, filters await expect(reopened).toHaveAttribute("data-status", "open"); await reopened.getByRole("button", { name: "reply" }).click(); await page.getByLabel("note text").fill("A reply."); - await reopened.getByRole("button", { name: "reply", exact: true }).click(); + await reopened.getByRole("button", { name: "Reply", exact: true }).click(); await expect(reopened.locator("[data-reply='operator']")).toContainText("A reply."); }); diff --git a/umtool/e2e/clip-bench.spec.ts b/umtool/e2e/clip-bench.spec.ts @@ -1165,7 +1165,7 @@ test("each side names its own pad, and a side that cannot grow says so", async ( const after = page.locator("[data-fetch-after]"); await expect(after).toBeVisible(); await expect(after).toHaveAttribute("data-fetch-after", "23"); - await expect(after).toContainText("fetch to +23 s"); + await expect(after).toContainText("Fetch to +23 s"); // And there is nothing before 0.00 to fetch: c01 starts at 3 s into a // recording whose cached file already begins at the beginning. diff --git a/umtool/e2e/faces.spec.ts b/umtool/e2e/faces.spec.ts @@ -89,7 +89,7 @@ test("/browse/faces is the face judger, at /tools/faces", async ({ page }) => { const res = await page.goto("/browse/faces"); expect(res?.status()).toBe(200); await expect(page).toHaveURL(/\/tools\/faces$/); - await expect(page.getByRole("navigation", { name: "Breadcrumb" })).toContainText("faces"); + await expect(page.getByRole("navigation", { name: "Breadcrumb" })).toContainText("Faces"); await expect(page.locator("[data-face-deck]")).toBeVisible(); }); diff --git a/umtool/e2e/find.spec.ts b/umtool/e2e/find.spec.ts @@ -66,7 +66,7 @@ test("/browse/find is the phrase console, at /tools/find", async ({ page }) => { const res = await page.goto("/browse/find"); expect(res?.status()).toBe(200); await expect(page).toHaveURL(/\/tools\/find$/); - await expect(page.getByRole("navigation", { name: "Breadcrumb" })).toContainText("find"); + await expect(page.getByRole("navigation", { name: "Breadcrumb" })).toContainText("Find"); await expect(page.locator("#phrase-q")).toBeVisible(); }); diff --git a/umtool/e2e/redirects.spec.ts b/umtool/e2e/redirects.spec.ts @@ -3,9 +3,10 @@ import { REDIRECTS } from "./urls"; // --------------------------------------------------------------------------- // Every old page address (umtool/redirects.mjs, the table next.config.ts -// answers): requested with redirects OFF, each must be a 307 -- never a 308, -// which a browser caches forever, until P6 -- to the row's destination, with -// the query passed through. Then the destination itself must answer. +// answers): requested with redirects OFF, each must be a 308 (permanent since +// P6b; a browser caches it forever, so a row is never repointed) to the row's +// destination, with the query passed through. Then the destination itself must +// answer. // // The rows are read from the table, not copied here, so a new row is covered // the day it is added. Parameters get a sample value; `:path*` gets two @@ -45,7 +46,7 @@ test("the table has the P3, P5 and P6 rows, reserved /browse tools before the ca expect(sources.indexOf(s), s).toBeGreaterThanOrEqual(0); expect(sources.indexOf(s), `${s} must come before the catch-all`).toBeLessThan(catchAll); } - for (const r of REDIRECTS) expect(r.permanent, r.source).toBe(false); + for (const r of REDIRECTS) expect(r.permanent, r.source).toBe(true); // P5: the editor's hand-off, only when the query has `from`; the new-article form. expect(REDIRECTS.find((r) => r.source === "/")).toMatchObject({ destination: "/create", has: [{ type: "query", key: "from" }] }); expect(REDIRECTS.find((r) => r.source === "/articles/new")?.destination).toBe("/create?make=article"); @@ -57,11 +58,11 @@ for (const row of REDIRECTS) { const from = fill(row.source); // A row that matches only when the query HAS a key is asked with it. const needs = (row.has ?? []).filter((h) => h.type === "query").map((h) => `${h.key}=testchan%2Fvid1`); - test(`${row.source}${needs.length ? `?${needs.join("&")}` : ""} → ${row.destination} (307, query kept)`, async ({ request }) => { + test(`${row.source}${needs.length ? `?${needs.join("&")}` : ""} → ${row.destination} (308, query kept)`, async ({ request }) => { for (const query of (["", "q=x+y¬e=n1"] as string[]).map((q) => [...needs, ...(q ? [q] : [])].join("&"))) { const url = query ? `${from}?${query}` : from; const res = await request.get(url, { maxRedirects: 0 }); - expect(res.status(), url).toBe(307); + expect(res.status(), url).toBe(308); expect(parts(res.headers()["location"]), url).toEqual(parts(expected(row.destination, query))); } // And where it lands answers (the escape hatch needs a project to open). @@ -81,7 +82,7 @@ for (const [old, now] of [ ] as const) { test(`${old} lands on ${now}`, async ({ request }) => { const res = await request.get(old, { maxRedirects: 0 }); - expect(res.status()).toBe(307); + expect(res.status()).toBe(308); expect(parts(res.headers()["location"])).toEqual(parts(now)); expect((await request.get(old)).status()).toBe(200); }); diff --git a/umtool/e2e/report-tag-via-editor.spec.ts b/umtool/e2e/report-tag-via-editor.spec.ts @@ -124,7 +124,7 @@ test("a section is its own scope, and the control on the project page uses it", await control.locator("[data-tag-cited-tag]").selectOption("eva-collab"); await control.locator("[data-tag-cited-scope]").selectOption("A"); const button = control.locator('[data-action="tag-cited"]'); - await expect(button).toContainText("tag 1 video"); + await expect(button).toContainText("Tag 1 video"); await button.click(); await expect(control.locator("[data-tag-cited-msg]")).toContainText("tagged"); diff --git a/umtool/e2e/research.spec.ts b/umtool/e2e/research.spec.ts @@ -243,7 +243,7 @@ test("Fetch clip asks the editor exactly as fetch_clip does, then plays the wind test("the archive inventory: channels × years, held vs published, gaps, keys, a table", async ({ page }) => { await page.goto(researchArchiveHref()); - await expect(page.getByRole("navigation", { name: "Breadcrumb" }).locator("h1")).toHaveText("archive"); + await expect(page.getByRole("navigation", { name: "Breadcrumb" }).locator("h1")).toHaveText("Archive"); const heat = page.getByRole("table", { name: "Inventory" }); await expect(heat).toBeVisible(); // No editor answers coverage here (the stub has no such route): read on disk, and said so. diff --git a/umtool/e2e/triage-first.spec.ts b/umtool/e2e/triage-first.spec.ts @@ -251,6 +251,13 @@ test("marks: y and x on the lit flag, kept per watch; the precision and a sugges await expect(page.locator("[data-series-triage] [data-precision]")).toContainText("precision 50% over 2 marked"); await shoot(page, "watch-page"); expect(series("r6-watch").triage).toBeUndefined(); + // Work lists a watch as its own kind (P6b), not under Series. + await page.goto(urls.workHref({ kind: "watch" })); + const watchRow = page.locator("[data-lit-line][data-piece='s:r6-watch']"); + await expect(watchRow).toBeVisible(); + await expect(watchRow).toContainText("watch"); + await page.goto(urls.workHref({ kind: "series" })); + await expect(page.locator("[data-lit-line][data-piece='s:r6-watch']")).toHaveCount(0); // Every flag of the run marked: the card is settled. await page.goto("/"); await expect(page.locator("[data-card='worth-researching'][data-piece='s:r6-watch']")).toHaveCount(0); diff --git a/umtool/e2e/triage.spec.ts b/umtool/e2e/triage.spec.ts @@ -129,25 +129,25 @@ test("the window is unbounded: widening fetches more audio", async ({ page }) => }); test("verdict buttons are two levels, and Esc backs out", async ({ page }) => { - const verdicts = page.getByRole("button", { name: /not an um/ }); + const verdicts = page.getByRole("button", { name: /not an um/i }); await expect(verdicts).toBeVisible(); await verdicts.click(); // Level 2 REPLACES level 1 -- this is what stops the card growing. - await expect(page.getByRole("button", { name: /not an um/ })).toHaveCount(0); + await expect(page.getByRole("button", { name: /not an um/i })).toHaveCount(0); await expect(page.getByRole("button", { name: "← back" })).toBeVisible(); await expect(page.getByRole("button", { name: /a real word, not a filler/ })).toBeVisible(); await page.keyboard.press("Escape"); - await expect(page.getByRole("button", { name: /not an um/ })).toBeVisible(); + await expect(page.getByRole("button", { name: /not an um/i })).toBeVisible(); await expect(page.getByRole("button", { name: "← back" })).toHaveCount(0); }); test("a tall card scrolls instead of hiding under the footer", async ({ page }) => { await page.setViewportSize({ width: 900, height: 380 }); // Open level 2, which is the tallest the card gets. - await page.getByRole("button", { name: /not an um/ }).click(); + await page.getByRole("button", { name: /not an um/i }).click(); const main = page.locator("main.deck-main"); await expect(main).toBeVisible(); diff --git a/umtool/e2e/usage.spec.ts b/umtool/e2e/usage.spec.ts @@ -93,7 +93,7 @@ test("dropping a clip that is in a build asks first, and Esc keeps it", async ({ await page.locator('[data-verdict="0"]').click(); await page.locator("[data-code]").first().click(); - await expect(page.getByRole("button", { name: /drop it anyway/ })).toBeVisible(); + await expect(page.getByRole("button", { name: /drop it anyway/i })).toBeVisible(); await expect(page.getByText(new RegExp(`sounding in ${n} finished builds?`))).toBeVisible(); await expect(page.locator('[data-verdict="0"]')).toBeHidden(); @@ -102,7 +102,7 @@ test("dropping a clip that is in a build asks first, and Esc keeps it", async ({ expect(during.counts.rejected).toBe(before.counts.rejected); await page.keyboard.press("Escape"); - await expect(page.getByRole("button", { name: /drop it anyway/ })).toHaveCount(0); + await expect(page.getByRole("button", { name: /drop it anyway/i })).toHaveCount(0); await expect(page.locator('[data-verdict="0"]')).toBeVisible(); const after = await (await request.get("/api/clips?mode=sort&limit=50")).json(); diff --git a/umtool/e2e/visual-audit.spec.ts b/umtool/e2e/visual-audit.spec.ts @@ -0,0 +1,228 @@ +import { test, expect, type Page } from "@playwright/test"; +import { mkdirSync, writeFileSync } from "node:fs"; +import path from "node:path"; +import * as urls from "./urls"; +import { researchArchiveHref, researchCaseHref, researchHref } from "../lib/research/hrefs"; +import { runHref, runsHref } from "../lib/research/runs-hrefs"; + +// --------------------------------------------------------------------------- +// The audit against the canvas (plans/umtool-redesign.md, P6b): every place and +// tab, at 1366×768, in both themes, holds the colour roles -- +// - Signal is interaction only: focus, the lit line, ONE filled action. No +// action is a Signal OUTLINE (the retired `primary` look, or a hand-rolled +// `border-[var(--color-sel)]`), and no page has two filled actions. +// - A verdict colour is a judgement: no action wears one (a delete is +// guarded by its plan and confirm, not by red). +// - It fits: no horizontal scroll at 1366 wide. +// Read-only: it opens pages and writes nothing. +// +// P6B_SHOTS=<dir> also saves each page at 1366×768 and 1440×900 in both themes, +// and `findings.json` (what each page measured), for the audit's record. +// --------------------------------------------------------------------------- + +const SHOTS = process.env.P6B_SHOTS ?? ""; + +const ARTICLE = { site: "articles", id: "zeta" } as const; +const PROJECT = "reports/report-fixture"; +const SONG = "reports/videos/alpha"; + +const PAGES: [string, string][] = [ + ["inbox", urls.homeHref()], + ["research", researchHref()], + ["research-results", researchHref({ q: "lighthouse budget" })], + ["research-case", researchCaseHref("fixture-board")], + ["research-archive", researchArchiveHref()], + ["research-runs", runsHref()], + ["research-run", runHref("runfix", 1)], + ["work", urls.workHref()], + ["projects", urls.projectsHref()], + ["site", urls.siteHref("priv")], + ["site-report", urls.articleHref({ site: "priv", id: "polemic-alpha" })], + ...["overview", "article", "iterations", "cut", "media", "build", "deliver", "sources", "history"].map( + (tab) => [`article-${tab}`, urls.articleHref(ARTICLE, { tab })] as [string, string], + ), + ["article-evidence", urls.articleEvidenceHref({ site: "articles", id: "delta" })], + ["article-compare", urls.articleCompareHref("zeta", { a: "1", b: "3" })], + ...["overview", "cut", "media", "build", "deliver", "sources", "history"].map( + (tab) => [`project-${tab}`, urls.projectHref(PROJECT, { tab })] as [string, string], + ), + ...["overview", "cuts", "spec", "cover", "notes"].map((tab) => [`song-${tab}`, urls.projectHref(SONG, { tab })] as [string, string]), + ["song-cut", urls.cutHref(SONG, "wide")], + ["bench-clip", urls.clipBenchHref("reports/bench-shell-fixture", "s01")], + ["bench-claim", urls.claimBenchHref("reports/bench-fixture", "k01")], + ["bench-narration", urls.narrationHref("reports/narration-review-fixture")], + ["bench-takes", urls.takesHref("reports/takes-fixture")], + ["bench-review", urls.reviewHref("reports/media-review-fixture")], + ["create", urls.createHref()], + ...(["research", "article", "article-board", "recurring", "video-article", "video-board", "video-recording", "video-report", "song"] as const).map( + (make) => [`create-${make}`, urls.createHref({ make })] as [string, string], + ), + ["tools", urls.toolsHref()], + ["tools-find", urls.findHref()], + ["tools-mix", urls.mixHref()], + ["tools-song", urls.songToolsHref()], + ...["sort", "salvage", "verify", "keeps"].map((m) => [`tools-song-${m}`, urls.pileHref(m)] as [string, string]), + ["tools-faces", urls.facesHref()], + ["tools-trim", urls.trimHref("mk-hooks")], + ["tools-sources", urls.sourcesHref()], + ["tools-bench", urls.benchHref()], + ["settings-generation", urls.generationPolicyHref()], + ["settings-system", urls.systemHref()], +]; + +type Finding = { scroll: number; signalOutlines: string[]; filled: string[]; verdictActions: string[]; lower: string[] }; + +/** What the page shows, measured by computed colour (so a hand-rolled class is caught too). */ +async function measure(page: Page): Promise<Finding> { + return page.evaluate(() => { + const probe = document.createElement("span"); + document.body.appendChild(probe); + const rgb = (v: string) => { + probe.style.color = ""; + probe.style.color = `var(${v})`; + return getComputedStyle(probe).color; + }; + const signal = new Set([rgb("--signal"), rgb("--signal-text")]); + const verdict = new Set(["--kept", "--kept-text", "--doubt", "--doubt-text", "--reject", "--reject-text"].map(rgb)); + probe.remove(); + const name = (el: Element) => `${el.tagName.toLowerCase()} "${(el.textContent ?? "").trim().replace(/\s+/g, " ").slice(0, 40)}"`; + const visible = (el: Element) => { + const r = el.getBoundingClientRect(); + return r.width > 0 && r.height > 0 && getComputedStyle(el).visibility !== "hidden"; + }; + // Actions: buttons and links drawn as buttons (a border). A pressed toggle + // is a state of a control, judged by its ground, not here; the current + // item of a list (aria-current) is its lit line; a verdict button's own + // word is its verdict (the chips that set one). + const actions = [...document.querySelectorAll("main button, main a, main [role=button]")].filter( + (el) => visible(el) && el !== document.activeElement && !(el as HTMLElement).closest("[data-verdict-for], [data-verdict-bar]"), + ); + const signalOutlines: string[] = []; + const filled: string[] = []; + const verdictActions: string[] = []; + // Labels that start in lower case (reported, not asserted: an id, a + // timecode or a variant's tag is a fine label). The key hints are skipped. + const lower: string[] = []; + for (const el of actions) { + if (el.tagName === "BUTTON" || el.getAttribute("role") === "button") { + const clone = el.cloneNode(true) as HTMLElement; + clone.querySelectorAll("kbd").forEach((k) => k.remove()); + const text = (clone.textContent ?? "").trim(); + if (/^[a-z]/.test(text)) lower.push(text.replace(/\s+/g, " ").slice(0, 40)); + } + const cs = getComputedStyle(el); + const bordered = parseFloat(cs.borderTopWidth) > 0 && cs.borderTopStyle !== "none"; + const bg = cs.backgroundColor; + if (signal.has(bg)) filled.push(name(el)); + else if (bordered && signal.has(cs.borderTopColor) && el.getAttribute("aria-pressed") !== "true" && !el.hasAttribute("aria-current")) signalOutlines.push(name(el)); + if (el.getAttribute("aria-pressed") === "true") continue; + // A button in a verdict's colour, or a bordered link (a chip, a facet) in one. + if ((bordered && (verdict.has(cs.borderTopColor) || verdict.has(cs.color))) || (el.tagName === "BUTTON" && verdict.has(cs.color))) verdictActions.push(name(el)); + } + return { scroll: document.documentElement.scrollWidth - document.documentElement.clientWidth, signalOutlines, filled, verdictActions, lower }; + }); +} + +async function shoot(page: Page, name: string) { + for (const theme of ["dark", "light"] as const) { + await page.evaluate((t) => document.documentElement.setAttribute("data-theme", t), theme); + for (const [w, h] of [ + [1366, 768], + [1440, 900], + ] as const) { + await page.setViewportSize({ width: w, height: h }); + await page.waitForTimeout(120); + await page.screenshot({ path: path.join(SHOTS, `${name}-${w}x${h}-${theme}.png`) }); + } + } +} + +const found: Record<string, (Finding & { theme: string })[]> = {}; + +test.describe.configure({ timeout: 90_000 }); + +for (const [name, url] of PAGES) { + test(`${name} (${url}) holds the colour roles and fits 1366×768`, async ({ page }) => { + if (SHOTS) mkdirSync(SHOTS, { recursive: true }); + await page.setViewportSize({ width: 1366, height: 768 }); + const res = await page.goto(url); + expect(res?.status(), url).toBeLessThan(400); + await page.waitForLoadState("networkidle", { timeout: 5_000 }).catch(() => {}); + found[name] = []; + for (const theme of ["dark", "light"] as const) { + await page.evaluate((t) => document.documentElement.setAttribute("data-theme", t), theme); + found[name].push({ theme, ...(await measure(page)) }); + } + if (SHOTS) { + // One file a page: a failed test restarts the worker, so nothing is kept in memory across tests. + mkdirSync(path.join(SHOTS, "findings"), { recursive: true }); + writeFileSync(path.join(SHOTS, "findings", `${name}.json`), JSON.stringify(found[name], null, 2)); + await shoot(page, name); + } + for (const f of found[name]) { + expect(f.scroll, `${name} ${f.theme}: scrolls sideways at 1366`).toBeLessThanOrEqual(0); + expect(f.signalOutlines, `${name} ${f.theme}: a Signal outline on an action`).toEqual([]); + expect(f.verdictActions, `${name} ${f.theme}: a verdict colour on an action`).toEqual([]); + expect(f.filled.length, `${name} ${f.theme}: filled actions ${f.filled.join(", ")}`).toBeLessThanOrEqual(1); + } + }); +} + +// --------------------------------------------------------------------------- +// The keyboard-only pass: Inbox → a piece → its bench → back to the piece → +// the Inbox, never touching the mouse, with a visible focus at every stop. +// --------------------------------------------------------------------------- + +/** "" when the focused element shows a focus ring (an outline or a ring shadow); else what has none. */ +async function focusShown(page: Page): Promise<string> { + return page.evaluate(() => { + const el = document.activeElement as HTMLElement | null; + if (!el || el === document.body) return "nothing focused"; + const cs = getComputedStyle(el); + const ring = cs.outlineStyle !== "none" && parseFloat(cs.outlineWidth) > 0; + return ring || cs.boxShadow !== "none" ? "" : `${el.tagName.toLowerCase()} "${(el.textContent ?? "").trim().slice(0, 30)}" shows no focus`; + }); +} + +/** Tab until the focused element's text starts with `text`, checking the focus ring at every stop. */ +async function tabTo(page: Page, text: RegExp, max = 60) { + for (let i = 0; i < max; i++) { + await page.keyboard.press("Tab"); + expect(await focusShown(page)).toBe(""); + const t = await page.evaluate(() => (document.activeElement?.textContent ?? "").trim()); + if (text.test(t)) return; + } + throw new Error(`no focusable element matching ${text} within ${max} tabs`); +} + +test("keyboard only: Inbox → a piece → its bench → the piece → the Inbox, focus shown at every stop", async ({ page }) => { + test.setTimeout(120_000); + await page.setViewportSize({ width: 1366, height: 768 }); + await page.goto(urls.homeHref()); + await expect(page.locator("dialog[data-jump][data-ready]")).toBeAttached(); + // The Inbox's lit list: j/k move the light and the focus with it. + await page.keyboard.press("j"); + await page.keyboard.press("k"); + expect(await page.evaluate(() => !!document.activeElement?.closest("[data-lit-line]"))).toBe(true); + expect(await focusShown(page)).toBe(""); + // Your call's first card is zeta's failed run: its action opens the piece. + await tabTo(page, /^Retry run$/); + await page.keyboard.press("Enter"); + await expect(page).toHaveURL(/\/articles\/zeta\?tab=iterations$/); + // The piece's keys: 4 is the Cut tab; its walk opens the clip bench. + await page.keyboard.press("4"); + await expect(page).toHaveURL(/tab=cut/); + await tabTo(page, /^Walk the cut/); + await page.keyboard.press("Enter"); + await expect(page).toHaveURL(/\/clip\/a1$/); + // The bench's ← the piece goes back to the article piece. + await tabTo(page, /^← /); + await page.keyboard.press("Enter"); + await expect(page).toHaveURL(/\/articles\/zeta/); + // And ⌘K to the Inbox. + await expect(page.locator("dialog[data-jump][data-ready]")).toBeAttached(); + await page.keyboard.press("Control+k"); + await page.keyboard.type("Inbox"); + await page.keyboard.press("Enter"); + await expect(page).toHaveURL(/\/$/); +}); diff --git a/umtool/lib/dashboard.ts b/umtool/lib/dashboard.ts @@ -1,73 +0,0 @@ -// Pure helpers /settings/system and /projects share. NO `node:` import: the state -// strip is rendered on the server but its labels are also what the e2e suite -// compares against /projects' header, and one helper is how the two pages are -// kept from disagreeing by a plural. -import { PROJECT_STATES, type ProjectState } from "./project-types"; - -/** The header /projects prints and /settings/system's Projects panel repeats. */ -export const projectsNote = (total: number, blocking: number, open: number) => - `${total} projects · ${blocking} blocking · ${open} open`; - -export type StateRow = { - kind: string; - label: string; - total: number; - /** Every state, in PROJECT_STATES order, zero included -- the strip is proportional. */ - segments: { state: ProjectState; n: number; href: string }[]; -}; - -/** One row per kind: how many projects sit in each of the six states. */ -export function stateRows( - kinds: { id: string; label: string }[], - projects: { kind: string; state: ProjectState }[], -): StateRow[] { - return kinds.map((k) => { - const mine = projects.filter((p) => p.kind === k.id); - return { - kind: k.id, - label: k.label, - total: mine.length, - segments: PROJECT_STATES.map((state) => ({ - state, - n: mine.filter((p) => p.state === state).length, - href: `/projects?kind=${encodeURIComponent(k.id)}&state=${state}`, - })), - }; - }); -} - -/** Thirty days: the age past which a recorded availability check is "old". */ -export const SOURCES_STALE_DAYS = 30; - -/** - * The Sources panel's three buckets, from each report project's summary - * attributes (report.mjs writes `sources-checked-at`, `sources-dead`, - * `cue-gaps`). Never checked / checked too long ago / something wrong. - */ -export function sourceBuckets<T extends { id: string; attrs?: Record<string, string> }>( - projects: T[], - now = Date.now(), -): { never: T[]; old: T[]; bad: T[] } { - const never: T[] = []; - const old: T[] = []; - const bad: T[] = []; - for (const p of projects) { - const a = p.attrs ?? {}; - // Only kinds that report sources at all -- a song has no `sources` attr. - if (!("sources" in a)) continue; - if (Number(a.sources) === 0) continue; - const at = Number(a["sources-checked-at"] ?? 0); - if (!at) never.push(p); - else if (now - at > SOURCES_STALE_DAYS * 86_400_000) old.push(p); - if (Number(a["sources-dead"] ?? 0) > 0 || Number(a["sources-missing"] ?? 0) > 0 || Number(a["cue-gaps"] ?? 0) > 0) { - bad.push(p); - } - } - return { never, old, bad }; -} - -export function fmtGB(bytes: number | null): string { - if (bytes == null) return "–"; - const gb = bytes / 1e9; - return gb >= 100 ? `${gb.toFixed(0)} GB` : `${gb.toFixed(1)} GB`; -} diff --git a/umtool/lib/hrefs.test.mjs b/umtool/lib/hrefs.test.mjs @@ -74,7 +74,8 @@ test("every page address the builders make is still served or redirected", async const { REDIRECTS } = await import("../redirects.mjs"); const old = ["/browse", "/browse/decisions", "/browse/find", "/browse/faces", "/browse/sources", "/browse/trim/:set", "/browse/at", "/browse/:path*", "/articles", "/sites", "/mix", "/bench", "/articles/new", "/"]; for (const s of old) assert.ok(REDIRECTS.some((r) => r.source === s), s); - for (const r of REDIRECTS) assert.equal(r.permanent, false, r.source); + // Permanent (308) since P6b. + for (const r of REDIRECTS) assert.equal(r.permanent, true, r.source); }); test("site pages, tools and piles", () => { diff --git a/umtool/lib/system/status.ts b/umtool/lib/system/status.ts @@ -0,0 +1,73 @@ +// Pure helpers /settings/system and /projects share. NO `node:` import: the state +// strip is rendered on the server but its labels are also what the e2e suite +// compares against /projects' header, and one helper is how the two pages are +// kept from disagreeing by a plural. +import { PROJECT_STATES, type ProjectState } from "../project-types"; + +/** The header /projects prints and /settings/system's Projects panel repeats. */ +export const projectsNote = (total: number, blocking: number, open: number) => + `${total} projects · ${blocking} blocking · ${open} open`; + +export type StateRow = { + kind: string; + label: string; + total: number; + /** Every state, in PROJECT_STATES order, zero included -- the strip is proportional. */ + segments: { state: ProjectState; n: number; href: string }[]; +}; + +/** One row per kind: how many projects sit in each of the six states. */ +export function stateRows( + kinds: { id: string; label: string }[], + projects: { kind: string; state: ProjectState }[], +): StateRow[] { + return kinds.map((k) => { + const mine = projects.filter((p) => p.kind === k.id); + return { + kind: k.id, + label: k.label, + total: mine.length, + segments: PROJECT_STATES.map((state) => ({ + state, + n: mine.filter((p) => p.state === state).length, + href: `/projects?kind=${encodeURIComponent(k.id)}&state=${state}`, + })), + }; + }); +} + +/** Thirty days: the age past which a recorded availability check is "old". */ +export const SOURCES_STALE_DAYS = 30; + +/** + * The Sources panel's three buckets, from each report project's summary + * attributes (report.mjs writes `sources-checked-at`, `sources-dead`, + * `cue-gaps`). Never checked / checked too long ago / something wrong. + */ +export function sourceBuckets<T extends { id: string; attrs?: Record<string, string> }>( + projects: T[], + now = Date.now(), +): { never: T[]; old: T[]; bad: T[] } { + const never: T[] = []; + const old: T[] = []; + const bad: T[] = []; + for (const p of projects) { + const a = p.attrs ?? {}; + // Only kinds that report sources at all -- a song has no `sources` attr. + if (!("sources" in a)) continue; + if (Number(a.sources) === 0) continue; + const at = Number(a["sources-checked-at"] ?? 0); + if (!at) never.push(p); + else if (now - at > SOURCES_STALE_DAYS * 86_400_000) old.push(p); + if (Number(a["sources-dead"] ?? 0) > 0 || Number(a["sources-missing"] ?? 0) > 0 || Number(a["cue-gaps"] ?? 0) > 0) { + bad.push(p); + } + } + return { never, old, bad }; +} + +export function fmtGB(bytes: number | null): string { + if (bytes == null) return "–"; + const gb = bytes / 1e9; + return gb >= 100 ? `${gb.toFixed(0)} GB` : `${gb.toFixed(1)} GB`; +} diff --git a/umtool/lib/work.ts b/umtool/lib/work.ts @@ -88,10 +88,13 @@ export async function readWork(): Promise<{ rows: WorkRow[]; lifecycleError?: st const linked = p.projects.map((x) => byId.get(x.id)).filter((x) => x !== undefined); const mine = own ? [own] : linked; const projectKinds = [...new Set(mine.map((x) => x.kind))]; - const kinds = p.kind === "article" ? ["article", ...projectKinds] : p.kind === "series" ? ["series"] : projectKinds; + // A watch (R6) is stored like a series but is its own kind: no editions, + // an article only when its triage escalates. + const recurringKind = p.schedule?.shape === "watch" ? "watch" : "series"; + const kinds = p.kind === "article" ? ["article", ...projectKinds] : p.kind === "series" ? [recurringKind] : projectKinds; const kindLabel = p.kind === "series" - ? "series" + ? recurringKind : p.kind === "article" ? projectKinds.length ? `article + ${projectKinds.map((k) => label.get(k) ?? k).join(", ")}` diff --git a/umtool/redirects.mjs b/umtool/redirects.mjs @@ -14,9 +14,10 @@ // { // source: "/browse/:path*", // path-to-regexp; `:x*` zero or more segments // destination: "/projects/:path*", // matched parameters carry over -// permanent: false, // 307 until P6, then 308 -- a browser -// // caches a 308 forever, so a wrong one -// // cannot be taken back +// permanent: true, // 308 since P6b (307 before). A browser +// // caches a 308 forever, so a row is never +// // repointed or removed: the old address +// // must keep landing where it said // has: [{ type: "query", key: "from" }], // optional: only when the query has `from` // phase: "P3", // ours, not Next's: which phase added it. // // next.config.ts strips it. @@ -39,9 +40,10 @@ * }} RedirectRow */ -const p3 = (source, destination) => ({ source, destination, permanent: false, phase: "P3" }); -const p5 = (source, destination, extra = {}) => ({ source, destination, permanent: false, ...extra, phase: "P5" }); -const p6 = (source, destination) => ({ source, destination, permanent: false, phase: "P6" }); +// Every row is permanent (308) since P6b: the moves are settled. +const p3 = (source, destination) => ({ source, destination, permanent: true, phase: "P3" }); +const p5 = (source, destination, extra = {}) => ({ source, destination, permanent: true, ...extra, phase: "P5" }); +const p6 = (source, destination) => ({ source, destination, permanent: true, phase: "P6" }); /** @type {RedirectRow[]} */ export const REDIRECTS = [