From e4370b2f767b00953f2eb33609552c195482f9f9 Mon Sep 17 00:00:00 2001 From: untani <73132818+untani@users.noreply.github.com> Date: Wed, 23 Sep 2026 12:06:38 -0600 Subject: [PATCH] fix(auto-zoom): apply fresh-recording auto-zoom to portrait window captures on macOS MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit `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. --- .../video-editor/timeline/zoomSuggestionUtils.test.ts | 5 +++++ .../video-editor/timeline/zoomSuggestionUtils.ts | 9 +++++---- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/src/components/video-editor/timeline/zoomSuggestionUtils.test.ts b/src/components/video-editor/timeline/zoomSuggestionUtils.test.ts index 5f237d5eb..8f5872df8 100644 --- a/src/components/video-editor/timeline/zoomSuggestionUtils.test.ts +++ b/src/components/video-editor/timeline/zoomSuggestionUtils.test.ts @@ -42,6 +42,11 @@ describe("shouldAutoApplyFreshRecordingZoomsForSource", () => { expect(shouldAutoApplyFreshRecordingZoomsForSource(936, 1028, "win32")).toBe(true); }); + it("allows narrow macOS window captures (portrait windows) too", () => { + expect(shouldAutoApplyFreshRecordingZoomsForSource(936, 1028, "darwin")).toBe(true); + expect(shouldAutoApplyFreshRecordingZoomsForSource(1080, 1920, "darwin")).toBe(true); + }); + it("does not block when source dimensions are not available yet", () => { expect(shouldAutoApplyFreshRecordingZoomsForSource()).toBe(true); }); diff --git a/src/components/video-editor/timeline/zoomSuggestionUtils.ts b/src/components/video-editor/timeline/zoomSuggestionUtils.ts index fbdc5a68b..9b9430b4f 100644 --- a/src/components/video-editor/timeline/zoomSuggestionUtils.ts +++ b/src/components/video-editor/timeline/zoomSuggestionUtils.ts @@ -45,10 +45,11 @@ export function shouldAutoApplyFreshRecordingZoomsForSource( sourceHeight?: number, platform?: string, ): boolean { - // Window capture on Windows legitimately produces portrait and near-square - // sources. Click telemetry is already normalized to that captured window, so - // its aspect ratio is not a reason to suppress interaction-based zooms. - if (platform === "win32") { + // Window capture on Windows and macOS legitimately produces portrait and + // near-square sources (e.g. recording a single vertical app window). Click + // telemetry is already normalized to that captured window, so its aspect + // ratio is not a reason to suppress interaction-based zooms. + if (platform === "win32" || platform === "darwin") { return true; }