Skip to content

Conversation

nshcr
Copy link
Contributor

@nshcr nshcr commented Oct 7, 2025

Screenshot 2025-10-08 at 05 42 48

This PR adds a toggle for enabling the native title bar style in the UI settings.
I added it as a hidden option in the internal JSON config instead of exposing it in the UI, since enabling it requires restarting the app — and I think using the native title bar somewhat breaks the app's overall design.
It's better not to expose it until the UI fully supports it.

Enabling the native title bar has a few benefits (mostly due to Tauri's limited native feature support), such as better drag behavior (three finger drag support) and more consistent double-click zoom behavior.

Tauri currently binds double-click on data-tauri-drag-region to "maximize", but on macOS this doesn't always match system behavior depending on user settings, which makes GitButler behave inconsistently compared to other apps.

https://github.com/tauri-apps/tauri/blob/19fb6f7cb0d702cb2f25f6f2d1e11014d9dada5d/crates/tauri/src/window/scripts/drag.js#L46-L48

Part of this PR depends on my previous one (#10573). If that one can't be merged, I can modify this PR to make it standalone.
If you think adding this setting makes sense but I've missed something, please let me know how I can improve it. If you don't think this setting should exist, feel free to close it.

Copy link

vercel bot commented Oct 7, 2025

@nshcr is attempting to deploy a commit to the GitButler Team on Vercel.

A member of the Team first needs to authorize it.

@nshcr
Copy link
Contributor Author

nshcr commented Oct 7, 2025

Creating a stack of PRs from GitButler didn't work, so I'm submitting it directly like this.

The first commit in this PR is from the previous one — hope that won't cause any trouble when merging.

@nshcr nshcr force-pushed the feat-native-title-bar branch from 2889727 to 23be94b Compare October 7, 2025 23:16
@Byron
Copy link
Collaborator

Byron commented Oct 8, 2025

Thanks a lot for giving this a go!

I didn't see the new settings in "Appearance" (as mentioned in the PR text as well), but when adding

  "ui": {
    "useNativeTitleBar": true
  },

to the settings file at ~/Library/Application\ Support/gitbutler/settings.json and creating a new application window (or restarting the App) it will show.
This picture shows how the app came up, and a new application window after the settings were changed.

Screenshot 2025-10-08 at 05 17 47

With all that said, as opposed to the traffic-lights PR (#10573), this PR is firmly in the hands of @PavelLaptev :).

@Byron Byron requested a review from PavelLaptev October 8, 2025 03:20
@nshcr
Copy link
Contributor Author

nshcr commented Oct 8, 2025

@Byron Sorry, I forgot to mention where the new setting is stored in the PR description, thanks for pointing that out!

Let me also add a bit more context about how Tauri custom title bar affects certain macOS system behaviors:

Screenshot 2025-10-08 at 12 43 52
  1. macOS allows users to configure double-clicking a window title to Fill / Zoom / Minimize. However, custom title bar (after setting the data-tauri-drag-region attribute) only behaves like Zoom, regardless of the system setting. Double-click to minimize is actually quite useful when Stage Manager is enabled.
Screenshot 2025-10-08 at 12 44 40
  1. Three-finger drag is a niche feature, I don't personally use it, but it's clear that custom title bar doesn't currently support it.

By the way, I've resolved the conflicts caused by the last PR merge.
This PR looks pretty good now, thanks again!

@nshcr nshcr force-pushed the feat-native-title-bar branch from a86d88e to 3f645d5 Compare October 9, 2025 20:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
@gitbutler/desktop rust Pull requests that update Rust code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants