-
Notifications
You must be signed in to change notification settings - Fork 687
Add "Clone Window" menu item to File menu #10237
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
The latest updates on your projects. Learn more about Vercel for GitHub. 1 Skipped Deployment
|
File
menu, add a Clone Window
menu item that opens another Window on the currently opened project.
It's OK if that fails if there is no project available yet.Co-authored-by: Byron <[email protected]>
46896bd
to
5fef8bc
Compare
Screen.Recording.2025-09-12.at.08.54.05.movThe feature originated on Discord where it was requested that we make the multi-window feature more accessible. I thought the idea of having a menu item for that is nice (also `Cmd+Shift+N). This might also force us to cleanup FS event handling, right now GB doesn't respond to many changes that it needs to respond to, particularly in single-branch mode. Handing it off to @krlvi and @PavelLaptev to see if this feature fits at all. |
5fef8bc
to
88e7da6
Compare
@Byron Thanks for turning my Discord suggestion into a PR! I think once this PR makes multi-window support more visible, it would also be useful if the macOS Dock could show the open windows when right-clicking the app icon. I did a quick check though, and it looks like Tauri doesn't currently provide a macOS Dock API similar to Electron's (https://www.electronjs.org/docs/latest/tutorial/macos-dock). I even saw Pavel in the related issue here (tauri-apps/tauri#2358)... ![]() Another thing I wanted to mention is window title. Right now GitButler doesn't update the window title with the current project, so when switching between windows with something like alt-tab (https://github.com/lwouis/alt-tab-macos), they all just show up as "GitButler - GitButler" (App name - Window title). This isn't directly tied to the PR, since even without multi-window support, having proper window title would already be useful. I think it could be worth its own PR. |
We are planning on also creating an Electron release :) - that should be able to have all the features eventually.
I see, thanks again. My guess is that we will tackle this naturally once we moved to Electron and work on this specifically. For now it's nothing more than a useful hack for convenience. |
I invited @PavelLaptev as well to see if this or something like it is viable for inclusion. |
This PR implements a new "Clone Window" feature in the File menu that allows users to open another window displaying the currently opened project.
Changes Made
Backend (Rust)
Cmd+Shift+N
(orCtrl+Shift+N
on Windows/Linux)get_current_project_id
command to safely retrieve the current project ID from a window's stateget_project_for_window
method toWindowState
for thread-safe project ID accessFrontend (TypeScript)
getCurrentProjectId
query endpoint to the projects serviceBehavior
The menu item appears between "Clone Repository..." and the existing separator in the File menu. When activated:
This implementation reuses the existing
open_project_in_window
infrastructure, ensuring consistency with the current window management system.Testing
The feature can be tested by:
Cmd+Shift+N
Fixes the request to add window cloning functionality to the File menu while maintaining the application's existing patterns and error handling approach.
💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.