Skip to content

fix(web): prevent Windows titlebar shift after restore - #5996

Open
thiscallnet wants to merge 1 commit into
pingdotgg:mainfrom
thiscallnet:fix/windows-titlebar-restore
Open

fix(web): prevent Windows titlebar shift after restore#5996
thiscallnet wants to merge 1 commit into
pingdotgg:mainfrom
thiscallnet:fix/windows-titlebar-restore

Conversation

@thiscallnet

@thiscallnet thiscallnet commented Aug 10, 2026

Copy link
Copy Markdown

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

  • This PR is small and focused
  • I explained what changed and why
  • I included before/after screenshots for any UI changes
  • I included a video for animation/interaction changes

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.

syncDocumentWindowControlsOverlayClass now keeps the last good native control geometry on Windows when the Window Controls Overlay is temporarily unavailable during restore: it can leave the wco class applied, writes --workspace-native-controls-width from getTitlebarAreaRect, and skips that preservation in fullscreen via new win32 fullscreen IPC from DesktopWindow.

CSS adds .electron-windows / .wco variables (fixed 40px topbar height, native-control insets) so layout does not depend on transitional env(titlebar-area-*) values during restore.

Headers (diff panel, settings, usage, right-panel sheet) switch from hardcoded h-[52px] / env(...) padding to workspace-topbar and --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

  • Revamps syncDocumentWindowControlsOverlayClass in windowControlsOverlay.ts to track fullscreen state and overlay geometry separately, keeping the wco class active on Windows when the overlay becomes temporarily hidden (e.g. after restore from maximized) to prevent layout shift
  • Adds CSS variables (--workspace-topbar-height, --workspace-native-controls-inset, etc.) under .electron-windows in index.css so components can size/pad consistently without hardcoded heights or calc() expressions
  • Extends full-screen event listeners in DesktopWindow.ts to cover win32 in addition to darwin, so the renderer knows when to drop the preserved wco class during fullscreen
  • Updates header rows in diff panel, settings, usage, and project settings pages to use workspace-topbar and var(--workspace-native-controls-inset) instead of fixed heights and calc-based padding

Macroscope summarized 021bfb1.

@coderabbitai

coderabbitai Bot commented Aug 10, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 62aa98a3-b369-401d-9742-eea4703c5237

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions github-actions Bot added vouch:unvouched PR author is not yet trusted in the VOUCHED list. size:M 30-99 changed lines (additions + deletions). labels Aug 10, 2026
Comment thread apps/web/src/lib/windowControlsOverlay.ts Outdated
Comment thread apps/web/src/lib/windowControlsOverlay.ts Outdated
@macroscopeapp

macroscopeapp Bot commented Aug 10, 2026

Copy link
Copy Markdown
Contributor

Approvability

Verdict: 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.

@thiscallnet
thiscallnet force-pushed the fix/windows-titlebar-restore branch from 311ec12 to 3df68bf Compare August 10, 2026 12:47
Comment thread apps/web/src/index.css
@thiscallnet
thiscallnet force-pushed the fix/windows-titlebar-restore branch from 3df68bf to 3a6912a Compare August 10, 2026 13:10
@github-actions github-actions Bot added size:L 100-499 changed lines (additions + deletions). and removed size:M 30-99 changed lines (additions + deletions). labels Aug 10, 2026
Comment thread apps/web/src/lib/windowControlsOverlay.ts Outdated
@thiscallnet
thiscallnet force-pushed the fix/windows-titlebar-restore branch from 3a6912a to ab688c9 Compare August 10, 2026 13:36
@github-actions github-actions Bot added size:M 30-99 changed lines (additions + deletions). and removed size:L 100-499 changed lines (additions + deletions). labels Aug 10, 2026

@cursor cursor Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes using high effort and found 1 potential issue.

Fix All in Cursor

❌ 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.

Comment thread apps/web/src/lib/windowControlsOverlay.ts Outdated
@thiscallnet
thiscallnet force-pushed the fix/windows-titlebar-restore branch from ab688c9 to 375cc3c Compare August 10, 2026 14:03
@thiscallnet
thiscallnet force-pushed the fix/windows-titlebar-restore branch from 375cc3c to 021bfb1 Compare August 10, 2026 16:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:M 30-99 changed lines (additions + deletions). vouch:unvouched PR author is not yet trusted in the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant