Archilyzer · Source

archilyzer

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

commit 6bdbc1b3dc84067b4ea7f70bdd7a9b563bb884d9
parent 463c19d3ac697782d31bc8e9574e103fd1735d3c
Author: I Mean I'm Just Saying <imeanimjustsaying@kiwifarms.st>
Date:   Fri, 23 Oct 2026 16:26:00 -0400

clip blur: the Blur box's checkbox shows the click at once (reverting to the saved state when the write is refused); the spec asserts the saved key and the box after it

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

Diffstat:
Mumtool/components/projects/review/ClipKnobs.tsx | 13+++++++++++--
Mumtool/e2e/clip-blur.spec.ts | 5+++++
2 files changed, 16 insertions(+), 2 deletions(-)

diff --git a/umtool/components/projects/review/ClipKnobs.tsx b/umtool/components/projects/review/ClipKnobs.tsx @@ -489,7 +489,16 @@ export function BlurBox({ busy: boolean; write: Write; }) { - const set = (patch: Record<string, unknown> | null, done: string) => void write({ op: "blur", clip: clipId, blur: patch }, done); + const set = (patch: Record<string, unknown> | null, done: string) => write({ op: "blur", clip: clipId, blur: patch }, done); + // The checkbox shows the click at once (onDraft) until the view comes back: + // the saved state then, which is the old one again when the write is refused + // (its sentence in the editor's error line). + const [onDraft, setOnDraft] = useState<{ clip: string; on: boolean } | null>(null); + const checked = onDraft?.clip === clipId ? onDraft.on : !!blur; + const toggle = (on: boolean) => { + setOnDraft({ clip: clipId, on }); + void set(on ? { on: true } : null, on ? "The picture is blurred in the render" : "The picture plays as recorded").finally(() => setOnDraft(null)); + }; const fallback = defaults?.caption ?? "Original footage uncensored, blurred here for TOS"; const shown = blur?.caption ?? fallback; const [caption, setCaption] = useState(shown); @@ -510,7 +519,7 @@ export function BlurBox({ <section id="clip-blur" data-blur-box={clipId} data-blur={JSON.stringify(blur ?? null)} className={box}> <div className="flex flex-wrap items-baseline gap-2"> <label className="inline-flex items-center gap-1.5 text-text"> - <input type="checkbox" data-blur-on="" checked={!!blur} disabled={busy} onChange={(e) => set(e.target.checked ? { on: true } : null, e.target.checked ? "The picture is blurred in the render" : "The picture plays as recorded")} /> + <input type="checkbox" data-blur-on="" checked={checked} disabled={busy} onChange={(e) => toggle(e.target.checked)} /> <span className="micro">Blur picture</span> </label> <span className="text-muted">for footage a platform&rsquo;s rules would refuse: the picture blurred, the sound as it is</span> diff --git a/umtool/e2e/clip-blur.spec.ts b/umtool/e2e/clip-blur.spec.ts @@ -36,7 +36,10 @@ test("the Blur box: on, a caption, a strength, from the playhead, the whole clip const box = page.locator('[data-blur-box="r003"]'); await box.locator("[data-blur-on]").check(); + // The box shows the click at once, and the write lands: the saved key, and the view's box after it. await expect.poll(() => entry("r003")?.blur).toEqual({ on: true }); + await expect(box).toHaveAttribute("data-blur", JSON.stringify({ on: true })); + await expect(box.locator("[data-blur-on]")).toBeChecked(); await expect(page.locator("[data-editor-blurred]")).toHaveAttribute("data-editor-blurred", "on"); await expect(box.locator("[data-blur-caption]")).toHaveValue(DEFAULT_CAPTION); @@ -60,6 +63,8 @@ test("the Blur box: on, a caption, a strength, from the playhead, the whole clip await box.locator("[data-blur-on]").uncheck(); await expect.poll(() => entry("r003") && "blur" in entry("r003")!).toBe(false); + await expect(box).toHaveAttribute("data-blur", "null"); + await expect(box.locator("[data-blur-on]")).not.toBeChecked(); await expect(page.locator("[data-editor-blurred]")).toHaveCount(0); });