Archilyzer · Source

archilyzer

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

commit cbc0741e443e1c89215a40400dcd76346a588c2f
parent 825f4f1e17a577a4edd594fa8ea3cf53f997c30b
Author: I Mean I'm Just Saying <imeanimjustsaying@kiwifarms.st>
Date:   Wed, 11 Nov 2026 20:43:15 -0500

umtool: the record page -- the stale-preview hint shows after a Filter has run, the keys wait while a Filter runs, 'Filter before keeping' does not flicker off while the next post's character loads; the spec follows

Co-Authored-By: Claude <noreply@anthropic.com>

Diffstat:
Mumtool/components/projects/RecordSession.tsx | 15++++++++++++---
Mumtool/e2e/record-filter.spec.ts | 11+++++++----
2 files changed, 19 insertions(+), 7 deletions(-)

diff --git a/umtool/components/projects/RecordSession.tsx b/umtool/components/projects/RecordSession.tsx @@ -132,7 +132,10 @@ export default function RecordSession({ project, items: initial, start, box }: { setReviewSet(v === "1" ? true : v === "0" ? false : null); }, []); const converts = !!who?.convert?.voice; - const review = reviewSet ?? converts; + // On by itself for a post whose character converts; while the next post's character loads it stays as it was. + const autoReview = useRef(false); + if (who) autoReview.current = converts; + const review = reviewSet ?? (who ? converts : autoReview.current); const pitched = !!who?.convert?.engine && (who.pitchEngines ?? []).includes(who.convert.engine); const semis = Number(semitones || 0); const semisBad = pitched && pitch !== "target" && !(Number.isFinite(semis) && Math.abs(semis) <= 12); @@ -480,6 +483,12 @@ export default function RecordSession({ project, items: initial, start, box }: { if (ev.metaKey || ev.ctrlKey || ev.altKey) return; // A button keeps its own Enter and Space (a cut mark keeps its arrows): the page's keys are for hands off it. const onButton = !!tgt?.closest("button, a, [role=slider]"); + // While the Filter runs the recording it reads is not recorded over: the keys wait for it (n / p still walk). + const filtering = fjob?.state === "running"; + if (filtering && (ev.key === " " || ev.key === "r" || ev.key === "Backspace" || ev.key === "Enter" || ev.key === "f")) { + if (!onButton) ev.preventDefault(); + return; + } if (ev.key === " ") { if (onButton) return; ev.preventDefault(); @@ -503,7 +512,7 @@ export default function RecordSession({ project, items: initial, start, box }: { }; window.addEventListener("keydown", onKey); return () => window.removeEventListener("keydown", onKey); - }, [phase, stop, record, redo, done, item.recorded, session.parts, go, parts.length, reviewing, again, filter, keep, micOk]); + }, [phase, stop, record, redo, done, item.recorded, session.parts, go, parts.length, reviewing, again, filter, keep, micOk, fjob?.state]); // Play a kept part back, or the placeholder's part for reference. const player = useRef<HTMLAudioElement | null>(null); @@ -858,7 +867,7 @@ export default function RecordSession({ project, items: initial, start, box }: { Again (Backspace) </button> </div> - {!current && preview?.raw && !fjob && <div className="text-[12.5px] text-amber-300" data-record-preview-stale="">the marks or the pitch moved since the Filter: Filter again to hear and keep them</div>} + {!current && preview?.raw && filtered && fjob?.state !== "running" && <div className="text-[12.5px] text-amber-300" data-record-preview-stale="">the marks or the pitch moved since the Filter: Filter again to hear and keep them</div>} {fjob && ( <FilterProgress job={fjob} diff --git a/umtool/e2e/record-filter.spec.ts b/umtool/e2e/record-filter.spec.ts @@ -124,10 +124,12 @@ test("Filter runs the character's recorded preset as one job into a preview (no await expect(page.locator("[data-record-keep]")).toHaveAttribute("data-record-keep-what", "recording"); // A cut mark moved (a keyboard click at the start): four presses of the arrow, 0.2 s in. const from = page.locator('[data-record-mark="from"]'); - await expect(from).toHaveAttribute("data-record-mark-at", "0"); + const markAt = async () => Number(await from.getAttribute("data-record-mark-at")); + const auto = await markAt(); await from.focus(); for (let i = 0; i < 4; i += 1) await page.keyboard.press("ArrowRight"); - await expect(from).toHaveAttribute("data-record-mark-at", "0.2"); + await expect.poll(markAt).toBeCloseTo(auto + 0.2, 2); + await expect(page.locator("[data-record-span-auto]")).toBeVisible(); await shot(page, "record-filter-marks"); // FILTER (f): one job -- the clean skipped (the stub has no enhance engine), cut, converted; its wait at the heavy @@ -148,7 +150,7 @@ test("Filter runs the character's recorded preset as one job into a preview (no expect(narr("p-1").takes ?? []).toHaveLength(0); const asked = converts().at(-1)!; expect(asked).toMatchObject({ engine: "seed-vc", voice: "kokoro:af_bella", pitch: "contour", semitones: 2 }); - expect(asked.file).toBe(path.join(SCRATCH("1"), "raw.wav")); + expect(asked.file).toMatch(/narration\/\.record-preview\/1\.operator\/raw\.wav$/); await expect(panel).toHaveAttribute("data-record-preview-current", "1"); await expect(page.locator("[data-record-preview-note]").first()).toContainText("not cleaned"); // Raw and filtered, side by side. @@ -191,7 +193,6 @@ test("Filter runs the character's recorded preset as one job into a preview (no expect(n.takes![1]).toMatchObject({ file: "narration/posts/1/take-2.convert-seed-vc.wav", engine: "derived", voice: "af_bella", source: { kind: "take", from: "take-1.recorded-operator" } }); expect(n.takes![1].steps![0]).toMatchObject({ op: "convert", engine: "seed-vc", voice: "kokoro:af_bella", pitch: "source", semitones: 2 }); for (const t of n.takes!) expect(existsSync(path.join(DIR, t.file))).toBe(true); - // The mark held: 0.2 s off the start of what was recorded. expect(converts()).toHaveLength(convertsBefore); expect(existsSync(SCRATCH("1"))).toBe(false); expect(existsSync(path.join(NARRATION, "posts", "1", ".recording-operator"))).toBe(false); @@ -284,6 +285,8 @@ test("opened over http from the LAN the microphone is off, and the page says so; await shot(page, "record-filter-lan"); // "Filter before keeping" off: the last part makes the recorded take at once, as before. + await expect(page.locator("[data-record-character]")).toHaveAttribute("data-record-character", "madam-savvy"); + await expect(page.locator("[data-record-review]")).toBeChecked(); await page.locator("[data-record-review]").uncheck(); await page.locator("[data-record-file]").setInputFiles(MIC_WAV); await expect(page.locator("[data-record-status]")).toContainText("take-1.recorded-operator.wav", { timeout: 30_000 });