fix(desktop): stabilize Windows titlebar zoom#25813
Merged
Hona merged 2 commits intoanomalyco:devfrom May 5, 2026
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR improves zoom behavior in the desktop Electron app to keep the Windows titlebar overlay and caption controls visually stable during zoom changes, and to reduce snap/flicker by aligning renderer zoom state updates with Electron zoom application.
Changes:
- Deferred renderer-side
webviewZoomsignal updates until aftersetZoomFactorcompletes, while tracking the last requested zoom. - Added Windows titlebar overlay resizing logic based on the current zoom factor, and refreshed overlay on zoom changes.
- Updated the app titlebar layout on Windows to account for zoom (including counter-zooming and native controls spacing).
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| packages/desktop-electron/src/renderer/webview-zoom.ts | Tracks requested zoom and delays reactive zoom state updates until IPC completes. |
| packages/desktop-electron/src/main/windows.ts | Persists titlebar theme per window and recalculates overlay height based on zoom factor. |
| packages/desktop-electron/src/main/ipc.ts | Updates the Windows titlebar overlay when zoom is set via IPC. |
| packages/app/src/components/titlebar.tsx | Adjusts Windows titlebar layout/spacing for zoom and introduces counter-zooming for small zoom levels. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+24
to
+27
| void window.api.setZoomFactor(next).then(() => { | ||
| if (requestedZoom !== next) return | ||
| setWebviewZoom(next) | ||
| }) |
| const minHeight = () => (mac() ? `${40 / zoom()}px` : undefined) | ||
| const titlebarZoom = () => (windows() ? Math.max(zoom(), minTitlebarZoom) : zoom()) | ||
| const counterZoom = () => (windows() && titlebarZoom() < 1 ? 1 / titlebarZoom() : 1) | ||
| const minHeight = () => (mac() || windows() ? `${titlebarHeight / Math.min(titlebarZoom(), 1)}px` : undefined) |
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.
Summary
Testing
bun typecheckinpackages/appbun typecheckinpackages/desktop-electron