Record your screen, ship a demo. Free and open-source, GPU-accelerated, no watermarks, no subscriptions. Windows, macOS, Linux. Actively maintained.
TypeScript cross-platformelectronffmpegopen-sourceproduct-demorustscreen-capturescreen-recorderscreen-recordingscreen-studioscreencastspeech-to-texttypescriptvideo-editingvideo-editorwaylandwgpuwhisper
fix(rec): leave the auto-zoom hand-off alone across a project switch
EtienneLescot6af19360fa9d
diff --git a/src/components/ai-edition/recordingImport.test.ts b/src/components/ai-edition/recordingImport.test.tsindex 6d7f31e28..c98cbb32e 100644--- a/src/components/ai-edition/recordingImport.test.ts+++ b/src/components/ai-edition/recordingImport.test.ts@@ -424,6 +424,24 @@ describe("fresh-recording auto-zoom", () => {}});+ // The prefs read yields, and the user can open another project before it answers.+ // That project is not the take's: nothing is written to it and the hand-off survives.+ it("leaves a project opened during the prefs read alone, and keeps the hand-off", async () => {+ markFreshRecordingAutoZoomPending(RECORDING_PATH);+ const opened = documentWithClip();+ const other = { ...opened, project: { ...opened.project, id: "p_other" } };+ stubRecordingPrefsBridge(async () => {+ useProjectStore.setState({ document: other });+ return { autoZoomEnabled: true };+ });+ const next = await applyPendingFreshRecordingAutoZooms(documentWithClip(), {+ getTelemetry: async () => dwell(4000, 0.5, 0.5),+ createId: (prefix) => `${prefix}_test`,+ });+ expect(next).toBe(other);+ expect(consumeFreshRecordingAutoZoomPending()).toBe(true);+ });+// The stop handler awaits `writePendingCursorTelemetry` before it publishes the// session, so the sidecar is on disk by the time a take can be imported. An empty// read is therefore the take's real answer, not a mid-flush one, and leaving thediff --git a/src/components/ai-edition/recordingImport.ts b/src/components/ai-edition/recordingImport.tsindex e27892cc1..7a530dfda 100644--- a/src/components/ai-edition/recordingImport.ts+++ b/src/components/ai-edition/recordingImport.ts@@ -175,11 +175,14 @@ export async function applyPendingFreshRecordingAutoZooms(return document;}const enabled = deps.enabled ?? (await readAutoZoomPref(deps.prefsTimeoutMs));+ const start = liveDocument(document);+ // The read yields. A project opened meanwhile is not this take's to decorate, and+ // not the place to spend its hand-off either: the pass that comes back with it will.+ if (start.project.id !== document.project.id) return start;if (!enabled) {clearFreshRecordingAutoZoomPending();- return liveDocument(document);+ return start;}- const start = liveDocument(document);if (markDecoratedIfZoomed(start)) return start;if (!canApplyFreshRecordingAutoZooms(start)) return start;