fix(code): restore zoom after external resize#3571
Merged
Conversation
Generated-By: PostHog Code Task-Id: 33078092-6d41-45e8-8375-157f66bcea43
|
😎 Merged manually by @richardsolomou - details. |
|
React Doctor found no issues in the changed files. 🎉 Reviewed by React Doctor for commit |
Generated-By: PostHog Code Task-Id: 33078092-6d41-45e8-8375-157f66bcea43
Contributor
|
✅ Visual changes approved by @richardsolomou — baseline updated in 1 changed. |
Generated-By: PostHog Code Task-Id: 33078092-6d41-45e8-8375-157f66bcea43
Generated-By: PostHog Code Task-Id: 33078092-6d41-45e8-8375-157f66bcea43
richardsolomou
marked this pull request as ready for review
July 20, 2026 06:14
Contributor
|
Reviews (1): Last reviewed commit: "fix(code): avoid redundant zoom restorat..." | Re-trigger Greptile |
1 updated Run: 2ef00186-bf99-4380-a1a0-a510133e43c2 Co-authored-by: richardsolomou <2622273+richardsolomou@users.noreply.github.com>
adboio
approved these changes
Jul 20, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
External window managers such as Magnet or Rectangle can resize the Electron window without emitting the manual-resize completion event. Chromium can reset the visible zoom to 100% while the app still tracks the previous level, so the next zoom input jumps from a stale baseline.
Why: Window snapping should not change the visible app zoom or desynchronise it from the stored level.
Closes #2959
Changes
Restore the current in-memory zoom after every Electron
resizeevent, but only callsetZoomLevelwhen Chromium has diverged from it. Ignore queued work after renderer teardown and keep wheel zoom changes serialized with restoration.How did you test this?
pnpm --filter code exec vitest run src/main/zoom.test.tspnpm turbo typecheck --filter=@posthog/codepnpm exec biome check apps/code/src/main/zoom.ts apps/code/src/main/zoom.test.tsAutomatic notifications
Created with PostHog Code