Skip to content

Fix macOS warm-start recording finalization - #829

Merged
webadderall merged 3 commits into
mainfrom
codex/macos-recording-resume-fix
Aug 24, 2026
Merged

Fix macOS warm-start recording finalization#829
webadderall merged 3 commits into
mainfrom
codex/macos-recording-resume-fix

Conversation

@webadderall

@webadderall webadderall commented Aug 24, 2026

Copy link
Copy Markdown
Collaborator

Description

Fix macOS recordings that could leave a zero-byte MP4 after the countdown warm-start pause/resume. Also improve the stop-button visual and idle HUD click-through behavior.

Motivation

Audio could deliver the first post-resume sample before video and consume the shared timestamp adjustment. The following video timestamp could then move backwards, causing AVAssetWriter to fail and leave an empty recording. The idle HUD padding also intercepted clicks outside the visible controls.

Type of Change

  • New Feature
  • Bug Fix
  • Refactor / Code Cleanup
  • Documentation Update
  • Other (please specify)

Related Issue(s)

None.

Screenshots / Video

Not attached. The stop control is now a filled white square inside the existing red circular recording button.

Testing Guide

  1. Start a screen recording on macOS with the countdown enabled.
  2. Stop the recording and confirm the editor opens a non-empty, playable MP4.
  3. With no recording active, click immediately below/outside the visible HUD and confirm the click passes through.
  4. During recording, confirm the stop control remains clickable.

Automated validation:

  • 1,015 Vitest tests passed
  • TypeScript typecheck passed
  • Swift typecheck passed
  • arm64 and x64 macOS native helpers rebuilt successfully

Checklist

  • I have performed a self-review of my code.
  • I have added any necessary screenshots or videos.
  • I have linked related issue(s) and updated the changelog if applicable.

@coderabbitai

coderabbitai Bot commented Aug 24, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 699fbb29-f180-4a35-ac11-5b4218a2f0f9

📥 Commits

Reviewing files that changed from the base of the PR and between b937f71 and 8378342.

📒 Files selected for processing (9)
  • electron/native/ScreenCaptureKitRecorder.swift
  • electron/native/ScreenCaptureKitRecorder.test.ts
  • electron/native/bin/darwin-arm64/recordly-screencapturekit-helper
  • electron/native/bin/darwin-x64/recordly-screencapturekit-helper
  • src/components/launch/LaunchWindow.module.css
  • src/components/launch/LaunchWindow.tsx
  • src/components/launch/RecordingControls.tsx
  • src/components/launch/hooks/useLaunchHudInteractionState.ts
  • src/hooks/useScreenRecorder.ts

Included review availability: Your plan provides up to 10 included reviews per hour; 9 remain after this review.


📝 Walkthrough

Walkthrough

The recorder now rejects non-monotonic timestamps and anchors resumed audio to the first post-resume video sample. The launch HUD updates pointer handling and timing. The stop control uses a styled native button. Diagnostics require a non-empty output file.

Changes

Recording and launch behavior

Layer / File(s) Summary
Capture timestamp integrity
electron/native/ScreenCaptureKitRecorder.swift, electron/native/ScreenCaptureKitRecorder.test.ts
The recorder tracks and resets per-track timestamps, rejects non-increasing video and audio samples, anchors resumed audio to video, and tests these behaviors.
Launch controls and HUD interaction
src/components/launch/LaunchWindow.tsx, src/components/launch/LaunchWindow.module.css, src/components/launch/RecordingControls.tsx, src/components/launch/hooks/useLaunchHudInteractionState.ts
The HUD delegates pointer handling to its bar, uses immediate mouse-ignore actions, and renders the stop control with a styled native button.
Recording output diagnostics
src/hooks/useScreenRecorder.ts
Diagnostics include the output path only when the recorded file size is greater than zero.

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

Merge Risk: ⚪ Minimal · up to 83783

The PR is merge-ready after normal checks and review; no actionable merge-blocking risk remains.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed Docstring check was indeterminate for this PR — some files could not be analyzed in time. Not blocking.
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.
Title check ✅ Passed The title clearly summarizes the primary macOS warm-start recording finalization fix.
Description check ✅ Passed The description covers the purpose, motivation, change type, testing steps, validation results, and checklist status.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/macos-recording-resume-fix

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.

@webadderall

Copy link
Copy Markdown
Collaborator Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Aug 24, 2026

Copy link
Copy Markdown
Contributor
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@webadderall
webadderall marked this pull request as ready for review August 24, 2026 08:09
@webadderall
webadderall merged commit b190446 into main Aug 24, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant