fix(desktop): keep header aligned after zoom changes - #5235
Conversation
- Sync the Linux title bar overlay height with renderer zoom - Add desktop zoom menu handlers and regression coverage - Preserve sidebar header spacing after zoom
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
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. Comment |
ApprovabilityVerdict: Needs human review This bug fix adds new event listeners and zoom synchronization logic to desktop window management on Windows/Linux platforms. While the changes are well-tested and self-contained, the new runtime behavior (keyboard shortcut detection, zoom event handling) combined with the author being new to these files warrants human review. You can customize Macroscope's approvability policy. Learn more. |
Closes: #5232
What Changed
Why
Zooming the renderer could leave the desktop title bar overlay at its original height, causing the header and sidebar content to become misaligned. This updates the overlay whenever zoom changes and covers the behavior with platform-specific tests.
UI Changes
Before:

After:

Checklist
Note
Low Risk
Desktop window chrome and menu zoom behavior only; no auth, data, or backend changes. Risk is limited to Electron title bar overlay sizing on non-macOS platforms.
Overview
Fixes #5232 by keeping the native title bar overlay aligned with renderer zoom on Linux/Windows desktop, and nudging sidebar header padding so chrome stays visually consistent.
On non-macOS,
resolveTitleBarOverlayHeightscales overlay height when zoom factor exceeds 1, andsyncWindowTitleBarHeightruns after load, onzoom-changed, and when zoom keyboard shortcuts are detected.syncAppearancenow applies overlay height fromgetZoomFactor()as well. The View menu on Linux/Windows uses custom zoom click handlers that adjustzoomLeveland calldesktopWindow.syncAppearance(macOS keeps Electron role-based zoom items).SidebarChromechanges header vertical padding frompy-0topy-2. Tests cover menu zoom + appearance sync and Linux title bar overlay updates.Reviewed by Cursor Bugbot for commit 9eb8014. Bugbot is set up for automated code reviews on this repo. Configure here.
Note
Fix desktop title bar alignment after zoom changes on non-macOS platforms
resolveTitleBarOverlayHeightutil, so the header stays aligned after zooming.DesktopWindowlistens forzoom-changedandbefore-input-event(keyboard zoom shortcuts) to resync the title bar height after each zoom change.DesktopApplicationMenuadds explicit Zoom In/Out/Actual Size menu items with click handlers on non-macOS (macOS continues to use role-based items), each callingdesktopWindow.syncAppearanceafter adjustingwebContents.zoomLevel.py-0topy-2inSidebarChromeHeader.Macroscope summarized 9eb8014.