fix(web): prevent Windows titlebar shift after restore - #5996
Conversation
|
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: Approved 021bfb1 Self-contained Windows UI bug fix that prevents titlebar shift during window restore. Changes consolidate CSS layout calculations into variables and add Windows-specific logic to preserve geometry during visibility transitions. Limited to visual/layout behavior with no sensitive or functional impact. You can customize Macroscope's approvability policy. Learn more. |
311ec12 to
3df68bf
Compare
3df68bf to
3a6912a
Compare
3a6912a to
ab688c9
Compare
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using high effort and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit ab688c9. Configure here.
ab688c9 to
375cc3c
Compare
375cc3c to
021bfb1
Compare

What Changed
Stabilizes the Windows desktop titlebar layout across minimize → restore transitions.
The last valid native window-controls geometry is preserved while the Window Controls Overlay is temporarily unavailable during restore, then refreshed once the restored window has settled.
Diff, Usage, Settings, and right-panel headers now use the same stabilized titlebar geometry. Other platforms keep the existing WCO behavior.
Why
On Windows desktop, restoring T3 Code after minimizing could briefly render titlebar content in the wrong position before snapping into place, including content shifting into the native minimize/maximize/close button area.
Preserving the last known-good geometry through the restore transition avoids rendering that intermediate layout while still allowing the native controls geometry to update normally afterwards.
UI Changes
Before
before.mp4
After
after.mp4
Checklist
Note
Low Risk
Desktop UI/layout only on Windows Electron; no auth, data, or API changes. Risk is limited to titlebar geometry regressions on other platforms if WCO sync behavior diverges.
Overview
Fixes a Windows desktop glitch where titlebar content jumped or overlapped the system buttons briefly after minimize → restore.
syncDocumentWindowControlsOverlayClassnow keeps the last good native control geometry on Windows when the Window Controls Overlay is temporarily unavailable during restore: it can leave thewcoclass applied, writes--workspace-native-controls-widthfromgetTitlebarAreaRect, and skips that preservation in fullscreen via new win32 fullscreen IPC fromDesktopWindow.CSS adds
.electron-windows/.wcovariables (fixed 40px topbar height, native-control insets) so layout does not depend on transitionalenv(titlebar-area-*)values during restore.Headers (diff panel, settings, usage, right-panel sheet) switch from hardcoded
h-[52px]/env(...)padding toworkspace-topbarand--workspace-native-controls-inset.Reviewed by Cursor Bugbot for commit 021bfb1. Bugbot is set up for automated code reviews on this repo. Configure here.
Note
Fix Windows titlebar shift after restore by preserving WCO layout during overlay hide
syncDocumentWindowControlsOverlayClassinwindowControlsOverlay.tsto track fullscreen state and overlay geometry separately, keeping thewcoclass active on Windows when the overlay becomes temporarily hidden (e.g. after restore from maximized) to prevent layout shift--workspace-topbar-height,--workspace-native-controls-inset, etc.) under.electron-windowsinindex.cssso components can size/pad consistently without hardcoded heights orcalc()expressionsDesktopWindow.tsto coverwin32in addition todarwin, so the renderer knows when to drop the preservedwcoclass during fullscreenworkspace-topbarandvar(--workspace-native-controls-inset)instead of fixed heights and calc-based paddingMacroscope summarized 021bfb1.