Archilyzer · Source

archilyzer

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

commit fbb44833f49f194c692d96e965a1bf78958616ee
parent 6ea6fa0e370dbb48c304a93b81cca3972242a8cd
Author: I Mean I'm Just Saying <imeanimjustsaying@kiwifarms.st>
Date:   Tue, 10 Nov 2026 14:03:32 -0500

umtool e2e: the review pass, present in the workspace (Esc back, the old /present a 308, a 9:16 cut tall), the readiness bar's five pills, the L7b redirects and what stays; fixtures review-pass-fixture and the readiness copy of needs-you's; knobs.md (the review pass, the four tabs, the readiness bar)

Play's own page always carries a query now, so the specs that waited on a bare /play wait on `?cut=1`; a version's take walk is its review pass.

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

Diffstat:
Mumtool/components/projects/PlayCutPage.tsx | 3++-
Mumtool/docs/knobs.md | 73+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++----------
Mumtool/e2e/draft-versions.spec.ts | 3++-
Mumtool/e2e/fixtures/make-fixture.mjs | 23+++++++++++++++++++++++
Mumtool/e2e/fixtures/needs-you-fixture.mjs | 14+++++++++-----
Mumtool/e2e/intro-play.spec.ts | 7++++---
Mumtool/e2e/post-happy-path.spec.ts | 2+-
Mumtool/e2e/present.spec.ts | 57+++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Aumtool/e2e/readiness.spec.ts | 99+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Mumtool/e2e/redirects.spec.ts | 51+++++++++++++++++++++++++++++++++++++++++++++++++++
Aumtool/e2e/review-pass.spec.ts | 171+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Mumtool/e2e/urls.ts | 15+++++++++++++++
12 files changed, 497 insertions(+), 21 deletions(-)

diff --git a/umtool/components/projects/PlayCutPage.tsx b/umtool/components/projects/PlayCutPage.tsx @@ -62,7 +62,8 @@ export default async function PlayCutPage({ } // Play and the clip bench as ONE app (cutApp/CutApp.tsx): Play stays mounted, the bench opens in place. return ( - <CutApp project={project.id} playTop={top}> + // Play's own address (always with a query since L7b: a bare /play is the workspace's), for "Back to the cut". + <CutApp project={project.id} playTop={top} home={playHref(project.id, { take: take || null })}> <RememberCut project={project.id} title={project.name ?? project.id} /> <NotesProvider target={{ project: project.id }}> <PlayCut diff --git a/umtool/docs/knobs.md b/umtool/docs/knobs.md @@ -717,14 +717,34 @@ expected the cut). A take is a **saved version** — FROZEN: ## The workspace (one screen per report video) `/projects/<p>` — a report video's own address — is **the workspace** (umtool redesign L7a): one screen at 1366×768, -nothing scrolling but the strip and the inspector. The piece page's tabs are `?tab=` (`?tab=overview` written out; -the piece head's ⋯ **More → Open the workspace** comes back), and a claimed project's own address is its workspace too (its tabs still go -to the article's piece). `?block=<id>` opens with that block selected. +nothing scrolling but the strip and the inspector. A claimed project's own address is its workspace too (its tabs +still go to the article's piece). `?block=<id>` opens with that block selected (`&at=<s>` that far into it); +`?mode=review` is [the review pass](#the-review-pass), `?mode=present` [present mode](#present-mode-the-cut-as-slides-navigated-like-a-deck), +either with `&take=<version>` for a saved version, read-only (L7b). Each mode is a history entry: Back returns. + +**The piece's tabs are four since L7b** (`lib/pieces/tabs.mjs` PIECE_TABS): **Workspace** (this screen), **Sources**, +**Deliver**, **History**. What the seven held and where it is now: + +| Was | Now | +|---|---| +| Build (the build chain, the final mp4) | on **Deliver**, above its own panels — `?tab=build` 308s there | +| Media (the drafted fields, the upload's text, the on-screen panel, the review and narration links) | on **Deliver** — `?tab=media` 308s there | +| Overview (the Next card, the piece's decisions and their settles, the stats, the article and its iterations, the README) | still `?tab=overview`, a view out of the tab bar (**Piece ▾ → Overview**, the piece head's ⋯): the workspace does not hold it yet | +| Cut (the timeline as a list and its every tool: fetch windows, candidates, groups, prep, voices, removed clips …) | still `?tab=cut`, **Piece ▾ → The cut as a list**: its tools have no home in the workspace yet | + +An article piece keeps all nine of its tabs (its video's Build and Media are tabs of their own there). + +**The readiness bar**, under the top bar (beside the generated-manifest banner): one pill each — **Quote check**, +**Links**, **Captures**, **Render**, **X jar** — showing **✓** (fine), a **count**, **!** (blocking) or **—** (does not +apply), read from what the Inbox reads for this piece (the reducer's decisions, the piece's calls, X's jar: +`GET /api/report/readiness`, `lib/inbox/readiness.mjs`). A click goes to the fix: the piece's decisions (their +one-press settles), home's Run quote-check, the version to judge, the editor's settings; a clip with no media +fetched selects its block. Read-only; its terminal twins are `umtool check <p>` and `umtool decisions`. | Knob | UI | CLI twin | |---|---|---| -| the draft's line, versions | the top bar: **Draft · from v2 · 3 edits**; **Versions ▾** — each version's **Play** (read-only) and **Open in draft**, and **Save version** | `umtool takes ls <p>` · `takes open <p> <t>` · `takes save <p>` | -| mode | **Edit** · **Review pass** (the walk, until L7b brings it in) · **Present ⛶** | `umtool walk <p>` · `umtool present <p>` | +| the draft's line, versions | the top bar: **Draft · from v2 · 3 edits**; **Versions ▾** — each version's **Review** (its review pass, read-only), **Play** (read-only) and **Open in draft**, and **Save version** | `umtool takes ls <p>` · `takes open <p> <t>` · `takes save <p>` | +| mode | **Edit** · **Review pass** (`?mode=review`) · **Present ⛶** (`?mode=present`) | `umtool review-pass <p>` · `umtool present <p>` | | look | **Look Basic \| Deck** (`render.mode`) | `umtool look <p> mode=basic\|deck` | | render the draft | **Render ▾** — **Render 60 s**, **Render full** (a take of the draft, queued) | `umtool take <p> --at 0 --dur 60` · `umtool take <p> --full` | | share | **Copy share line** for the selected clip (else the one on screen) | `umtool share <p> <clip>` | @@ -755,11 +775,42 @@ to the article's piece). `?block=<id>` opens with that block selected. undo point. A redo renames the point back to `auto-before-<op>`, so the next Undo takes the redone edit back again (`lib/report/manifest.mjs` redoStructural). `undo-saved` and `redone-*` keep their newest 200, as the undo points do. +### The review pass + +`?mode=review` — the top bar's **Review pass** — walks the draft BLOCK BY BLOCK (it replaces the walk as the way +through a cut; the clip bench stays the deep tool for one clip). The inspector's column is the pass; the viewer +plays the block under review and stops where it ends. Every block but the intro (watched, never judged) and a clip +rejected for a cut reason is in it, **"4 / 12 reviewed"**, and it resumes on the first block with no answer. + +| Answer | Key | A clip | A post, a card, a video entry | +|---|---|---|---| +| **Keep** | k | its walk verdict, `confirmed` (the bench's writer) | `keep` in `<p>/review-pass.json` | +| **Fix** — says what needs fixing | f | `incorrect`, that text its correction | `fix`, that text its note | +| **Note** | n | the notes composer, anchored to the block (`notes.json`) | the same | + +Keep and Fix move on to the next block and play it; **← →** step without answering; Space plays and pauses. The +strip marks each answered block (✓ kept, ✎ to fix). Past the last block: the **verdict** — **Like · Maybe · No**, +L4's writer (`takes/verdicts.json`): the draft is saved as a version first when it has edits (a verdict is a +version's; with none, it is its parent's), a version reviewed (`&take=`) is judged as itself. **Done** is back to +Edit. A version's pass is read-only: watched and noted, never marked (Keep and Fix are off; **Open in draft** +changes it). The take walk's old address (`/takes/<t>/walk`) is that version's pass (a 308). + +| | CLI twin | +|---|---| +| each block's answer, where the pass resumes | `umtool review-pass <p> [ls] [--json]` | +| a post's or a card's answer | `umtool review-pass <p> mark <block> keep\|fix\|clear [--note T]` | +| a clip's | `umtool window <p> <clip> --verdict confirmed` · `--verdict incorrect --correction T` | +| a note on a block | `umtool notes <p>` (reading); the app writes it | +| the verdict | `umtool takes save <p>` then `umtool takes verdict <p> <v> like\|maybe\|no` | + ## Play the cut (the whole cut, or a take, with no render) -`/projects/<p>/play` — the head's **▶ Play the draft**, or a version's **Play** on the takes page +`/projects/<p>/play?cut=1` — the head's **▶ Play the draft**, or a version's **Play** on the takes page (`/projects/<p>/play?take=<id>`) — plays the WHOLE cut in this browser in its final look, for iterating without a -render. **With no `take` it plays THE DRAFT** (above), where every edit lands; `?cut=1` is the same. It plays every entry in timeline order, each clip from its cached source window (the bench's media route, an +render. **With no `take` it plays THE DRAFT** (above), where every edit lands. Since L7b a BARE `/play` (no query at +all) is the workspace's — a 308 to `/projects/<p>`, whose viewer plays the draft — so Play's own page is always asked +for with a query (`?cut=1`, `?take=`, `?clip=`, `?note=`; `playHref` writes `?cut=1`), until the workspace holds its +notes column, the reel strip's edits and the assistant. It plays every entry in timeline order, each clip from its cached source window (the bench's media route, an excerpt of a long recording), the live preview's chrome over it on ONE cut clock — the rail's pip, the tally, the stamps, the markers and the finale advance as in the render, and every module that declares **`play`** in the module contract — the chapter cards over the first seconds of the clip each opens, the then-and-now pair strip, the @@ -915,10 +966,12 @@ Then the cut: the Build tab's **final** preset (a full build, about an hour for ## Present mode (the cut as slides, navigated like a deck) -`/projects/<p>/present` — **Present** beside Play in the project's head and on a take's card -(`/projects/<p>/present?take=<id>`; `?cut=1` the manifest alone) — shows the cut one SLIDE at a time, full stage, and +`/projects/<p>?mode=present` — the workspace's **Present ⛶**, **Present** in the project's head and on a take's card +(`&take=<id>`) — shows the cut one SLIDE at a time, full screen over the workspace, and moves like a slide deck (operator, 8 Nov 2026: "present X posts … navigated like a PowerPoint presentation including -settings like toggled censors"). With no `take` it presents the latest take, as Play does. The slides are Play's own +settings like toggled censors"). With no `take` it presents the draft. **Esc** (the settings closed) or **Edit · Esc** +is back to the workspace's Edit. The old `/projects/<p>/present` 308s here, its `take` kept (the slide's `#id` rides +the browser's redirect). A 9:16 cut (`render.format: "vertical"`) presents tall. The slides are Play's own view cut up (`lib/report/present.mjs`, no AI, nothing fetched or rendered): - a **post** slide per post item, drawn by Play's player (the card page the build screenshots, its attachments in their diff --git a/umtool/e2e/draft-versions.spec.ts b/umtool/e2e/draft-versions.spec.ts @@ -102,7 +102,8 @@ test("Play is the draft, named by its parent; a version plays read-only; Open in await expect(ask).toHaveAttribute("data-open-draft-saves", ""); await page.screenshot({ path: test.info().outputPath("open-in-draft.png") }); await ask.locator("[data-open-draft-confirm]").click(); - await expect(page).toHaveURL(/\/projects\/reports\/draft-versions-fixture\/play$/); + // Play of the draft (Play's own page always carries a query since L7b: a bare /play is the workspace's). + await expect(page).toHaveURL(/\/projects\/reports\/draft-versions-fixture\/play\?cut=1$/); await expect(page.locator("[data-play-draft]")).toContainText("Draft · from v1 · no edits", { timeout: 20_000 }); expect(manifestText()).toBe(base("v1")); expect(draftFrom()).toBe("v1"); diff --git a/umtool/e2e/fixtures/make-fixture.mjs b/umtool/e2e/fixtures/make-fixture.mjs @@ -2181,6 +2181,23 @@ makePlayCutFixture({ reports, deckManifest, cachedWindow: path.join(REPORT, "out writeFileSync(wsFile, JSON.stringify(wsM, null, 2) + "\n"); } +// THE REVIEW PASS (review-pass.spec.ts, umtool redesign L7b, WRITES: walk verdicts, review-pass.json, a note, a +// version and its verdict): workspace-fixture's cut -- c01 c02 p-5 k01 c03 c04 -- under its own name. +{ + const { dir: rpDir } = makePlayCutFixture({ + reports, deckManifest, cachedWindow: path.join(REPORT, "out", "clips-raw", "vid1_0.00-9.00.mp4"), + name: "review-pass-fixture", title: "The Review Pass Fixture", video: "vid1", + }); + const rpFile = path.join(rpDir, "video.manifest.json"); + const rpM = JSON.parse(readFileSync(rpFile, "utf8")); + rpM.render.chrome.factcheck.verdicts.CORROBORATED.tallyLabel = "Seized"; + rpM.timeline.splice(2, 0, { + type: "post", id: "p-5", post: "postchan-x/5", platform: "x", author: "Post Subject", handle: "postsubject", + date: "2026-10-30T12:00:00.000Z", text: "The scale said 291 this morning. I said the scale was broken.", url: "https://x.com/postsubject/status/5", subjects: ["postsubject"], + }); + writeFileSync(rpFile, JSON.stringify(rpM, null, 2) + "\n"); +} + // The inspector panels (inspector-*.spec.ts, umtool redesign L6, WRITE): one project per panel // (inspector-fixture.mjs), each with a take the specs check is never written. await makeInspectorFixtures({ reports, channels: CHANNELS, deckManifest, cachedWindow: path.join(REPORT, "out", "clips-raw", "vid1_0.00-9.00.mp4"), makePlayCutFixture }); @@ -2562,6 +2579,12 @@ makeRunTraceFixture({ articles: ARTICLES, source: `local:${RESEARCH_PUBLIC}` }); // WHAT NEEDS YOU (needs-you.spec.ts, redesign L4): a cut with a rendered version to judge, clips to walk and quote // checks out of date; a Rumble QR naming its folder (Use embed ids); a live case with a transcript since its scan. makeNeedsYouFixture({ reports, reportsRoot: dest, channels: CHANNELS, deckManifest, manifest, cachedWindow: path.join(REPORT, "out", "clips-raw", "vid1_0.00-9.00.mp4"), makePlayCutFixture }); +// THE READINESS BAR (readiness.spec.ts, umtool redesign L7b, READ-ONLY): the same calls under its own names -- needs-you.spec +// settles its own -- for one pill each: quote checks out of date, versions to judge, a dead Rumble QR, a clip not fetched. +makeNeedsYouFixture({ + reports, reportsRoot: dest, channels: CHANNELS, deckManifest, manifest, cachedWindow: path.join(REPORT, "out", "clips-raw", "vid1_0.00-9.00.mp4"), makePlayCutFixture, + names: { project: "readiness-fixture", title: "The Readiness Fixture", links: "readiness-links", linksTitle: "The Readiness Links", withCase: false }, +}); console.log(`fixture at ${dest}`); console.log(` SITES_DIR=${SITES}`); diff --git a/umtool/e2e/fixtures/needs-you-fixture.mjs b/umtool/e2e/fixtures/needs-you-fixture.mjs @@ -39,11 +39,14 @@ const write = (dir, name, doc) => { }; /** - * @param {{ reports: string, reportsRoot: string, channels: string, deckManifest: Function, manifest: Function, cachedWindow: string, makePlayCutFixture: Function }} o + * @param {{ reports: string, reportsRoot: string, channels: string, deckManifest: Function, manifest: Function, cachedWindow: string, makePlayCutFixture: Function, + * names?: { project: string, title: string, links: string, linksTitle: string, withCase: boolean } }} o + * `names`: a second copy under its own names (readiness.spec.ts, umtool redesign L7b: the workspace's readiness bar + * reads the same calls, and needs-you.spec writes its own), with no case. */ -export function makeNeedsYouFixture({ reports, reportsRoot, channels, deckManifest, manifest, cachedWindow, makePlayCutFixture }) { +export function makeNeedsYouFixture({ reports, reportsRoot, channels, deckManifest, manifest, cachedWindow, makePlayCutFixture, names = { project: NY_PROJECT, title: NY_TITLE, links: NY_LINKS, linksTitle: NY_LINKS_TITLE, withCase: true } }) { // ---- the cut: versions to judge, clips not walked, quote checks out of date ---- - const { dir } = makePlayCutFixture({ reports, deckManifest, cachedWindow, name: NY_PROJECT, title: NY_TITLE }); + const { dir } = makePlayCutFixture({ reports, deckManifest, cachedWindow, name: names.project, title: names.title }); const file = path.join(dir, "video.manifest.json"); const m = JSON.parse(readFileSync(file, "utf8")); m.timeline = m.timeline.map((e) => (e.id === "c01" ? { ...e, verdict: "confirmed" } : e)); @@ -66,8 +69,8 @@ export function makeNeedsYouFixture({ reports, reportsRoot, channels, deckManife const rv = path.join(rch, "data", NY_FOLDER); write(rv, "metadata.info.json", { id: NY_EMBED, title: "The NY Rumble Recording", webpage_url: `https://rumble.com/${NY_FOLDER}-the-ny-rumble-recording.html` }); write(rv, "transcript.cues.json", { title: "The NY Rumble Recording", duration: 60, cues: [{ start: 0, end: 60, text: "a rumble." }] }); - const lm = manifest(NY_LINKS, NY_LINKS_TITLE, { siteOrigin: NY_SITE, channelSlug: NY_RUMBLE }, [{ type: "clip", id: "n01", video: NY_FOLDER, start: 10, end: 14, cite: 10, section: 0, quote: "a rumble." }]); - const ldir = path.join(reports, NY_LINKS); + const lm = manifest(names.links, names.linksTitle, { siteOrigin: NY_SITE, channelSlug: NY_RUMBLE }, [{ type: "clip", id: "n01", video: NY_FOLDER, start: 10, end: 14, cite: 10, section: 0, quote: "a rumble." }]); + const ldir = path.join(reports, names.links); write(ldir, "video.manifest.json", lm); const [qr] = linksOf(lm); if (!qr) throw new Error("needs-you-fixture: the Rumble clip draws no QR"); @@ -85,6 +88,7 @@ export function makeNeedsYouFixture({ reports, reportsRoot, channels, deckManife ], }); + if (!names.withCase) return { dir, ldir, cdir: null }; // ---- a live case, scanned on 1 Nov, its channel transcribed since ---- const now = "2026-11-01T00:00:00.000Z"; const cdir = path.join(reportsRoot, ".umtool", "research", NY_CASE); diff --git a/umtool/e2e/intro-play.spec.ts b/umtool/e2e/intro-play.spec.ts @@ -75,10 +75,11 @@ test("Present opens the deck on the intro slide, playing the build's page", asyn await expect(root).not.toHaveAttribute("data-present-slide", "brand-intro"); }); -test("the walk lists the intro first: the walk's stops (a version's old walk address is Open in draft, L3)", async ({ page, request }) => { - // v1 is the cut as written (its rendered manifest is the draft's bytes): nothing to copy, straight on to Play. +test("the walk lists the intro first: the walk's stops (a version's old walk address is its review pass, L7b)", async ({ page, request }) => { + // A version's take walk is its review pass now (a 308): watched block by block, read-only. await page.goto(urls.takeWalkHref(PROJECT, "v1")); - await expect(page).toHaveURL(new RegExp(`/projects/${PROJECT}/play$`)); + await expect(page).toHaveURL(new RegExp(`${urls.versionReviewHref(PROJECT, "v1").replace(/[?]/g, "\\?")}$`)); + await expect(page.locator("[data-review-pass]")).toHaveAttribute("data-review-pass", "v1", { timeout: 30_000 }); const w = (await (await request.get(`/api/report/walk?project=${encodeURIComponent(PROJECT)}`)).json()) as { stops: string[]; intro: { style: string } | null; first: string | null }; expect(w.stops[0]).toBe("brand-intro"); expect(w.intro?.style).toBe("title-card"); diff --git a/umtool/e2e/post-happy-path.spec.ts b/umtool/e2e/post-happy-path.spec.ts @@ -56,7 +56,7 @@ test("a post video from Add posts to a queued render, all by clicking", async ({ // 3. Play, from the head: no /play typed. await page.locator('[data-play-link="header"]').click(); - await expect(page).toHaveURL(/\/play$/); + await expect(page).toHaveURL(/\/play\?cut=1$/); await expect(page.locator("[data-play-cut]")).toBeVisible(); // 5. A take, rendered: the take maker's job starts from a press. diff --git a/umtool/e2e/present.spec.ts b/umtool/e2e/present.spec.ts @@ -183,3 +183,60 @@ test("the project head links to present mode", async ({ page }) => { await page.goto(urls.projectHref(PROJECT, { tab: "cut" })); await expect(page.locator('[data-present-link="header"]')).toHaveAttribute("href", urls.presentHref(PROJECT)); }); + +// THE WORKSPACE'S PRESENT MODE (umtool redesign L7b): the same deck, over the workspace, at `?mode=present`. +test("in the workspace: Present ⛶ is the deck full screen, the arrows move it, Esc is back to Edit; the old /present 308s here", async ({ page }) => { + await page.goto(urls.workspaceHref(PROJECT)); + await expect(page.locator("[data-ws-mode-present]")).toHaveAttribute("href", urls.presentHref(PROJECT)); + await page.locator("[data-ws-mode-present]").click(); + await expect(page).toHaveURL(/[?&]mode=present/); + await expect(root(page)).toHaveAttribute("data-present-slide", "section-0", { timeout: 30_000 }); + // Full screen: the deck covers the window, nothing of the workspace shows around it. + const box = await root(page).boundingBox(); + expect(box).toMatchObject({ x: 0, y: 0, width: 1366, height: 768 }); + await page.keyboard.press("ArrowRight"); + await expect(root(page)).toHaveAttribute("data-present-slide", "c01"); + await expect(page).toHaveURL(/mode=present#c01$/); + await shot(page, "ws-present.png"); + // Esc: the settings first, when open; then back to Edit. + await page.keyboard.press("s"); + await expect(page.locator("[data-present-settings]")).toBeVisible(); + await page.keyboard.press("Escape"); + await expect(page.locator("[data-present-settings]")).toHaveCount(0); + await expect(root(page)).toHaveCount(1); + await page.keyboard.press("Escape"); + await expect(root(page)).toHaveCount(0); + await expect(page).not.toHaveURL(/mode=/); + await expect(page.locator("[data-ws-mode-edit]")).toHaveAttribute("aria-current", "page"); + // The browser's Back: presenting again, on the slide it left. + await page.goBack(); + await expect(root(page)).toHaveAttribute("data-present-slide", "c01", { timeout: 30_000 }); + // The old address: a 308 to the mode, its take kept. + for (const [old, now] of [ + [urls.legacyPresentHref(PROJECT), urls.presentHref(PROJECT)], + [urls.legacyPresentHref(PROJECT, { take: "v1" }), urls.presentHref(PROJECT, { take: "v1" })], + ]) { + const res = await page.request.get(old, { maxRedirects: 0 }); + expect(res.status(), old).toBe(308); + expect(res.headers()["location"], old).toBe(now); + } +}); + +test("a 9:16 cut presents tall (the stacked vertical deck); on a phone the deck fits the width", async ({ page }) => { + const V = "reports/vertical-deck-fixture"; + await page.goto(urls.presentHref(V)); + await expect(root(page)).toHaveAttribute("data-present-slide", /.+/, { timeout: 30_000 }); + const stage = await page.locator("[data-present-stage]").boundingBox(); + expect(stage).not.toBeNull(); + expect(stage!.height).toBeGreaterThan(stage!.width * 1.6); + await shot(page, "ws-present-tall.png"); + await page.setViewportSize({ width: 390, height: 844 }); + await page.goto(urls.presentHref(PROJECT)); + await expect(root(page)).toHaveAttribute("data-present-slide", "section-0", { timeout: 30_000 }); + expect(await page.evaluate(() => document.documentElement.scrollWidth <= window.innerWidth)).toBe(true); + await expect(page.locator("[data-present-exit]")).toBeInViewport(); + await page.locator('[data-present-zone="next"]').click(); + await expect(root(page)).toHaveAttribute("data-present-slide", "c01"); + await page.locator("[data-present-exit]").click(); + await expect(root(page)).toHaveCount(0); +}); diff --git a/umtool/e2e/readiness.spec.ts b/umtool/e2e/readiness.spec.ts @@ -0,0 +1,99 @@ +import { test, expect, type APIRequestContext, type Page } from "@playwright/test"; +import { mkdirSync } from "node:fs"; +import path from "node:path"; +import { portFor } from "yt-dlp-transcript-common/lib/ports.mjs"; +import * as urls from "./urls"; + +// --------------------------------------------------------------------------- +// THE READINESS BAR (umtool redesign L7b; workspace/ReadinessBar.tsx, lib/inbox/readiness.mjs): under the +// workspace's top bar, one pill each -- quote check, links, captures, render, X jar -- read from the calls the +// Inbox reads (L4), each a click to its fix or its page. Read-only. +// +// readiness-fixture / readiness-links (READ-ONLY; needs-you-fixture.mjs under their own names): quote checks out +// of date (c02 stale, c01 c03 c04 never checked), v1 and `short` rendered with no verdict, c03 never fetched; a +// Rumble QR naming its folder (dead). X's jar: the stub editor's services, put up here and taken down after. +// --------------------------------------------------------------------------- + +test.describe.configure({ mode: "serial" }); + +const P = "reports/readiness-fixture"; +const L = "reports/readiness-links"; +const STUB = `http://127.0.0.1:${portFor("EDITOR_STUB_PORT")}`; +const X_ALERT = { service: "x", label: "X", family: "x", state: "stale", kind: "jar-age", since: "2026-11-09T09:00:00.000Z", raisedAt: "2026-11-09T09:00:00.000Z", headline: "X cookies are 3 h old (limit 60 min)", fix: "Refresh cookies on /settings.", detail: "2 X jobs are queued." }; +const services = (request: APIRequestContext, alerts: unknown[]) => request.post(`${STUB}/__stub/services`, { data: { alerts } }); +const pill = (page: Page, id: string) => page.locator(`[data-ws-readiness] [data-ready-pill="${id}"]`); +const SHOTS = process.env.L7B_SHOTS ?? ""; + +test.beforeEach(async ({ page, request }) => { + test.setTimeout(120_000); + await page.setViewportSize({ width: 1366, height: 768 }); + await services(request, []); +}); +test.afterAll(async ({ request }) => { + await services(request, []); +}); + +test("five pills under the top bar, the generated banner's row kept; the page still never scrolls", async ({ page }) => { + await page.goto(urls.workspaceHref(P)); + const bar = page.locator("[data-ws-readiness]"); + await expect(bar).toBeVisible({ timeout: 30_000 }); + expect(await bar.locator("[data-ready-pill]").evaluateAll((els) => els.map((e) => e.getAttribute("data-ready-pill")))).toEqual(["quote-check", "links", "captures", "render", "x-jar"]); + // Right under the top bar. + const top = await page.locator("[data-ws-top]").boundingBox(); + const row = await bar.boundingBox(); + expect(Math.abs(row!.y - (top!.y + top!.height))).toBeLessThan(2); + expect(await page.evaluate(() => document.documentElement.scrollHeight <= window.innerHeight)).toBe(true); + if (SHOTS) { + mkdirSync(SHOTS, { recursive: true }); + await page.screenshot({ path: path.join(SHOTS, "ws-readiness.png") }); + } +}); + +test("quote check: 4 out of date (the Inbox's quote-check-stale rows), its click home's Run quote-check", async ({ page }) => { + await page.goto(urls.workspaceHref(P)); + await expect(pill(page, "quote-check")).toHaveAttribute("data-ready-state", "count", { timeout: 30_000 }); + await expect(pill(page, "quote-check")).toHaveAttribute("data-ready-count", "4"); + await expect(pill(page, "quote-check")).toHaveAttribute("title", /c02: .*cut or quote changed/); + await expect(pill(page, "quote-check")).toHaveAttribute("href", urls.homeHref()); +}); + +test("links: the dead Rumble QR is ! (blocking), its click the piece's decisions where Use embed ids is", async ({ page }) => { + await page.goto(urls.workspaceHref(L)); + await expect(pill(page, "links")).toHaveAttribute("data-ready-state", "bad", { timeout: 30_000 }); + await expect(pill(page, "links")).toHaveAttribute("title", /v6nyslug/); + await expect(pill(page, "links")).toHaveAttribute("href", urls.projectHref(L, { tab: "overview" })); + await pill(page, "links").click(); + await expect(page.locator("[data-settle-button='links']").first()).toHaveText("Use embed ids (1)", { timeout: 30_000 }); +}); + +test("captures: the clip never fetched is counted, and its click selects that block", async ({ page }) => { + await page.goto(urls.workspaceHref(P)); + await expect(pill(page, "captures")).toHaveAttribute("data-ready-state", "count", { timeout: 30_000 }); + await expect(pill(page, "captures")).toHaveAttribute("data-ready-count", "1"); + await expect(pill(page, "captures")).toHaveAttribute("title", /c03: no media fetched/); + await pill(page, "captures").click(); + await expect(page.locator('[data-ws-block="c03"]')).toHaveAttribute("aria-selected", "true"); + await expect(page).toHaveURL(/[?&]block=c03/); +}); + +test("render: two versions to judge (v1, short), its click the first one's review pass", async ({ page }) => { + await page.goto(urls.workspaceHref(P)); + await expect(pill(page, "render")).toHaveAttribute("data-ready-state", "count", { timeout: 30_000 }); + await expect(pill(page, "render")).toHaveAttribute("data-ready-count", "2"); + const href = await pill(page, "render").getAttribute("href"); + expect([urls.versionReviewHref(P, "v1"), urls.versionReviewHref(P, "short")]).toContain(href); +}); + +test("X jar: — with no X post and no X work waiting; ! while the editor says X work waits on a stale jar", async ({ page, request }) => { + await page.goto(urls.workspaceHref(P)); + await expect(pill(page, "x-jar")).toHaveAttribute("data-ready-state", "none", { timeout: 30_000 }); + await services(request, [X_ALERT]); + await page.reload(); + await expect(pill(page, "x-jar")).toHaveAttribute("data-ready-state", "bad", { timeout: 30_000 }); + await expect(pill(page, "x-jar")).toHaveAttribute("title", /X cookies are 3 h old/); + await expect(pill(page, "x-jar")).toHaveAttribute("href", `${STUB}/settings`); + // The API says the same, read-only. + const r = (await (await request.get(`/api/report/readiness?project=${encodeURIComponent(P)}`)).json()) as { pills: { id: string; state: string }[] }; + const state = Object.fromEntries(r.pills.map((p) => [p.id, p.state])); + expect(state).toMatchObject({ "quote-check": "count", render: "count", "x-jar": "bad" }); +}); diff --git a/umtool/e2e/redirects.spec.ts b/umtool/e2e/redirects.spec.ts @@ -1,4 +1,5 @@ import { test, expect } from "@playwright/test"; +import * as urls from "./urls"; import { REDIRECTS } from "./urls"; // --------------------------------------------------------------------------- @@ -95,3 +96,53 @@ test("a page that did not move is not redirected", async ({ request }) => { expect(res.status(), p).toBe(200); } }); + +// --------------------------------------------------------------------------- +// THE WORKSPACE'S STATES (umtool redesign L7b): the views a report video's workspace now holds answer with a 308 to +// it (ProjectView, after the project resolves -- a project id is a path, so these cannot be rows of the table). +// What the workspace does not hold yet stays where it is: the clip bench (the walk's every step is a bare +// /clip/<id>), the post and claim benches, the drafts review, Play's own page (`?cut=1` and every query), the +// montage deck, the takes' compare and the trailer. +// --------------------------------------------------------------------------- + +const W = "reports/play-cut-fixture"; +for (const [old, now] of [ + [urls.legacyPresentHref(W), urls.workspaceHref(W, { mode: "present" })], + [urls.legacyPresentHref(W, { take: "short" }), urls.workspaceHref(W, { mode: "present", take: "short" })], + [urls.takeWalkHref(W, "v1"), urls.workspaceHref(W, { mode: "review", take: "v1" })], + [urls.takeWalkHref(W, "short", { all: true }), urls.workspaceHref(W, { mode: "review", take: "short" })], + [urls.barePlayHref(W), urls.workspaceHref(W)], + // The tabs that folded into Deliver, the rest of the query kept (note last); the workspace's own tab. + [urls.projectHref(W, { tab: "build" }), urls.projectHref(W, { tab: "deliver" })], + [urls.projectHref(W, { tab: "media", note: "n1" }), urls.projectHref(W, { tab: "deliver", note: "n1" })], + [urls.projectHref(W, { tab: "workspace" }), urls.workspaceHref(W)], +] as const) { + test(`L7b: ${old} → ${now} (308)`, async ({ request }) => { + const res = await request.get(old, { maxRedirects: 0 }); + expect(res.status(), old).toBe(308); + expect(parts(res.headers()["location"]), old).toEqual(parts(now)); + expect((await request.get(old)).status(), `${old} lands`).toBe(200); + }); +} + +test("L7b: what the workspace does not hold yet is not redirected", async ({ request }) => { + for (const href of [ + urls.playHref(W), + urls.playHref(W, { take: "short" }), + urls.playHref(W, { clip: "c02", at: 0.5 }), + urls.clipBenchHref(W, "c01"), + urls.clipBenchHref(W, "c01", { play: { at: 1 } }), + urls.postBenchHref("reports/post-items-fixture", "p-txt"), + urls.claimBenchHref("reports/bench-fixture", "k03"), + urls.reviewHref("reports/draft-review-fixture"), + urls.projectHref(W, { tab: "overview" }), + urls.projectHref(W, { tab: "cut" }), + urls.takesHref(W), + urls.trailerHref(W), + urls.clipDeckHref(W), + ]) { + const res = await request.get(href, { maxRedirects: 0 }); + expect(res.status(), href).not.toBe(308); + expect(res.status(), href).toBeLessThan(400); + } +}); diff --git a/umtool/e2e/review-pass.spec.ts b/umtool/e2e/review-pass.spec.ts @@ -0,0 +1,171 @@ +import { test, expect, type Page } from "@playwright/test"; +import { existsSync, mkdirSync, readFileSync } from "node:fs"; +import path from "node:path"; +import { fileURLToPath } from "node:url"; +import * as urls from "./urls"; + +// --------------------------------------------------------------------------- +// THE REVIEW PASS (umtool redesign L7b; workspace/ReviewPass.tsx, lib/report/reviewPass.mjs): the workspace's +// `?mode=review` -- the inspector hidden, the viewer playing block by block, each block answered Keep · Fix · Note +// (k f n), the verdict at the end, and the pass resuming where it stopped. +// +// review-pass-fixture (WRITES; make-fixture.mjs): workspace-fixture's cut -- c01 c02 p-5 k01 c03 c04 -- and +// play-cut-fixture's version v1. The tests run in order, each leaving what the next reads. +// +// L7B_SHOTS (a directory): the pass's screenshots at 1366×768 go there too. +// --------------------------------------------------------------------------- + +test.describe.configure({ mode: "serial" }); + +const P = "reports/review-pass-fixture"; +const DIR = path.join(path.dirname(fileURLToPath(import.meta.url)), "..", ".e2e-song", "reports", "review-pass-fixture"); +const json = (name: string) => JSON.parse(readFileSync(path.join(DIR, name), "utf8")); +const verdictOf = (id: string) => (json("video.manifest.json").timeline as { id: string; verdict?: string; correction?: string }[]).find((e) => e.id === id); +const pass = (page: Page) => page.locator("[data-review-pass]"); +const SHOTS = process.env.L7B_SHOTS ?? ""; +const shot = async (page: Page, name: string) => { + if (!SHOTS) return; + mkdirSync(SHOTS, { recursive: true }); + await page.screenshot({ path: path.join(SHOTS, name) }); +}; + +test.beforeEach(async ({ page }) => { + test.setTimeout(120_000); + await page.setViewportSize({ width: 1366, height: 768 }); +}); + +test("Review pass: the inspector hidden, k keeps two clips (their walk verdicts), f fixes the post (what needs fixing), n opens the composer on the card", async ({ page }) => { + await page.goto(urls.workspaceHref(P)); + await expect(page.locator("[data-ws-mode-edit]")).toHaveAttribute("aria-current", "page"); + await expect(page.locator("[data-ws-mode-review]")).toHaveAttribute("href", urls.workspaceHref(P, { mode: "review" })); + await page.locator("[data-ws-mode-review]").click(); + await expect(page).toHaveURL(/[?&]mode=review/); + await expect(page.locator("[data-ws-mode]")).toHaveAttribute("data-ws-mode", "review"); + // The inspector is the pass: no bench, no project panels. + await expect(page.locator("[data-ws-inspector]")).toHaveAttribute("data-ws-inspector", "review"); + await expect(page.locator("[data-ws-project-panels]")).toHaveCount(0); + await expect(pass(page)).toHaveAttribute("data-review-current", "c01", { timeout: 20_000 }); + await expect(pass(page)).toHaveAttribute("data-review-progress", "0/6"); + await expect(page.locator("[data-review-count]")).toHaveText("0 / 6 reviewed"); + // The viewer is on the block under review. + await expect(page.locator('[data-ws-block="c01"]')).toHaveAttribute("aria-selected", "true"); + await shot(page, "ws-review.png"); + + // k: c01 kept -- its walk verdict, the bench's writer -- and on to c02, playing. + await page.keyboard.press("k"); + await expect(pass(page)).toHaveAttribute("data-review-current", "c02"); + await expect.poll(() => verdictOf("c01")?.verdict).toBe("confirmed"); + await expect(page.locator('[data-ws-block="c01"]')).toHaveAttribute("data-ws-block-review", "keep"); + await expect(page.locator("[data-ws-viewer]")).toHaveAttribute("data-play-item", "c02", { timeout: 20_000 }); + await page.keyboard.press("k"); + await expect(pass(page)).toHaveAttribute("data-review-current", "p-5"); + await expect.poll(() => verdictOf("c02")?.verdict).toBe("confirmed"); + await expect(pass(page)).toHaveAttribute("data-review-progress", "2/6"); + + // f on the post: what needs fixing, then on. A post has no walk verdict: review-pass.json holds it. + await page.keyboard.press("f"); + const fix = page.locator("[data-review-fix-text]"); + await expect(fix).toBeFocused(); + await fix.fill("the crop cuts his face"); + await fix.press("Enter"); + await expect(pass(page)).toHaveAttribute("data-review-current", "k01"); + await expect.poll(() => (existsSync(path.join(DIR, "review-pass.json")) ? json("review-pass.json").marks["p-5"] : null)).toMatchObject({ mark: "fix", note: "the crop cuts his face" }); + await expect(page.locator('[data-ws-block="p-5"]')).toHaveAttribute("data-ws-block-review", "fix"); + await expect(pass(page)).toHaveAttribute("data-review-progress", "3/6"); + + // n on the card: the notes composer, anchored to the block (notes.json). + await page.keyboard.press("n"); + const input = page.getByTestId("note-input-k01"); + await expect(input).toBeFocused(); + await input.fill("is this card needed at all?"); + await input.press("Enter"); + await expect + .poll(() => (existsSync(path.join(DIR, "notes.json")) ? (json("notes.json").notes as { text: string; anchor: { kind: string; entry?: string } }[]).find((n) => n.text === "is this card needed at all?")?.anchor : null)) + .toEqual({ kind: "entry", entry: "k01" }); + // A note is not an answer: the card is still the block under review. + await expect(pass(page)).toHaveAttribute("data-review-current", "k01"); + await expect(pass(page)).toHaveAttribute("data-review-progress", "3/6"); +}); + +test("a reload resumes at block 4; so does the pass entered afresh (the first block with no answer)", async ({ page }) => { + await page.goto(urls.workspaceHref(P, { mode: "review", block: "k01" })); + await expect(pass(page)).toHaveAttribute("data-review-current", "k01", { timeout: 20_000 }); + await page.reload(); + await expect(pass(page)).toHaveAttribute("data-review-current", "k01", { timeout: 20_000 }); + await expect(page.locator("[data-review-count]")).toHaveText("3 / 6 reviewed"); + await page.goto(urls.workspaceHref(P, { mode: "review" })); + await expect(pass(page)).toHaveAttribute("data-review-current", "k01", { timeout: 20_000 }); + // The answers so far, said on the strip. + expect(await page.locator("[data-ws-block-review]").evaluateAll((els) => els.map((e) => `${e.getAttribute("data-ws-block")}:${e.getAttribute("data-ws-block-review")}`))).toEqual([ + "c01:keep", + "c02:keep", + "p-5:fix", + "k01:", + "c03:", + "c04:", + ]); + // The CLI twin reads the same answers. + const { reviewPassCommand } = await import("../lib/report/reviewPass.mjs"); + const out: string[] = []; + await reviewPassCommand([P, "--json"], { resolve: async () => ({ id: P, dir: DIR }), log: (s: string) => out.push(s), err: (s: string) => out.push(s) }); + expect(JSON.parse(out.join("\n"))).toMatchObject({ done: 3, total: 6, next: "k01" }); +}); + +test("past the last block, the verdict: Like saves the draft as a version and writes verdicts.json (L4's writer); Done is back to Edit", async ({ page }) => { + await page.goto(urls.workspaceHref(P, { mode: "review" })); + await expect(pass(page)).toHaveAttribute("data-review-current", "k01", { timeout: 20_000 }); + // → walks on without answering: k01, c03, c04, the end. + for (const id of ["c03", "c04"]) { + await page.keyboard.press("ArrowRight"); + await expect(pass(page)).toHaveAttribute("data-review-current", id); + } + await page.keyboard.press("ArrowRight"); + await expect(pass(page)).toHaveAttribute("data-review-current", "end"); + const end = page.locator("[data-review-end]"); + await expect(end).toContainText("3 blocks not reviewed"); + await shot(page, "ws-review-end.png"); + await end.locator('[data-review-verdict="like"]').click(); + const judged = end.locator("[data-review-verdict-take]"); + await expect(judged).toBeVisible({ timeout: 20_000 }); + const take = (await judged.getAttribute("data-review-verdict-take"))!; + expect(take).toMatch(/^v\d+$/); + await expect.poll(() => json(path.join("takes", "verdicts.json"))[take]?.verdict).toBe("like"); + await expect(end.locator('[data-play-verdict-button="like"]')).toHaveAttribute("aria-pressed", "true"); + await end.locator("[data-review-done]").click(); + await expect(page).not.toHaveURL(/mode=/); + await expect(page.locator("[data-ws-mode-edit]")).toHaveAttribute("aria-current", "page"); + await expect(page.locator("[data-ws-inspector]")).not.toHaveAttribute("data-ws-inspector", "review"); + // The browser's Back: the pass again. + await page.goBack(); + await expect(page.locator("[data-ws-mode]")).toHaveAttribute("data-ws-mode", "review"); +}); + +test("a version's review pass is read-only: watched and noted, never marked -- Open in draft to change it; its verdict at the end", async ({ page }) => { + await page.goto(urls.versionReviewHref(P, "v1")); + await expect(pass(page)).toHaveAttribute("data-review-pass", "v1", { timeout: 20_000 }); + await expect(page.locator("[data-ws-version-shown]")).toContainText("v1 · read-only"); + await expect(page.locator("[data-review-keep]")).toBeDisabled(); + await expect(page.locator("[data-review-fix]")).toBeDisabled(); + await expect(page.locator("[data-review-open-draft]")).toHaveAttribute("href", urls.openInDraftHref(P, "v1")); + // Nothing on the bar writes the draft: no Look, Render, Undo. + await expect(page.locator("[data-ws-undo]")).toHaveCount(0); + await expect(page.locator("[data-ws-look]")).toHaveCount(0); + const before = readFileSync(path.join(DIR, "video.manifest.json"), "utf8"); + await page.keyboard.press("k"); + await page.waitForTimeout(400); + expect(readFileSync(path.join(DIR, "video.manifest.json"), "utf8")).toBe(before); + // The take walk's old address is this pass (a 308). + const res = await page.request.get(urls.takeWalkHref(P, "v1"), { maxRedirects: 0 }); + expect(res.status()).toBe(308); + expect(res.headers()["location"]).toBe(urls.versionReviewHref(P, "v1")); +}); + +test("on a phone (390 px) the pass is a sheet under the viewer, its answers in reach", async ({ page }) => { + await page.setViewportSize({ width: 390, height: 844 }); + await page.goto(urls.workspaceHref(P, { mode: "review" })); + await expect(pass(page)).toHaveAttribute("data-review-current", "k01", { timeout: 20_000 }); + await expect(page.locator("[data-review-keep]")).toBeInViewport(); + await expect(page.locator("[data-review-note]")).toBeInViewport(); + expect(await page.evaluate(() => document.documentElement.scrollWidth <= window.innerWidth)).toBe(true); + await shot(page, "ws-review-phone.png"); +}); diff --git a/umtool/e2e/urls.ts b/umtool/e2e/urls.ts @@ -32,3 +32,18 @@ export function section(project: string, name: string, q: { all?: boolean; note? export function songSection(song: string, name: string, q: { note?: string } = {}): string { return projectHref(song, { tab: songTabOfSection(name), ...q }); } + +// ── the addresses L7b moved into the workspace (umtool redesign): what a redirect spec asks for ──────────────── +// The app no longer builds these (lib/hrefs.ts builds where they land), so a spec that checks the redirect names +// the old address here, once. +import { encodePath, withQuery } from "../lib/hrefs"; + +/** The old present-mode page: `/projects/<p>/present` (it 308s to the workspace's `?mode=present`). */ +export function legacyPresentHref(project: string, q: { take?: string | null } = {}): string { + return withQuery(`/projects/${encodePath(project)}/present`, { take: q.take }); +} + +/** A bare `/projects/<p>/play` (it 308s to the workspace; Play's own page always carries a query). */ +export function barePlayHref(project: string): string { + return `/projects/${encodePath(project)}/play`; +}