fix(editor): import a recording once, so reopening keeps the project you saved - #366
Conversation
…you saved The HUD parks a finished recording in one main-process slot and opens the editor, which imports it into a fresh project on mount. Nothing ever emptied that slot, and opening the editor destroys and recreates its window — so the second open imported the same file again: a new project at the default padding, roundness and wallpaper, with everything the user had set and saved stranded in the project that was no longer on screen. Consume the hand-off once the recording lives in a project. A later mount then takes the existing 'reopen the most recent project' path, which lands on that same project. Two projects on this machine point at one recording file, created two minutes apart, both with an empty settings envelope.
|
Warning Review limit reached
Next review available in: 10 minutes You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (3)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Summary
The recorder hands a finished recording to the editor through one main-process slot (
set/getCurrentRecordingSession), andNewEditorShell's mount effect imports whatever sits in that slot into a new project. Nothing emptied it, and opening the editor destroys and recreates its window (createEditorWindowWrapper) — so the second open imported the same recording again, into a second project at the default padding / roundness / wallpaper, leaving everything the user had set and saved in the project that was no longer on screen. From the outside that is "the editor forgot my settings on reopen" — the settings were never lost, the project was.This consumes the hand-off as soon as the recording lives in a project. A later mount then falls through to the path that was already there — reopen the most recently updated project — which is the project that recording went into, settings and all.
src/components/ai-edition/recordingImport.ts(new): the import, plus thesetCurrentRecordingSession(null)that ends it. Lifted out of the shell's mount effect so the "once, and only once" part is testable at all.NewEditorShell.tsx: the effect now calls it and keeps its existing fallback.No new IPC —
setCurrentRecordingSessionalready acceptsnulland is whatclearCurrentVideoPathuses internally. The only other reader of the slot is the CLI runner, which lives in its own process.Related issue
Fixes #364
Type of change
Release impact
Desktop impact
Testing
npx vitest --run src/components/ai-edition— 20 files, 113 tests, green, including the four new cases inrecordingImport.test.ts.setCurrentRecordingSession(null)line turns two of those four red (a second mount imports the same recording again), so the test does hold the fix down.npx tsc --noEmit,npx tsc -p tsconfig.test.json --noEmit,npm run linton the touched files: clean.