Skip to content

window controls overlay (windows&linux)#1969

Merged
juliusmarminge merged 10 commits intopingdotgg:mainfrom
tarik02:feature/wco
Apr 13, 2026
Merged

window controls overlay (windows&linux)#1969
juliusmarminge merged 10 commits intopingdotgg:mainfrom
tarik02:feature/wco

Conversation

@tarik02
Copy link
Copy Markdown
Contributor

@tarik02 tarik02 commented Apr 12, 2026

What Changed

Added support for window controls overlay on Windows and Linux. It makes titlebar controls render inside app area. Layout was changed to account this and move buttons/logo so they don't intersect with controls.

Why

Because it makes app look better and makes it use less vertical space.

UI Changes

Before (Linux):

image

After (Linux):

Знімок екрана 2026-04-13 о 00 16 41

After (Linux, custom electron build):

Знімок екрана 2026-04-13 о 00 12 23

Before (Windows):

image

After (Windows):

Знімок екрана 2026-04-13 о 00 13 22

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

Medium Risk
Adjusts Electron window chrome and multiple header layouts to integrate Window Controls Overlay; regressions are possible in cross-platform window sizing/drag regions and theme-driven titlebar rendering.

Overview
Adds Window Controls Overlay support for the Electron desktop app on Windows/Linux by switching non-macOS windows to titleBarStyle: "hidden" with a themed titleBarOverlay, and re-syncing overlay/background on nativeTheme changes.

Updates web UI headers (chat, sidebar, diff panel, settings, empty state) to apply wco:-scoped layout insets and dynamic titlebar height so content/buttons don’t overlap native window controls, including an optional reserveTitleBarControlInset behavior when the diff panel is open.

Introduces a wco Tailwind variant and a small runtime (syncDocumentWindowControlsOverlayClass) that toggles a .wco class based on navigator.windowControlsOverlay visibility in Electron.

Reviewed by Cursor Bugbot for commit a1ef380. Bugbot is set up for automated code reviews on this repo. Configure here.

Note

Add window controls overlay support for Windows and Linux in Electron

  • Adds platform-specific title bar configuration in main.ts: macOS keeps the existing hiddenInset style, while Windows/Linux use a hidden style with a native title bar overlay sized and colored to match the system theme.
  • Syncs overlay appearance and background color at runtime when nativeTheme changes, keeping all open windows consistent with the current light/dark mode.
  • Adds a windowControlsOverlay helper that toggles a wco CSS class on the document root based on overlay visibility, exposed as a Tailwind variant in index.css.
  • Updates headers in ChatView, DiffPanelShell, NoActiveThreadState, Sidebar, and Settings to reserve space for native window controls when the overlay is active, adjusting height and padding via the wco variant.
  • The chat header stops reserving the right-side title bar inset when the diff panel is open.

Macroscope summarized a1ef380.

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Apr 12, 2026

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

Run ID: 550f7cc4-4ae6-42bc-bf7d-4dbe98114272

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
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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 and usage tips.

@github-actions github-actions bot added size:L 100-499 changed lines (additions + deletions). vouch:unvouched PR author is not yet trusted in the VOUCHED list. labels Apr 12, 2026
Comment on lines +1682 to +1692
function syncWindowAppearance(window: BrowserWindow): void {
if (window.isDestroyed()) {
return;
}

window.setBackgroundColor(getInitialWindowBackgroundColor());
const { titleBarOverlay } = getWindowTitleBarOptions();
if (typeof titleBarOverlay === "object") {
window.setTitleBarOverlay(titleBarOverlay);
}
}
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.

🟡 Medium src/main.ts:1682

syncWindowAppearance calls window.setTitleBarOverlay() whenever titleBarOverlay is an object, but this API is Windows-only and throws on Linux. Since getWindowTitleBarOptions() returns titleBarOverlay for both Windows and Linux in its else branch, Linux will crash when nativeTheme fires an updated event.

  window.setBackgroundColor(getInitialWindowBackgroundColor());
   const { titleBarOverlay } = getWindowTitleBarOptions();
   if (typeof titleBarOverlay === "object") {
+    if (process.platform === "win32") {
       window.setTitleBarOverlay(titleBarOverlay);
+    }
   }
 }
🤖 Copy this AI Prompt to have your agent fix this:
In file apps/desktop/src/main.ts around lines 1682-1692:

`syncWindowAppearance` calls `window.setTitleBarOverlay()` whenever `titleBarOverlay` is an object, but this API is Windows-only and throws on Linux. Since `getWindowTitleBarOptions()` returns `titleBarOverlay` for both Windows and Linux in its else branch, Linux will crash when `nativeTheme` fires an `updated` event.

Copy link
Copy Markdown
Contributor Author

@tarik02 tarik02 Apr 12, 2026

Choose a reason for hiding this comment

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

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.

Sorry, I'm unable to act on this request because you do not have permissions within this repository.

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.

Sorry, I'm unable to act on this request because you do not have permissions within this repository.

Copy link
Copy Markdown
Contributor

@cursor cursor bot left a comment

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 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 d82bdbd. Configure here.

@macroscopeapp
Copy link
Copy Markdown
Contributor

macroscopeapp bot commented Apr 12, 2026

Approvability

Verdict: Needs human review

This PR introduces a new platform feature (window controls overlay for Windows/Linux) that changes native titlebar behavior in the Electron app. Additionally, an unresolved review comment identifies a potential crash bug on Linux where a Windows-only API is being called unconditionally.

You can customize Macroscope's approvability policy. Learn more.

@juliusmarminge
Copy link
Copy Markdown
Member

now this feels like a good solution 👍

@import "tailwindcss";

@custom-variant dark (&:is(.dark, .dark *));
@custom-variant wco (&:is(.wco, .wco *));
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

descriptive comment would be nice, not an acronym that immediately pops into mind

@juliusmarminge juliusmarminge enabled auto-merge (squash) April 13, 2026 07:18
@juliusmarminge juliusmarminge merged commit dff8784 into pingdotgg:main Apr 13, 2026
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:L 100-499 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.

2 participants