Skip to content

fix(auto-zoom): apply fresh-recording auto-zoom to portrait window captures on macOS - #1019

Open
untani wants to merge 1 commit into
webadderallorg:mainfrom
untani:fix/portrait-macos-auto-zoom
Open

untani wants to merge 1 commit into
webadderallorg:mainfrom
untani:fix/portrait-macos-auto-zoom

Conversation

@untani

@untani untani commented Sep 23, 2026 •

Copy link
Copy Markdown

Problem

When recording a portrait (vertical) app window on macOS, the automatic fresh-recording auto-zoom never gets applied — and any auto-generated zoom regions get stripped shortly after.

Root cause

shouldAutoApplyFreshRecordingZoomsForSource in src/components/video-editor/timeline/zoomSuggestionUtils.ts gates fresh-recording auto-zoom on the source aspect ratio being >= MIN_FRESH_RECORDING_AUTO_ZOOM_SOURCE_ASPECT_RATIO (1.2):

if (platform === "win32") {
  return true;
}
// ...
return (sourceWidth / sourceHeight) >= MIN_FRESH_RECORDING_AUTO_ZOOM_SOURCE_ASPECT_RATIO;

Windows is already exempted, with the rationale (per the existing comment) that window capture legitimately produces portrait / near-square sources. macOS was not exempted, so any portrait capture (ratio < 1.2) fails the gate:

  • useFreshRecordingAutoZoom cancels the pending auto-suggest for the recording, and
  • the second effect removes existing mode === "auto" zoom regions.

Result: no auto-zoom on portrait recordings on macOS.

Fix

macOS window capture (ScreenCaptureKit) produces the same portrait sources as Windows, and click telemetry is already normalized to the captured window — so aspect ratio is not a valid reason to suppress interaction-based zooms on macOS. Extend the platform exemption to darwin.

if (platform === "win32" || platform === "darwin") {
  return true;
}

Linux behavior is left unchanged.

Tests

Added unit tests in zoomSuggestionUtils.test.ts asserting that narrow / portrait sources on darwin (e.g. 936×1028, 1080×1920) now return true, alongside the existing win32 and platform-less cases.

How to reproduce (before this change)

  1. On macOS, record a single portrait/vertical app window.
  2. Open the recording in the editor.
  3. Auto-zoom is not applied ("no clear interaction moments" / no auto zoom tracks), despite clicks being present.

Summary by CodeRabbit

  • Bug Fixes
    • Fresh recordings of portrait or near-square windows on macOS can now receive automatic interaction-based zooms.

…ptures on macOS

`shouldAutoApplyFreshRecordingZoomsForSource` skipped automatic fresh-recording
zooms whenever a source's aspect ratio was below
`MIN_FRESH_RECORDING_AUTO_ZOOM_SOURCE_ASPECT_RATIO` (1.2). Windows was already
exempted because window capture legitimately produces portrait/near-square
sources, but macOS was not — so recording a vertical (portrait) app window on
macOS suppressed auto-zoom entirely, and the follow-up effect even stripped any
existing auto zoom regions.

macOS window capture (ScreenCaptureKit) produces the same portrait sources, and
click telemetry is already normalized to the captured window, so aspect ratio is
not a valid reason to suppress interaction-based zooms there either. Extend the
platform exemption to `darwin` and cover it with tests.
@coderabbitai

coderabbitai Bot commented Sep 23, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository: webadderallorg/Recordly/.coderabbit.yaml

Review profile: ASSERTIVE

Plan: Advanced

Run ID: d027fcf2-c1e2-41da-95b7-e50422453323

📥 Commits

Reviewing files that changed from the base of the PR and between 1888428 and e4370b2.

📒 Files selected for processing (2)
  • src/components/video-editor/timeline/zoomSuggestionUtils.test.ts
  • src/components/video-editor/timeline/zoomSuggestionUtils.ts

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


📝 Walkthrough

Walkthrough

The fresh-recording zoom eligibility check now allows macOS captures to bypass the aspect-ratio check, as Windows captures already do. A test covers two portrait macOS capture dimensions.

Changes

Recording zoom eligibility

Layer / File(s) Summary
Platform eligibility and test coverage
src/components/video-editor/timeline/zoomSuggestionUtils.ts, src/components/video-editor/timeline/zoomSuggestionUtils.test.ts
The eligibility function allows macOS captures alongside Windows captures. The test checks portrait dimensions of 936x1028 and 1080x1920.

Priority: ➖ Normal

Estimated code review effort: 2 (Simple) | ~8 minutes

Change: Bug fix

Suggested reviewers: webadderall

Merge Risk: ⚪ Minimal · up to e4370

Portrait macOS recordings can now remain eligible for fresh-recording auto-zoom, with the new dimensions covered by tests. No unresolved merge risk is indicated by the supplied context.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 1 functions across 2 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely identifies the macOS auto-zoom fix for portrait window captures.
Description check ✅ Passed The description clearly explains the problem, root cause, fix, tests, and reproduction steps. It does not use the repository template headings and omits the change-type selection, related issue, scree…
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.
  • Fix all pre-merge checks with AI
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create a new PR

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.

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