Archilyzer · Source

archilyzer

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

commit c3bc4f0ba29a1dde36a305240abf813c73e64937
parent 832d2b8b82aa793b23b40d83b138b327437f3a92
Author: I Mean I'm Just Saying <imeanimjustsaying@kiwifarms.st>
Date:   Sun,  1 Nov 2026 15:05:04 -0500

umtool e2e markers-cap: the Markers editor adds a fourteenth marker (14 of 32), two rows made subsections and saved as level 2, a leading subsection said and the save held, and the route refusing one in the build's words (fixture: markers-cap-fixture, sixteen clips)

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

Diffstat:
Mumtool/e2e/fixtures/knobs-fixture.mjs | 23++++++++++++++++++++++-
Aumtool/e2e/markers-cap.spec.ts | 70++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
2 files changed, 92 insertions(+), 1 deletion(-)

diff --git a/umtool/e2e/fixtures/knobs-fixture.mjs b/umtool/e2e/fixtures/knobs-fixture.mjs @@ -9,6 +9,8 @@ // (the encoder stubbed: variants.e2e.mjs) and the Sync table // knobs-deck-fixture the deck on (make-fixture.mjs deckManifest), two clips // -- the Markers editor +// markers-cap-fixture the deck on, sixteen clips -- past twelve markers, +// subsections // // Synthetic, like every fixture. import { copyFileSync, mkdirSync, readFileSync, writeFileSync } from "node:fs"; @@ -44,5 +46,24 @@ export function makeKnobsFixture({ reports, manifest, deckManifest, cachedWindow 2, ) + "\n", ); - return { dir, deckDir }; + // markers-cap-fixture: the deck on, sixteen clips -- the Markers editor past + // the old twelve, a subsection row, and a leading one refused + // (markers-cap.spec.ts). + const capDir = path.join(reports, "markers-cap-fixture"); + mkdirSync(capDir, { recursive: true }); + writeFileSync( + path.join(capDir, "video.manifest.json"), + JSON.stringify( + deckManifest( + "markers-cap-fixture", + "The Markers Cap Fixture", + Array.from({ length: 16 }, (_, i) => ({ + type: "clip", id: `m${String(i + 1).padStart(2, "0")}`, video: "vid1", start: 3.0, end: 6.0, cite: 3, section: 0, lock: true, quote: "and because", + })), + ), + null, + 2, + ) + "\n", + ); + return { dir, deckDir, capDir }; } diff --git a/umtool/e2e/markers-cap.spec.ts b/umtool/e2e/markers-cap.spec.ts @@ -0,0 +1,70 @@ +import { test, expect } from "@playwright/test"; +import { readFileSync } from "node:fs"; +import path from "node:path"; +import { fileURLToPath } from "node:url"; +import * as urls from "./urls"; + +// --------------------------------------------------------------------------- +// The deck past twelve markers, and subsections (2026-11-01): the On-screen +// Markers editor adds a fourteenth (the cap is 32, marker-limits.mjs), a row's +// "sub" makes it a subsection (`level: 2`) and the save writes it; a +// subsection as the cut's first marker is refused before a save, and by the +// route in the build's words. +// Fixture: e2e/fixtures/knobs-fixture.mjs (markers-cap-fixture, sixteen clips). +// --------------------------------------------------------------------------- + +const HERE = path.dirname(fileURLToPath(import.meta.url)); +const PROJECT = "reports/markers-cap-fixture"; +const DIR = path.join(HERE, "..", ".e2e-song", "reports", "markers-cap-fixture"); +type Marker = { after: string; label?: string; level?: number }; +const markers = (): Marker[] => JSON.parse(readFileSync(path.join(DIR, "video.manifest.json"), "utf8")).render.chrome?.deck?.markers ?? []; +const tokenOf = async (request: import("@playwright/test").APIRequestContext) => + (await (await request.get(`/api/report/chrome?project=${encodeURIComponent(PROJECT)}`)).json()).token; + +test("the Markers editor: fourteen markers, two of them subsections; a leading subsection refused", async ({ page, request }) => { + test.setTimeout(150_000); + const fonts = JSON.parse(readFileSync(path.join(DIR, "video.manifest.json"), "utf8")).render.fontRegular; + test.skip(!fonts, "the deck refuses to draw without render.fontRegular/fontBold, and make-fixture.mjs found no font on this machine"); + const reset = await request.put("/api/report/chrome", { data: { project: PROJECT, token: await tokenOf(request), markers: [], markerLayout: null } }); + expect(reset.ok(), await reset.text()).toBe(true); + + await page.setViewportSize({ width: 1366, height: 900 }); + await page.goto(urls.section(PROJECT, "onscreen")); + const ed = page.getByTestId("markers-editor"); + await expect(ed).toBeVisible({ timeout: 30_000 }); + // Past the old twelve: fourteen rows, each after the next clip; still room for more. + for (let i = 0; i < 14; i += 1) { + await ed.getByTestId("markers-add").click(); + await ed.getByTestId(`marker-label-${i}`).fill(`Part ${i + 1}`); + } + await expect(ed).toContainText("14 of 32"); + await expect(ed.getByTestId("markers-add")).toBeEnabled(); + await expect(ed.getByTestId("marker-after-13")).toHaveValue("m14"); + // Two subsections. + await ed.getByTestId("marker-sub-3").check(); + await ed.getByTestId("marker-sub-7").check(); + await expect(ed.getByTestId("marker-row-3")).toHaveAttribute("data-level", "2"); + await expect(ed.getByTestId("markers-level-refused")).toHaveCount(0); + await ed.getByTestId("markers-save").click(); + await expect.poll(() => markers().length, { timeout: 30_000 }).toBe(14); + expect(markers().map((m, i) => [i, m.level ?? 1]).filter(([, l]) => l === 2)).toEqual([[3, 2], [7, 2]]); + expect(markers()[3]).toEqual({ after: "m04", label: "Part 4", level: 2 }); + + // A subsection as the cut's first marker: said, and the save held. + await expect(ed.getByTestId("marker-row-3")).toHaveAttribute("data-level", "2", { timeout: 30_000 }); + await ed.getByTestId("marker-sub-0").check(); + await expect(ed.getByTestId("markers-level-refused")).toContainText("a subsection needs a section before it"); + await expect(ed.getByTestId("markers-save")).toBeDisabled(); + await ed.getByTestId("marker-sub-0").uncheck(); + await expect(ed.getByTestId("markers-level-refused")).toHaveCount(0); + await expect(ed.getByTestId("markers-save")).toBeEnabled(); + + // The route refuses it in the build's words, and writes nothing. + const before = markers(); + const r = await request.put("/api/report/chrome", { + data: { project: PROJECT, token: await tokenOf(request), markers: [{ after: "m02", label: "Sub", level: 2 }, { after: "m05", label: "Section" }] }, + }); + expect(r.ok()).toBe(false); + expect(await r.text()).toContain("is a subsection (level 2) with no section before it"); + expect(markers()).toEqual(before); +});