Archilyzer · Source

archilyzer

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

commit ab0be1392109e1a449ef58da6877d4e72dab4672
parent 38f9154bd84f1dd5e50218d1f683670d13dc5261
Author: I Mean I'm Just Saying <imeanimjustsaying@kiwifarms.st>
Date:   Sun,  8 Nov 2026 04:10:51 -0500

umtool: present mode's e2e fixture and spec, and its docs

present-fixture: a clip, a section, a narrated reply to a private account
with a redacted name and a censored picture, a plain post, a teaser.
present.spec.ts: keys move the slides and the hash, Back, a deep link, the
outline, the screenshots, settings kept across a reload, narration off,
a censor toggle drawing the card again, auto-advance, the head's link.
knobs.md "Present mode" and cli.md's `present` row.

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

Diffstat:
Mumtool/docs/cli.md | 1+
Mumtool/docs/knobs.md | 49+++++++++++++++++++++++++++++++++++++++++++++++++
Mumtool/e2e/fixtures/make-fixture.mjs | 4++++
Aumtool/e2e/fixtures/present-fixture.mjs | 64++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Aumtool/e2e/present.spec.ts | 185+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
5 files changed, 303 insertions(+), 0 deletions(-)

diff --git a/umtool/docs/cli.md b/umtool/docs/cli.md @@ -33,6 +33,7 @@ Inbox cannot disagree about what is wrong with one. | `quote-check <project> [--clips a,b] [--pad S] [--json]` · `quote-check <project> --status` | **is each clip's quote in the seconds it plays?** The cut ±15 s of the source the render would cut it from, transcribed by the editor (`pnpm ops transcribe`, words on — its transcription lane), the quote found in those words and in the cues: `ok`, `moved` (heard more than 0.5 s from where the cues have it), `not-found`; rows in `quote-check.json`, stale when the cut or the quote changes; `check` blocks on `moved`/`not-found` (`clip-quote-moved`, `clip-quote-missing`), a take refuses them, `prep --status` counts them ([knobs.md](knobs.md#the-quote-check-is-the-quote-where-the-clip-plays)) | | `window <project> <clip> --align` · `--quote-ruled` / `--no-quote-ruled` | the cut snapped to the quote as HEARD (0.15 s before its first word, 0.3 s after its last, the extent widened to hold it, `lockCut`); a person's ruling on the quote check (a take renders a ruled clip) | | `window <project> <clip> --take <take> …` | a **take's** clip (walk a take): the same fields, written into the take's patch (`takes/<take>/take.json`) with an undo point first; the project's manifest is untouched ([clip-bench.md](clip-bench.md#walking-a-take)) | +| `present <project> [--take <take> \| --cut] [--json] [--public] [--open] [--url <origin>]` | **present mode**: the cut as slides, navigated like a deck (`/projects/<p>/present`) — prints the address and every slide (its kind, id — a post's `<channel>/<id>`, a clip's id, `section-<n>`, `day-<YYYY-MM-DD>` — date, words and censor counts); `--json` the payload (each post's card as Play draws it and its censor data by kind, each clip's spans, the dividers); `--public` the payload a public page would carry (censored, no reveal data); `--open` opens it; `<address>#<slide id>` opens a slide ([knobs.md](knobs.md#present-mode-the-cut-as-slides-navigated-like-a-deck)) | | `walk <project> [--take <take>] [--all] [--json]` | the clip bench's **walk**: every clip in walk order with its window, verdict and whether a fetched file holds it, and (→) the ones the walk visits — fetched and needing a verdict; `--all` every fetched one; `--take` walks a take (a draft too); the bench's address to start at | | `link <project> <site>/<report>` · `link <project> --clear` | the manifest names the article it is the video of (settles `link-ambiguous`) | | `set <project> <clip> key=value …` | a clip's **knobs**: `claim.at` `claim.hold` `claim.stamp` `claim.count` `claim.label` (the first mark's, or `--mark <id>`'s), its **marks** `mark.add=<verdict>[@<sec>]` `mark.remove=<id>` `mark.verdict=<verdict>` `marks=<json>`, `audio.offset` `audio.gain` `audio.fadeIn` `audio.fadeOut`, its picture's **blur** `blur.on=true` `blur.caption=…` `blur.strength` `blur.from` `blur.to` (`blur.on=` clears it; [knobs.md](knobs.md#a-clips-picture-blurred)), its **effects** `fx.zoom=<json>` `fx.receipts=<json>` `fx.punch=…` `fx.quote` `fx.punchIn=<json>` `fx.speakers=<json>` (`fx=<json>` all of them, `fx=` clears them; a shot is a file in the project; [knobs.md](knobs.md#effects)); `key=` clears one ([knobs.md](knobs.md#marks)) | diff --git a/umtool/docs/knobs.md b/umtool/docs/knobs.md @@ -721,6 +721,55 @@ it replies on the note as the agent; with no route the button says why, and the Then the cut: the Build tab's **final** preset (a full build, about an hour for a 36-clip cut), and Deliver's **Make variants**. +## 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 +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 +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 + slot with their trims, crops and censors, the read-follow, the clock, the progress bar, a combo badge) on the slide's + own clock from the moment it arrives; its picked narration take plays over it, its attachments muffled under it as + the build mixes them. Its id is the **post's** (`<channel>/<native id>`), never the entry's place; +- a **clip** slide per clip the walk did not reject: its spans (its cut minus its gaps) from the cached window Play + plays, the deck's title and source line under it, its picture blurred as the build blurs it; +- a **teaser** slide (its lines), any other entry as its heading; +- a **section** divider where the deck's markers open a section (and the opening's, named after the cut) — or, for a + chronological reel of posts with no markers, a **day** divider per calendar day in the posts' clock zone + (`render.posts.clock.zone`, [The clock](#the-clock-each-posts-own-time-on-its-card-run-between-items)). + +| | In umtool | Keys | +|---|---|---| +| next, back, first, last | a click on the stage's right or left third; a swipe | → PgDn Space · ← PgUp Shift+Space · Home End | +| pause the slide (its clock, its voice, its video) | a click on the stage's middle third | p | +| every slide at a glance, the one on stage lit; jump | the **outline** under the stage: the sections (or days) as bands, a cell per slide; a band's name jumps to its first slide | — | +| where you are | `23 / 140 · Nov 3` under the outline, the section's name, **source ↗** (the deck's QR link) | — | +| link to a slide | the address carries `#<slide id>` (`#presentchan-x/1`, `#c01`, `#section-2`, `#day-2026-11-03`); each move is a history entry, so the browser's Back returns to the slide before | — | +| what the card censors, by kind — **Redacted names**, **Slurs masked**, **Private authors blurred**, **Censored pictures** (each slide's count of each beside it); **Narration**; **Attachment sound**; **Auto-advance after the read** and its **linger** (s) | **Settings** (bottom right) | s, Esc | + +**The settings are each viewer's own**, kept in this browser (`localStorage`, `umtool.present.settings.v1`); without +storage they hold for the visit. Everything the build censors is censored until a viewer turns a kind off; the card +page is drawn again with that kind off (the post-item route's `published`, `uncensored`, `redact=0`, `authors=0`, +`blur=0`). Narration off keeps the slide's clock (its read-follow, its attachments) with the take silent; +auto-advance moves on when the read ends — a post's plan, a clip's last span, a divider's few seconds — plus the +linger. + +**The payload** (`GET /api/report/present?project=<p>[&take=<id>|&cut=1]`, `umtool present <p> --json`): `{version, +project, take, title, capabilities: {canUncensor}, settings, box, zone, sections, slides}`. A post slide carries its +item as Play draws it (`post`, `plan`, `progress`, `clock`, `scene`, `combo`), its excerpt's spans in its words, its +narration take (`file`, `seconds`, word timings when it has them) and its **censor data**: every redacted span and +masked slur of every string the card draws (`{kind: "redact"|"slur", field, start, end, mask?}`), every author the +card blurs (`{kind: "author", where, handle, reason}`), every censored attachment (`{kind: "blur", i, style, boxes, +band, strength, label}`), and their counts. **`canUncensor: false`** (`--public`, `&public=1`; what a public page +would carry) holds the posts already censored — the redaction's marks and the slurs' masks in the words, a blurred +author left with a handle that names nobody (the card still blurs it), no script — and no censor data at all: a +public page can add censoring, never remove it. + +`umtool present <p> [--take <id> | --cut] [--json] [--public] [--open] [--url <origin>]` prints the address and the +slides (each one's kind, id, date, words and censor counts); `<address>#<slide id>` opens one. + ## Add post (a post card from Play the cut) The chain `pnpm ops capture-posts` → `umtool posts add` → `umtool look deck.posts` in one panel: Play the cut's **Add diff --git a/umtool/e2e/fixtures/make-fixture.mjs b/umtool/e2e/fixtures/make-fixture.mjs @@ -59,6 +59,7 @@ import { makeIntakeFixture } from "./intake-fixture.mjs"; import { makePostItemsFixture } from "./post-items-fixture.mjs"; import { makePostHappyFixture } from "./post-happy-fixture.mjs"; import { makePostNarrationFixture } from "./post-narration-fixture.mjs"; +import { makePresentFixture } from "./present-fixture.mjs"; import { makeTakeItemsFixture } from "./take-items-fixture.mjs"; import { makePlayPreloadFixture } from "./play-preload-fixture.mjs"; import { makePostComboFixture } from "./post-combo-fixture.mjs"; @@ -1937,6 +1938,9 @@ makePostItemsFixture({ reports, channels: CHANNELS, deckManifest, cachedWindow: makePostHappyFixture({ reports, deckManifest, cachedWindow: path.join(REPORT, "out", "clips-raw", "vid1_0.00-9.00.mp4") }); // Narrated post items (report-to-video/post-narration.mjs): a take read over a video, four pictures cycling (post-narration.spec.ts). makePostNarrationFixture({ reports, deckManifest }); +// Present mode (lib/report/present.mjs): a clip, a section, a narrated reply to a private account with a redacted +// name and a censored picture, a plain post, a teaser (present.spec.ts). +makePresentFixture({ reports, deckManifest, cachedWindow: path.join(REPORT, "out", "clips-raw", "vid1_0.00-9.00.mp4") }); // A take's own items (takeImport.mjs, takeScope.mjs): a post imported from another project into a draft take, edited in the take only (take-items.spec.ts). makeTakeItemsFixture({ reports, deckManifest }); // A fast burst of narrated posts (Play's prefetch and its gate: play-preload.spec.ts). diff --git a/umtool/e2e/fixtures/present-fixture.mjs b/umtool/e2e/fixtures/present-fixture.mjs @@ -0,0 +1,64 @@ +// PRESENT MODE (lib/report/present.mjs; present.spec.ts): a cut to present as slides. +// +// present-fixture c01 a clip (playvid, the fixture's synthetic window, cached in out/clips-raw) +// -- a marker after c01 opens "The posts" -- +// p-1 presentchan-x/1: a reply to a PRIVATE account (its parent drawn above it, blurred), a +// made-up name in its words ("Quentin Example", redacted by render.posts.redact), a +// picture (posts-media/…/1_1.png) censored below its middle, NARRATED by a 2 s take +// p-2 presentchan-x/2: words only, a day later +// t01 a teaser, two lines +// the deck on. Never written by the spec. +// +// Synthetic, like every fixture. +import { copyFileSync, mkdirSync, writeFileSync } from "node:fs"; +import { spawnSync } from "node:child_process"; +import path from "node:path"; + +const ff = (args) => { + const r = spawnSync("ffmpeg", ["-v", "error", "-y", ...args]); + if (r.status !== 0) throw new Error(`ffmpeg ${args.join(" ")}: ${String(r.stderr)}`); +}; + +export const PRESENT_CHANNEL = "presentchan-x"; + +/** @param {{ reports: string, deckManifest: Function, cachedWindow: string }} o */ +export function makePresentFixture({ reports, deckManifest, cachedWindow }) { + const name = "present-fixture"; + const dir = path.join(reports, name); + mkdirSync(path.join(dir, "out", "clips-raw"), { recursive: true }); + copyFileSync(cachedWindow, path.join(dir, "out", "clips-raw", "playvid_0.00-9.00.mp4")); + const media = path.join(dir, "posts-media", PRESENT_CHANNEL, "1"); + mkdirSync(media, { recursive: true }); + ff(["-f", "lavfi", "-i", "testsrc=size=320x180:rate=1:duration=1", "-frames:v", "1", path.join(media, "1_1.png")]); + const takes = path.join(dir, "narration", "posts", "1"); + mkdirSync(takes, { recursive: true }); + ff(["-f", "lavfi", "-i", "sine=frequency=262:sample_rate=48000:duration=2", "-ac", "1", "-c:a", "pcm_s16le", path.join(takes, "take-1.orpheus-zac.wav")]); + const base = (id, o) => ({ + type: "post", id: `p-${id}`, post: `${PRESENT_CHANNEL}/${id}`, platform: "x", author: "Present Subject", handle: "presentsubject", + url: `https://x.com/presentsubject/status/${id}`, engagement: { likes: 7, reposts: 2 }, subjects: ["presentsubject"], ...o, + }); + const timeline = [ + { type: "clip", id: "c01", video: "playvid", start: 1.0, end: 3.0, cite: 1, section: 0, lock: true, quote: "This is a complete sentence.", onscreen: { title: "24 Oct 2020" } }, + base("1", { + date: "2026-10-30T12:00:00.000Z", + text: "@someone_private Yes, and Quentin Example was there too. Here is the picture.", + parents: [{ id: "9", author: "Private Person", handle: "someone_private", date: "2026-10-30T11:30:00.000Z", text: "is this really true?", url: "https://x.com/someone_private/status/9" }], + media: [{ src: `posts-media/${PRESENT_CHANNEL}/1/1_1.png`, kind: "image", width: 320, height: 180, blur: { on: true, band: { below: 0.5 } } }], + narration: { + script: "Yes, and he was there too. Here is the picture.", + takes: [{ file: "narration/posts/1/take-1.orpheus-zac.wav", engine: "orpheus", voice: "zac", seconds: 2, script: "Yes, and he was there too.", at: "2026-11-02T00:00:00.000Z" }], + pick: 0, + }, + }), + base("2", { date: "2026-10-31T09:00:00.000Z", text: "One more post, a day later, with nothing but words in it." }), + { type: "teaser", id: "t01", seconds: 4, lines: ["Next Season", "The Big Build"], tail: "?" }, + ]; + const m = deckManifest(name, "The Present Fixture", timeline); + m.provenance = { ...m.provenance, channelSlug: PRESENT_CHANNEL }; + m.render.fetchPad = 0; + m.render.lockedEdges = false; + m.render.posts = { redact: [{ term: "Quentin Example", note: "a made-up name" }] }; + m.render.chrome = { ...m.render.chrome, deck: { ...(m.render.chrome?.deck ?? {}), markers: [{ after: "c01", label: "The posts" }] } }; + writeFileSync(path.join(dir, "video.manifest.json"), JSON.stringify(m, null, 2) + "\n"); + return { dir }; +} diff --git a/umtool/e2e/present.spec.ts b/umtool/e2e/present.spec.ts @@ -0,0 +1,185 @@ +import { test, expect, type Page } from "@playwright/test"; +import path from "node:path"; +import * as urls from "./urls"; + +// --------------------------------------------------------------------------- +// PRESENT MODE (lib/report/present.mjs, components/projects/present/; knobs.md, "Present mode"): the cut as slides, +// one at a time, navigated like a deck. Fixture: e2e/fixtures/present-fixture.mjs -- section-0 (the opening), c01 +// (a clip), section-1 ("The posts"), presentchan-x/1 (a narrated reply to a private account, a redacted name, a +// censored picture), presentchan-x/2 (words only), t01 (a teaser). +// +// PRESENT_SHOTS (a directory): the three slides' screenshots at 1366×768 go there too. +// --------------------------------------------------------------------------- + +const PROJECT = "reports/present-fixture"; +const SHOTS = process.env.PRESENT_SHOTS ?? null; +const ORDER = ["section-0", "c01", "section-1", "presentchan-x/1", "presentchan-x/2", "t01"]; + +const root = (page: Page) => page.locator("[data-present]"); +const card = (page: Page) => page.frameLocator('[data-post-card-frame="read"]'); +const shot = async (page: Page, name: string) => { + await page.screenshot({ path: test.info().outputPath(name) }); + if (SHOTS) await page.screenshot({ path: path.join(SHOTS, name) }); +}; + +test.beforeEach(async ({ page }) => { + test.setTimeout(120_000); + await page.setViewportSize({ width: 1366, height: 768 }); +}); + +test("arrow keys step the slides in cut order and the address follows; Back returns; a deep link opens its slide; the outline jumps", async ({ page }) => { + await page.goto(urls.presentHref(PROJECT)); + await expect(root(page)).toHaveAttribute("data-present-slide", "section-0", { timeout: 30_000 }); + await expect(page).toHaveURL(/#section-0$/); + // An app: the whole of it in the window, no page scroll. + expect(await page.evaluate(() => document.documentElement.scrollHeight <= window.innerHeight)).toBe(true); + await expect(page.locator("[data-present-progress]")).toHaveText("1 / 6"); + await expect(page.locator("[data-present-section-label]")).toHaveText("The Present Fixture"); + await expect(page.locator("[data-present-cell]")).toHaveCount(6); + expect(await page.locator("[data-present-cell]").evaluateAll((els) => els.map((e) => e.getAttribute("data-present-cell")))).toEqual(ORDER); + + for (const [i, id] of ORDER.slice(1).entries()) { + await page.keyboard.press(i % 2 ? "PageDown" : "ArrowRight"); + await expect(root(page)).toHaveAttribute("data-present-slide", id); + await expect(page).toHaveURL(new RegExp(`#${id.replace("/", "\\/")}$`)); + await expect(page.locator(`[data-present-cell="${id}"]`)).toHaveAttribute("aria-current", "true"); + if (id === "c01") { + await expect(page.locator("[data-present-clip-title]")).toHaveText("24 Oct 2020"); + await expect(page.locator("[data-present-clip-video]")).toHaveCount(1); + } + if (id === "section-1") await expect(page.locator("[data-present-section-label]")).toHaveText("The posts"); + } + await expect(page.locator("[data-present-progress]")).toHaveText("6 / 6"); + // Past the end: nothing moves. + await page.keyboard.press("ArrowRight"); + await expect(root(page)).toHaveAttribute("data-present-slide", "t01"); + await expect(page.locator("[data-present-teaser]")).toContainText("Next Season"); + // ← and Shift+Space back; Home and End. + await page.keyboard.press("ArrowLeft"); + await expect(root(page)).toHaveAttribute("data-present-slide", "presentchan-x/2"); + await expect(page.locator("[data-present-progress]")).toHaveText("5 / 6 · Oct 31"); + await page.keyboard.press("Shift+Space"); + await expect(root(page)).toHaveAttribute("data-present-slide", "presentchan-x/1"); + await page.keyboard.press("Home"); + await expect(root(page)).toHaveAttribute("data-present-slide", "section-0"); + await page.keyboard.press("End"); + await expect(root(page)).toHaveAttribute("data-present-slide", "t01"); + // The browser's Back: the slide before, from the history. + await page.goBack(); + await expect(root(page)).toHaveAttribute("data-present-slide", "section-0"); + await page.goBack(); + await expect(root(page)).toHaveAttribute("data-present-slide", "presentchan-x/1"); + + // A click on the stage's right third: on; its left third: back. + await page.locator('[data-present-zone="next"]').click(); + await expect(root(page)).toHaveAttribute("data-present-slide", "presentchan-x/2"); + await page.locator('[data-present-zone="prev"]').click(); + await expect(root(page)).toHaveAttribute("data-present-slide", "presentchan-x/1"); + + // A deep link opens on its slide. + await page.goto(urls.presentHref(PROJECT, { slide: "presentchan-x/2" })); + await expect(root(page)).toHaveAttribute("data-present-slide", "presentchan-x/2", { timeout: 30_000 }); + await expect(page.locator("[data-present-progress]")).toHaveText("5 / 6 · Oct 31"); + + // The outline: a click on a cell jumps there; a section's label to its first slide. + await page.locator('[data-present-cell="c01"]').click(); + await expect(root(page)).toHaveAttribute("data-present-slide", "c01"); + await expect(page).toHaveURL(/#c01$/); + await page.locator('[data-present-group-label="section-1"]').click(); + await expect(root(page)).toHaveAttribute("data-present-slide", "section-1"); +}); + +test("the screenshots: a post with its thread and attachment, a clip, a section divider", async ({ page }) => { + await page.goto(urls.presentHref(PROJECT, { slide: "presentchan-x/1" })); + await expect(root(page)).toHaveAttribute("data-present-slide", "presentchan-x/1", { timeout: 30_000 }); + // The card as the build draws it: the private parent blurred, the picture censored in its slot. + await expect(card(page).locator('[data-post-parent="0"][data-redacted]')).toHaveCount(1, { timeout: 30_000 }); + await expect(page.locator('[data-post-media="0"]')).toHaveAttribute("data-post-blurred", "band", { timeout: 15_000 }); + await page.keyboard.press("p"); + await expect(root(page)).toHaveAttribute("data-present-state", "paused"); + await page.waitForTimeout(500); + await shot(page, "present-post.png"); + await page.goto(urls.presentHref(PROJECT, { slide: "c01" })); + await expect(root(page)).toHaveAttribute("data-present-slide", "c01", { timeout: 30_000 }); + await expect.poll(() => page.locator("[data-present-clip-video]").evaluate((v: HTMLVideoElement) => v.readyState), { timeout: 15_000 }).toBeGreaterThanOrEqual(2); + await page.keyboard.press("p"); + await shot(page, "present-clip.png"); + await page.goto(urls.presentHref(PROJECT, { slide: "section-1" })); + await expect(page.locator("[data-present-section-label]")).toHaveText("The posts", { timeout: 30_000 }); + await shot(page, "present-section.png"); +}); + +test("the settings persist across a reload; narration off silences the take; a censor toggle changes the card", async ({ page }) => { + await page.goto(urls.presentHref(PROJECT, { slide: "presentchan-x/1" })); + await expect(root(page)).toHaveAttribute("data-present-settings-loaded", "1", { timeout: 30_000 }); + await page.evaluate(() => window.localStorage.removeItem("umtool.present.settings.v1")); + await page.reload(); + await expect(root(page)).toHaveAttribute("data-present-slide", "presentchan-x/1", { timeout: 30_000 }); + await expect(root(page)).toHaveAttribute("data-present-settings-loaded", "1"); + + // As the build draws it, by default: the made-up name a bar, its letters nowhere in the card. + await expect(card(page).locator("[data-post-blanked]")).toHaveCount(2, { timeout: 30_000 }); + await expect(card(page).locator("[data-post-words]")).not.toContainText("Quentin"); + // The narration: its take, heard. + const voice = page.locator("audio[data-post-narration-audio]"); + await expect(voice).toHaveCount(1); + expect(await voice.evaluate((a: HTMLAudioElement) => a.muted)).toBe(false); + + await page.keyboard.press("s"); + const drawer = page.locator("[data-present-settings]"); + await expect(drawer).toBeVisible(); + // The kinds this slide carries, counted. + await expect(drawer.locator('[data-present-censor-count="names"]')).toHaveText("2 here"); + await expect(drawer.locator('[data-present-censor-count="authors"]')).toHaveText("1 here"); + await expect(drawer.locator('[data-present-censor-count="pictures"]')).toHaveText("1 here"); + + // Narration off: the take is silent. + await drawer.locator('[data-present-toggle="narration"]').uncheck(); + await expect.poll(() => voice.evaluate((a: HTMLAudioElement) => a.muted)).toBe(true); + // A censor toggle: the redacted name shown, the card drawn again. + await drawer.locator('[data-present-toggle="names"]').uncheck(); + await expect(card(page).locator("[data-post-words]")).toContainText("Quentin Example", { timeout: 30_000 }); + await expect(card(page).locator("[data-post-blanked]")).toHaveCount(0); + // The pictures: as captured. + await drawer.locator('[data-present-toggle="pictures"]').uncheck(); + await expect(page.locator('[data-post-media="0"]')).not.toHaveAttribute("data-post-blurred", /.+/); + await drawer.locator('[data-present-toggle="autoAdvance"]').check(); + await drawer.locator("[data-present-linger]").fill("3"); + + // Reloaded: every setting as left. + await page.reload(); + await expect(root(page)).toHaveAttribute("data-present-settings-loaded", "1", { timeout: 30_000 }); + await page.keyboard.press("s"); + await expect(drawer.locator('[data-present-toggle="narration"]')).not.toBeChecked(); + await expect(drawer.locator('[data-present-toggle="names"]')).not.toBeChecked(); + await expect(drawer.locator('[data-present-toggle="pictures"]')).not.toBeChecked(); + await expect(drawer.locator('[data-present-toggle="slurs"]')).toBeChecked(); + await expect(drawer.locator('[data-present-toggle="autoAdvance"]')).toBeChecked(); + await expect(drawer.locator("[data-present-linger]")).toHaveValue("3"); + await expect(card(page).locator("[data-post-words]")).toContainText("Quentin Example", { timeout: 30_000 }); + expect(await voice.evaluate((a: HTMLAudioElement) => a.muted)).toBe(true); + + // Names back on: the bar again. + await drawer.locator('[data-present-toggle="names"]').check(); + await expect(card(page).locator("[data-post-blanked]")).toHaveCount(2, { timeout: 30_000 }); + // Escape closes the drawer; settings back to the defaults for the next run. + await page.keyboard.press("Escape"); + await expect(drawer).toHaveCount(0); + await page.evaluate(() => window.localStorage.removeItem("umtool.present.settings.v1")); +}); + +test("auto-advance moves on once a slide is read and its linger is over", async ({ page }) => { + await page.goto(urls.presentHref(PROJECT, { slide: "section-1" })); + await expect(root(page)).toHaveAttribute("data-present-settings-loaded", "1", { timeout: 30_000 }); + await page.evaluate(() => window.localStorage.setItem("umtool.present.settings.v1", JSON.stringify({ autoAdvance: true, linger: 0.2 }))); + await page.reload(); + await expect(root(page)).toHaveAttribute("data-present-slide", "section-1", { timeout: 30_000 }); + // A section divider reads for 2.5 s: then the post after it. + await expect(root(page)).toHaveAttribute("data-present-slide", "presentchan-x/1", { timeout: 10_000 }); + await page.evaluate(() => window.localStorage.removeItem("umtool.present.settings.v1")); +}); + +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)); +});