Skip to content

Add desktop title bar mode settings#2159

Open
Chrono-byte wants to merge 7 commits into
pingdotgg:mainfrom
Chrono-byte:feature/desktop-titlebar-mode
Open

Add desktop title bar mode settings#2159
Chrono-byte wants to merge 7 commits into
pingdotgg:mainfrom
Chrono-byte:feature/desktop-titlebar-mode

Conversation

@Chrono-byte
Copy link
Copy Markdown
Contributor

@Chrono-byte Chrono-byte commented Apr 18, 2026

What Changed

  • Persist native/custom title bar preference
  • Expose IPC bridge and settings UI control
  • Cover the new preference in tests

Why

Some users don't like apps overriding system theming (cough cough Linux users) (me)

UI Changes

image image

Checklist

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

Note

Medium Risk
Moderate risk because it introduces a new persisted desktop setting and new IPC handlers that trigger app relaunch and change BrowserWindow titlebar configuration, which can affect window behavior across platforms.

Overview
Adds a new persisted desktop preference titleBarMode (custom/native) with default custom, including safe parsing/fallback when reading desktop-settings.json.

Exposes the preference over the desktop IPC bridge via getTitleBarMode/setTitleBarMode; setting a new value persists it and relaunches the app, and main.ts now skips custom titleBarOverlay options when titleBarMode is native.

Updates the web-based General settings panel (Electron-only) to load the current mode from the bridge, show a select control with confirmation + restart messaging, and adds/updates tests and stubs to cover the new setting end-to-end.

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

Note

Add title bar mode settings to the desktop app's General Settings panel

  • Adds a titleBarMode field ('custom' | 'native') to DesktopSettings, defaulting to 'custom', with read/write support via readDesktopSettings and setDesktopTitleBarModePreference.
  • Exposes getTitleBarMode and setTitleBarMode IPC endpoints in main.ts and preload.ts so the renderer can query and update the mode.
  • Adds a 'Window titlebar mode' selector to the Electron GeneralSettingsPanel; changing the mode prompts the user to confirm a restart, then calls the desktop bridge and relaunches the app.
  • When titleBarMode is 'native', getWindowTitleBarOptions returns an empty object, causing Electron windows to use the OS native titlebar instead of the custom one.
  • Behavioral Change: switching to native mode triggers an immediate app relaunch after user confirmation.

Macroscope summarized e133fd2.

- Persist native/custom title bar preference
- Expose IPC bridge and settings UI control
- Cover the new preference in tests
Copilot AI review requested due to automatic review settings April 18, 2026 05:18
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 18, 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: d2937654-49b8-4ada-96f5-8f7e40220494

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 vouch:unvouched PR author is not yet trusted in the VOUCHED list. size:L 100-499 changed lines (additions + deletions). labels Apr 18, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds a persisted desktop preference for choosing between the app’s custom title bar and the OS-native window chrome, wiring it through the Electron IPC bridge into the web settings UI with accompanying tests.

Changes:

  • Extend the DesktopBridge IPC contract with getTitleBarMode / setTitleBarMode.
  • Persist titleBarMode in desktop settings and apply it to Electron window creation (with relaunch on change).
  • Add a Settings UI control for “Window titlebar” and cover it with tests/stubs.

Reviewed changes

Copilot reviewed 8 out of 9 changed files in this pull request and generated no comments.

Show a summary per file
File Description
packages/contracts/src/ipc.ts Adds DesktopTitleBarMode and new DesktopBridge IPC methods.
apps/web/src/localApi.test.ts Updates desktop bridge test stub to satisfy the expanded DesktopBridge contract.
apps/web/src/components/settings/SettingsPanels.tsx Adds UI + client logic to read/update title bar mode via window.desktopBridge.
apps/web/src/components/settings/SettingsPanels.browser.tsx Extends bridge stub + adds an interaction test for changing title bar mode after confirmation.
apps/desktop/src/preload.ts Exposes new IPC channels/methods on desktopBridge in the renderer.
apps/desktop/src/main.ts Registers IPC handlers for title bar mode, persists changes, triggers app relaunch, and applies mode in window options.
apps/desktop/src/desktopSettings.ts Adds titleBarMode to persisted settings with default + migration parsing.
apps/desktop/src/desktopSettings.test.ts Adds coverage for defaulting and persisting titleBarMode.
.codex Empty file included in the PR.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@macroscopeapp
Copy link
Copy Markdown
Contributor

macroscopeapp Bot commented Apr 18, 2026

Approvability

Verdict: Needs human review

This PR adds a new user-facing feature (title bar mode preference) with runtime behavior changes including app relaunch. While the implementation follows existing patterns and is well-tested, new features introducing new capabilities warrant human review.

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

Comment thread apps/web/src/components/settings/SettingsPanels.browser.tsx Outdated
Return a runtime getter for isElectron so tests can control whether the
simple AboutVersionTitle or the full AboutVersionSection (which calls
useQueryClient) is rendered by toggling window.desktopBridge or
window.nativeApi
@cristianadrielbraun
Copy link
Copy Markdown

Please! It's not only ugly but I can't use the scrollbar since the custom decorations were introduced. Using custom windows decoration is horrible UX anyway

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.

4 participants