commit 51439ebe060e1f13d8a5acf8afe84d6a5003454a
parent 29c18264a1eb90badd4e349054f805c5c6717d6c
Author: I Mean I'm Just Saying <imeanimjustsaying@kiwifarms.st>
Date: Fri, 23 Oct 2026 16:26:16 -0400
Merge lane/clip-blur: the Blur picture box shows a click at once (it was reset until the write returned)
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Diffstat:
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’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);
});