feat: add Cancel Recording button to HUD#295
feat: add Cancel Recording button to HUD#295abres33 wants to merge 3 commits intosiddharthvaddem:mainfrom
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughAdds a cancelRecording API to the screen recorder hook and exposes it in the LaunchWindow UI; stops and discards active recordings without auto-finalization. Adds tooltip translations for English, Spanish, and Chinese and adjusts an e2e test's error handling around HUD evaluate. Changes
Sequence Diagram(s)sequenceDiagram
participant UI as LaunchWindow (UI)
participant Hook as useScreenRecorder
participant Recorder as ScreenRecorderManager
UI->>Hook: user clicks Cancel button (while recording)
Hook->>Recorder: set discardRecordingId, disable allowAutoFinalize
Hook->>Recorder: stopRecording()
Recorder-->>Hook: stopped (no auto-finalize / discarded)
Hook-->>UI: recording state updated (stopped)
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (1 warning, 1 inconclusive)
✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
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 |
|
@siddharthvaddem Identified and fixed a pre-existing E2E test failure unrelated to the cancel recording feature. The gif-export test had a try/catch inside the |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@tests/e2e/gif-export.spec.ts`:
- Around line 61-69: The evaluate callback should await setCurrentVideoPath
before calling switchToEditor to avoid a race: change the hudWindow.evaluate
callback to await window.electronAPI.setCurrentVideoPath(videoPath); then await
window.electronAPI.switchToEditor(); and make the surrounding catch block stop
silently swallowing errors — only ignore the exception when it is the expected
page/window-close error and otherwise rethrow or log the error so legitimate
failures in setCurrentVideoPath are surfaced (follow the same sequential-await
pattern used in LaunchWindow.tsx and reference hudWindow.evaluate,
setCurrentVideoPath, switchToEditor).
🪄 Autofix (Beta)
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: defaults
Review profile: CHILL
Plan: Pro
Run ID: 8d27e573-fa92-46e5-94a8-96e696573f4b
📒 Files selected for processing (1)
tests/e2e/gif-export.spec.ts
Description
Adds a Cancel button to the recording HUD that discards the current recording and returns the app to idle - without saving the footage or opening the editor.
Motivation
The existing HUD offers Stop (saves + opens editor) and Restart (discards + restarts immediately). There was no way to simply abandon a recording and return to idle without committing to a new recording right away. Cancel fills that gap for cases where the user needs to re-configure their setup before recording again.
Type of Change
Screenshot
Testing
Checklist
Summary by CodeRabbit
New Features
Tests