commit c22a2280ee60ff0783d6951a920ea0bf82d073bc
parent 653c80beff6eb78a82d994a9a8b286b21f9e7ba5
Author: I Mean I'm Just Saying <imeanimjustsaying@kiwifarms.st>
Date: Mon, 2 Nov 2026 17:21:11 -0500
umtool e2e: reel-play -- reels track their source: a beat anchored, its clip's end moved under it (flagged, walked alone with the changed filter, old vs new), pulled in past it (clipped, Clamp), the history
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Diffstat:
1 file changed, 39 insertions(+), 1 deletion(-)
diff --git a/umtool/e2e/reel-play.spec.ts b/umtool/e2e/reel-play.spec.ts
@@ -1,5 +1,5 @@
import { test, expect, type Page } from "@playwright/test";
-import { copyFileSync, existsSync, readFileSync, readdirSync, rmSync } from "node:fs";
+import { copyFileSync, existsSync, readFileSync, readdirSync, rmSync, writeFileSync } from "node:fs";
import path from "node:path";
import { fileURLToPath } from "node:url";
import * as urls from "./urls";
@@ -39,11 +39,14 @@ const beatsOf = (reel = "trailer") => {
};
const root = (page: Page) => page.locator("[data-reel-play]");
+const C03 = path.join(OUT, "sourced", "segments", "c03.cut.json");
+
test.beforeAll(() => {
for (const f of ["trailer-beats.json", "teaser-beats.json"]) {
const p = path.join(PROMO, f);
if (!existsSync(`${p}.pristine`)) copyFileSync(p, `${p}.pristine`);
}
+ if (!existsSync(`${C03}.pristine`)) copyFileSync(C03, `${C03}.pristine`);
});
test.beforeEach(() => {
test.setTimeout(120_000);
@@ -53,6 +56,7 @@ test.beforeEach(() => {
}
for (const f of readdirSync(OUT)) if (/\.(trailer|teaser)\.(mp4|json)$/.test(f) || f.endsWith(".trailer.json")) rmSync(path.join(OUT, f), { force: true });
rmSync(NOTES, { force: true });
+ copyFileSync(`${C03}.pristine`, C03);
});
test("the Trailer page lists the reels; a reel plays from the take's rendered master, beat after beat, against the limit; a note lands on its beat", async ({ page }) => {
@@ -220,6 +224,40 @@ test("a beat's gap: Alt + drag on the master's waveform, Cut gap writes it in so
await expect.poll(() => beatsOf()[1]).toEqual({ id: "c03", start: 5, end: 6.5 });
});
+test("reels track their source: a beat anchored to the take, then its clip's end moved under it -- flagged, walked alone, clamped; the history says so", async ({ page }) => {
+ await page.setViewportSize({ width: 1366, height: 1000 });
+ await page.goto(urls.reelWalkHref(PROJECT, { beat: 2 }));
+ await expect(page.locator("[data-reel-source-line]")).toHaveText("no beat is anchored yet");
+ await expect(page.locator("[data-reel-beat-state]")).toHaveAttribute("data-reel-beat-state", "unanchored");
+ await page.locator("[data-reel-anchor]").click();
+ await expect(page.locator("[data-reel-beat-state]")).toHaveAttribute("data-reel-beat-state", "unchanged");
+ expect((beatsOf()[1] as { anchor?: { take: string; clip: { end: number } } }).anchor).toMatchObject({ take: "draft-1", clip: { start: 4.75, end: 6.75 } });
+
+ // The take's record for c03 now ends at 6.6 (as if the clip's edge moved and the take were rendered again):
+ // beat 2 still fits -- its clip's edges moved; the reel says which beat.
+ const rec = JSON.parse(readFileSync(C03, "utf8"));
+ writeFileSync(C03, JSON.stringify({ ...rec, end: 6.6 }));
+ await page.goto(urls.reelWalkHref(PROJECT, { beat: 1 }));
+ await expect(page.locator("[data-reel-source-line]")).toHaveText("take draft-1 changes beat 2");
+ await page.locator("[data-reel-walk-filter='changed']").click();
+ await expect(page).toHaveURL(/beat=2.*changed=1|changed=1.*beat=2/);
+ await expect(page.locator("[data-bench-pos]")).toHaveText("1 of 1 changed beats");
+ await expect(page.locator("[data-reel-beat-state]")).toHaveAttribute("data-reel-beat-state", "edges");
+ await expect(page.locator("[data-reel-beat-was]")).toHaveText("was 0:04.75–0:06.75 · now 0:04.75–0:06.60");
+ await page.screenshot({ path: test.info().outputPath("reel-changed.png") });
+
+ // Pulled in past the beat: clipped, and Clamp fits it back -- anchored to the take it was fixed against.
+ writeFileSync(C03, JSON.stringify({ ...rec, end: 6.3 }));
+ await page.reload();
+ await expect(page.locator("[data-reel-beat-state]")).toHaveAttribute("data-reel-beat-state", "clipped");
+ await page.locator("[data-reel-clamp]").click();
+ await expect.poll(() => (beatsOf()[1] as { end: number }).end).toBe(6.3);
+ await expect(page.locator("[data-reel-beat-state]")).toHaveAttribute("data-reel-beat-state", "unchanged");
+ const hist = JSON.parse(readFileSync(path.join(PROMO, "trailer-beats.history.json"), "utf8")).entries as { what: string; take?: string }[];
+ expect(hist.map((e) => e.what)).toEqual(["anchor beat 2 to take draft-1", "beat 2: start, end"]);
+ expect(hist[1].take).toBe("draft-1");
+});
+
test("Cut the trailer: a job on the runner, its log, the result playing on the page with its local path; a new reel", async ({ page }) => {
await page.setViewportSize({ width: 1366, height: 1000 });
await page.goto(urls.trailerHref(PROJECT, { reel: "teaser" }));