Skip to content

make t3code look cool on windows and linux (custom&overlay title bar)#1929

Open
tarik02 wants to merge 15 commits intopingdotgg:mainfrom
tarik02:feature/linux-titlebar-platform-layout
Open

make t3code look cool on windows and linux (custom&overlay title bar)#1929
tarik02 wants to merge 15 commits intopingdotgg:mainfrom
tarik02:feature/linux-titlebar-platform-layout

Conversation

@tarik02
Copy link
Copy Markdown

@tarik02 tarik02 commented Apr 11, 2026

What Changed

This PR adds Linux-only option for native/custom/overlay title bar and contains minor platform detection refactoring:

  • added a persisted Linux title bar mode: native, overlay, custom
  • exposed desktop shell chrome state to the web app through the desktop bridge
  • implemented platform-specific Electron chrome options:
    • macOS: preserve native hiddenInset traffic lights
    • Linux: native / WCO overlay / custom controls
    • Windows: transparent WCO with theme-aware symbol colors
  • added shared desktop chrome layout helpers for safe header spacing
  • render custom window controls only for Linux custom mode
  • added Linux settings UI for switching title bar mode

Why

This change keeps desktop chrome policy in one place, refactors platform detection.

Now t3code looks better on Windows and Linux, feels more integrated just like it is on macOS.

UI Changes

macOS was checked as well, no visual regressions found.

Before (Linux)

t3code-native

After (Linux)

Custom mode:
t3code-custom

Overlay mode:
image
(Electron doesn't support custom window button order currently - this option is better for people using controls on the right)

Settings:
t3code-settings

Before (Windows)

image

After (Windows)

image

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

Add custom and overlay title bar support for Windows and Linux in the desktop app

  • Introduces platform-aware window chrome configuration via getWindowChromeOptions and getWindowControlsLayout in env.ts, covering macOS, Windows (overlay with symbolColor per theme), and Linux (native/overlay/custom modes).
  • Adds LinuxTitleBarMode setting ('native'|'overlay'|'custom') with persistence, IPC handlers, and a settings UI in SettingsPanels.tsx that prompts restart on change.
  • Detects Linux window control placement from KDE kwinrc or GNOME gsettings in linuxWindowControls.ts with fallback to right-side controls.
  • Renders a custom DesktopChromeOverlay with clickable minimize/maximize/close buttons for Linux custom mode and applies safe-area CSS variables at the app root via resolveDesktopChromeRootStyle.
  • Exposes new preload bridge methods: getPlatform, getLinuxTitleBarMode, setLinuxTitleBarMode, getWindowControlsLayout, minimizeWindow, toggleMaximizeWindow, closeWindow, and restartApp.
  • Risk: switching Linux title bar mode requires an app restart; overlay mode uses a transparent color workaround for Electron limitations.

Macroscope summarized 2e59768.


Note

Medium Risk
Medium risk because it changes Electron window creation/chrome options, adds new IPC surface for window control/restart, and persists new desktop settings, which could affect startup/window behavior across platforms (especially Linux).

Overview
Adds a persisted Linux-only linuxTitleBarMode desktop setting (native | overlay | custom) and applies it during Electron BrowserWindow creation via new getWindowChromeOptions logic.

Introduces centralized desktop platform/window-controls layout utilities (apps/desktop/src/env.ts) and Linux window button layout detection (KDE kwinrc / GNOME gsettings, with fallback).

Expands the desktop preload/main IPC bridge with platform/titlebar/layout queries plus window control actions (minimize, toggleMaximize, close, restart), and updates the web UI headers/sidebar/settings to render overlay-safe draggable chrome and custom Linux window controls when enabled.

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

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Apr 11, 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: 2756c114-b0ca-498a-b7a2-b46a79ca946b

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:XL 500-999 changed lines (additions + deletions). vouch:unvouched PR author is not yet trusted in the VOUCHED list. labels Apr 11, 2026
@macroscopeapp
Copy link
Copy Markdown
Contributor

macroscopeapp bot commented Apr 11, 2026

Approvability

Verdict: Needs human review

This PR introduces substantial new functionality (custom title bars for Windows/Linux) with new UI components, IPC channels, and settings. Additionally, there is an unresolved high-severity review comment about window controls being blocked by z-index issues, which would make the feature unusable for many Linux users.

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

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 9a2bc17. Configure here.

</div>
) : (
wordmark
)}
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.

Right-side Linux window controls blocked by z-indexed overlay

High Severity

In the SidebarChromeHeader when usesCustomLinuxWindowControls is active, the LinuxWindowControls are positioned absolute at the default z-index, while the wordmark wrapper sits on top at z-[1] with flex-1 making it span the full header width. This means the wordmark div intercepts all pointer events across its entire width, making any right-side window control buttons (close, minimize, maximize) unclickable — they're rendered beneath the wordmark overlay. Since the default/fallback Linux layout places all controls on the right (left: [], right: ["minimize", "maximize", "close"]), most Linux users in custom title bar mode would be unable to close, minimize, or maximize the window from the sidebar header.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 9a2bc17. Configure here.

@tarik02 tarik02 marked this pull request as draft April 12, 2026 07:46
@tarik02 tarik02 changed the title make t3code look cool on linux (custom&overlay title bar) make t3code look cool on windows and linux (custom&overlay title bar) Apr 12, 2026
@tarik02 tarik02 marked this pull request as ready for review April 12, 2026 12:41
@juliusmarminge
Copy link
Copy Markdown
Member

Hey I took another approach here (more css driven when possible with tailwind variants etc): #1800

might be good to merge the 2 PRs as i can see some good stuff from both. I don't have a linux machine to test on yet

@tarik02
Copy link
Copy Markdown
Author

tarik02 commented Apr 12, 2026

@juliusmarminge will take a look
probably it's good idea to remove that switch from settings at all (and custom title bar) and just implement the same approach for both windows&linux

also made PR to electron to fix WCO order: electron/electron#50978

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:XL 500-999 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