Skip to content

feat(editor): return-to-recording action and project menu (#513) - #796

Open
iOSDevSK wants to merge 1 commit into
webadderallorg:mainfrom
iOSDevSK:feat/editor-return-to-recording-and-project-menu
Open

feat(editor): return-to-recording action and project menu (#513)#796
iOSDevSK wants to merge 1 commit into
webadderallorg:mainfrom
iOSDevSK:feat/editor-return-to-recording-and-project-menu

Conversation

@iOSDevSK

@iOSDevSK iOSDevSK commented Aug 7, 2026

Copy link
Copy Markdown

Closes part of #513.

Problem

Once you are in the editor there is no way out. #513 asks for a "Return to recording" action in the editor header, and today the only way to discard a recording and get back to the source picker is to quit the whole app and relaunch it.

While implementing that I hit a second, related gap: on Windows and Linux a project cannot be saved at all. Save Project, Save Project As and Open Projects exist only as macOS application-menu items, and setupApplicationMenu() calls Menu.setApplicationMenu(null) on every other platform. There is no renderer-side keybinding and no button, so those accelerators simply do not exist off macOS.

Changes

Return to recording

  • Camera button in the editor header, and a second one on the "no video to load" screen where the user is otherwise stuck with only Open Projects.
  • Goes through the existing confirmReplaceSourceWithUnsavedChanges flow, so the user gets the familiar Save project / Discard changes / Cancel dialog rather than losing work.
  • Refused while an export is running — leaving closes the editor window, which would kill the export with no feedback.
  • New switch-to-recording IPC handler in the main process.

Two ordering details in returnToRecording() that are easy to get wrong:

  • The HUD is shown before the editor window is closed. window-all-closed quits the app on non-darwin platforms, so a window has to exist throughout. Reassigning mainWindow first also stops the editor's own closed handler (if (mainWindow === editorWindow)) from nulling the freshly restored HUD reference.
  • The editor is closed via closeEditorWindowBypassingUnsavedPrompt. The renderer has already asked about unsaved changes at that point, but editorHasUnsavedChanges is still true in the main process, so a plain window.close() would pop the native "Unsaved Changes" dialog a second time.

Project menu

New header dropdown so the project actions are discoverable and, more importantly, available on every platform:

  • New recording (⌘N / Ctrl+N)
  • New project from file…
  • Open projects… (⌘O / Ctrl+O)
  • Save project (⌘S / Ctrl+S)
  • Save project as… (⇧⌘S / Ctrl+Shift+S)

The editor now binds Ctrl+S, Ctrl+Shift+S and Ctrl+O itself only off macOS — on macOS those accelerators belong to the application menu and are swallowed before the keydown reaches the renderer, so binding them in both places would double-fire (visibly bad for Ctrl+O, which toggles the projects popover). Cmd/Ctrl+N is bound on all platforms since no menu item claims it.

The four new combinations are added to FIXED_SHORTCUTS, so findConflict() stops users from rebinding a configurable action on top of them.

Not included

Ripple delete — the timeline half of #513 (Backspace/Delete on a clip, shifting subsequent clips and regions left) — is not part of this PR. It is a much larger change to the timeline model and is better reviewed separately.

i18n

editor.actions.returnToRecording, editor.actions.returnToRecordingBlockedByExport and six editor.project.* keys, translated for all 10 locales in SUPPORTED_LOCALES plus the ru directory that i18n-check also validates.

Verification

  • npm test — 996 tests across 106 files pass
  • tsc --noEmit — clean
  • npm run i18n:check — locale files structurally consistent
  • biome format / biome lint — no new findings on the touched files
  • Packaged with electron-builder for macOS arm64 and launch-tested

🤖 Generated with Claude Code

Summary by CodeRabbit

  • New Features
    • Added project controls for creating, opening, saving, and saving projects under a new name.
    • Added quick actions and keyboard shortcuts for recording and project management.
    • Added the ability to return from the video editor to the recording view.
    • Added options to show recordings in their containing folder.
  • Bug Fixes
    • Prevented returning to recording while an export is in progress.
    • Added unsaved-changes protection when leaving the editor.
  • Localization
    • Added translations for the new actions and messages across supported languages.

…lorg#513)

Adds the "Return to recording" action requested in webadderallorg#513 and makes the
project file actions reachable from the editor UI.

Return to recording:
- New camera button in the editor header (and on the "no video" screen)
  that leaves the editor and brings the recording HUD back.
- Reuses the existing unsaved-changes dialog, so the project can be
  saved, discarded, or the action canceled.
- Blocked while an export is running, since closing the editor window
  would otherwise kill the export silently.
- In the main process the HUD is shown *before* the editor window is
  closed: on non-macOS platforms `window-all-closed` quits the app, so a
  window has to exist at all times. The editor is closed through
  `closeEditorWindowBypassingUnsavedPrompt` so the native "Unsaved
  Changes" prompt does not fire a second time after the renderer dialog.

Project menu:
- New header dropdown with New recording, New project from file,
  Open projects, Save project and Save project as.
- Save/Save As/Open were previously reachable only through the macOS
  application menu. Windows and Linux run with
  `Menu.setApplicationMenu(null)`, so there was no way to save a project
  at all on those platforms. The editor now binds Ctrl+S, Ctrl+Shift+S
  and Ctrl+O itself off macOS, and Cmd/Ctrl+N everywhere.
- The new bindings are registered in FIXED_SHORTCUTS so users cannot
  rebind a configurable action on top of them.

Ripple delete, the other half of webadderallorg#513, is not part of this change.

Translations added for all 10 supported locales plus ru; `npm run
i18n:check` passes.

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

coderabbitai Bot commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

The editor now supports returning to recording, project creation and management, keyboard shortcuts, project menus, and localized labels. Electron exposes the recording transition through the preload bridge and IPC handler.

Changes

Editor to recording navigation

Layer / File(s) Summary
Recording IPC transition
electron/electron-env.d.ts, electron/preload.ts, electron/main.ts
The Electron API exposes switchToRecording. The main process restores or creates the recording HUD and closes the editor without its native unsaved-changes prompt.
Editor return controls
src/components/video-editor/VideoEditor.tsx
The editor blocks return during export, handles unsaved changes, pauses playback, reports errors, and adds return controls to loading, error, and header states.
Project actions and localization
src/components/video-editor/VideoEditor.tsx, src/lib/shortcuts.ts, src/i18n/locales/*/editor.json
The editor adds project actions and platform-aware shortcuts. All listed locales add labels for recording navigation and project operations.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Sequence Diagram(s)

sequenceDiagram
  participant VideoEditor
  participant Preload
  participant ElectronMain
  participant RecordingHUD
  VideoEditor->>Preload: switchToRecording()
  Preload->>ElectronMain: switch-to-recording IPC
  ElectronMain->>RecordingHUD: restore or create HUD
  ElectronMain->>VideoEditor: close editor without native prompt
Loading

Possibly related PRs

Suggested reviewers: meiiie, webadderall

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description check ✅ Passed The description clearly covers the problem, motivation, changes, exclusions, localization, and testing, but omits the template checklist and screenshots or video.
Title check ✅ Passed The title clearly summarizes the main editor changes: the return-to-recording action and project menu.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@src/components/video-editor/VideoEditor.tsx`:
- Around line 4600-4603: Update the keyboard shortcut branch in VideoEditor’s
key handler so the "n" path calls handleReturnToRecording only when the
control/meta modifier is valid and e.shiftKey is false, leaving Ctrl/Cmd+Shift+N
unhandled.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: c0ef0b3c-a684-4120-aec4-c94fa2044afa

📥 Commits

Reviewing files that changed from the base of the PR and between 54ae801 and 81a8a45.

📒 Files selected for processing (16)
  • electron/electron-env.d.ts
  • electron/main.ts
  • electron/preload.ts
  • src/components/video-editor/VideoEditor.tsx
  • src/i18n/locales/de/editor.json
  • src/i18n/locales/en/editor.json
  • src/i18n/locales/es/editor.json
  • src/i18n/locales/fr/editor.json
  • src/i18n/locales/it/editor.json
  • src/i18n/locales/ko/editor.json
  • src/i18n/locales/nl/editor.json
  • src/i18n/locales/pt-BR/editor.json
  • src/i18n/locales/ru/editor.json
  • src/i18n/locales/zh-CN/editor.json
  • src/i18n/locales/zh-TW/editor.json
  • src/lib/shortcuts.ts

Comment on lines +4600 to +4603
if (key === "n") {
e.preventDefault();
void handleReturnToRecording();
return;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Ignore Shift for the New Recording shortcut.

Ctrl+Shift+N and Cmd+Shift+N also return to recording because this branch does not check e.shiftKey. This shortcut is not displayed or registered. Require !e.shiftKey before handling key === "n".

Proposed fix
-			if (key === "n") {
+			if (key === "n" && !e.shiftKey) {
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
if (key === "n") {
e.preventDefault();
void handleReturnToRecording();
return;
if (key === "n" && !e.shiftKey) {
e.preventDefault();
void handleReturnToRecording();
return;
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/components/video-editor/VideoEditor.tsx` around lines 4600 - 4603, Update
the keyboard shortcut branch in VideoEditor’s key handler so the "n" path calls
handleReturnToRecording only when the control/meta modifier is valid and
e.shiftKey is false, leaving Ctrl/Cmd+Shift+N unhandled.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant