commit 25a96f0d7b3e883b9a63ae0f5e0d7b766fcd07cb
parent cbc0741e443e1c89215a40400dcd76346a588c2f
Author: I Mean I'm Just Saying <imeanimjustsaying@kiwifarms.st>
Date: Wed, 11 Nov 2026 20:51:13 -0500
umtool: the record page decides 'Filter before keeping' when the last part lands, with the post's character awaited -- a part that landed before the character had loaded was kept at once
Co-Authored-By: Claude <noreply@anthropic.com>
Diffstat:
2 files changed, 18 insertions(+), 8 deletions(-)
diff --git a/umtool/components/projects/RecordSession.tsx b/umtool/components/projects/RecordSession.tsx
@@ -167,7 +167,14 @@ export default function RecordSession({ project, items: initial, start, box }: {
setSemitones(String(j.preview?.filtered?.asked?.semitones ?? w.convert?.semitones ?? 0));
takePreview(j.preview ?? null);
setFjob(j.job && j.job.state === "running" ? j.job : null);
+ return w;
}, [project, item.id, takePreview]);
+ // Whether the last part in WAITS (Filter before keeping), asked when it lands: what a person set, else whether the
+ // post's character converts -- the character awaited, so a part that lands before it has loaded is not kept at once.
+ const whoReady = useRef<Promise<Who | null>>(Promise.resolve(null));
+ const reviewAsked = useRef<boolean | null>(null);
+ reviewAsked.current = reviewSet;
+ const waits = useCallback(async () => reviewAsked.current ?? !!(await whoReady.current.catch(() => null))?.convert?.voice, []);
useEffect(() => {
setWho(null);
setPreview(null);
@@ -176,7 +183,8 @@ export default function RecordSession({ project, items: initial, start, box }: {
setFjob(null);
setSaved(null);
setStock({ state: "idle" });
- void loadWho();
+ whoReady.current = loadWho();
+ void whoReady.current.catch(() => {});
}, [loadWho]);
// LEAVING the post (another one, the page closed): its scratch dir goes -- unless its Filter is still running.
const running = useRef(false);
@@ -335,9 +343,9 @@ export default function RecordSession({ project, items: initial, start, box }: {
const s = j.session;
const next = parts.findIndex((q) => !(s.parts[String(q.n)] && s.count === parts.length));
// The last part in: the take is made -- or, with "Filter before keeping", the post waits to be filtered and kept.
- if (next < 0 && !review) await finish();
- else if (next >= 0) setCur(next);
- }, [phase, mic, parts, cur, project, item.id, finish, review]);
+ if (next >= 0) setCur(next);
+ else if (!(await waits())) await finish();
+ }, [phase, mic, parts, cur, project, item.id, finish, waits]);
// A sound file for the current part (a recording made elsewhere: a phone's recorder, the LAN where the mic is off).
const takeFile = useCallback(
@@ -361,10 +369,10 @@ export default function RecordSession({ project, items: initial, start, box }: {
setSession(j.session);
const sdoc = j.session;
const next = parts.findIndex((q) => !(sdoc.parts[String(q.n)] && sdoc.count === parts.length));
- if (next < 0 && !review) await finish();
- else if (next >= 0) setCur(next);
+ if (next >= 0) setCur(next);
+ else if (!(await waits())) await finish();
},
- [phase, parts, cur, project, item.id, finish, review],
+ [phase, parts, cur, project, item.id, finish, waits],
);
// FILTER: the character's recorded preset as one job -- clean, cut at the marks, convert -- into the scratch dir.
@@ -440,7 +448,8 @@ export default function RecordSession({ project, items: initial, start, box }: {
if (!set.ok) setError(String(set.j.error ?? "its convert was not set"));
}
setBusy(null);
- await loadWho();
+ whoReady.current = loadWho();
+ await whoReady.current.catch(() => null);
setSaved(`${id} is this video's own character for @${item.handle} now`);
}, [item.handle, voices, who, asked, loadWho]);
diff --git a/umtool/e2e/record-filter.spec.ts b/umtool/e2e/record-filter.spec.ts
@@ -272,6 +272,7 @@ test("opened over http from the LAN the microphone is off, and the page says so;
await expect(s(page)).toHaveAttribute("data-record-phase", "idle");
await expect(page.locator("[data-record-error]")).toHaveCount(0);
// A sound file for the part: filtered, previewed and kept as a recording made here would be.
+ await expect(page.locator("[data-record-character]")).toHaveAttribute("data-record-character", "madam-savvy");
await page.locator("[data-record-file]").setInputFiles(MIC_WAV);
await expect(page.locator('[data-record-wave="1"]')).toBeVisible({ timeout: 20_000 });
await page.locator("[data-record-filter]").click();