-
Notifications
You must be signed in to change notification settings - Fork 247
enhance: Add "Move to New Window" and "Copy to New Window" options #1608
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: develop
Are you sure you want to change the base?
enhance: Add "Move to New Window" and "Copy to New Window" options #1608
Conversation
Enhanced the user interface by adding new menu items for "Move to New Window" and "Copy to New Window" in various language files. Implemented the corresponding functionality in `Launcher.cs` to allow users to move or copy tabs to new windows.
- Introduced `IsSecondaryWindow` property and `OnRequestClose` event in the `Launcher` view model. - Updated the constructor to accept a boolean for secondary window status. - Modified `Quit` method to handle close requests for secondary windows. - Refactored `MoveToNewWindow` and `CopyToNewWindow` methods to streamline window creation. - Added `RegisterOnRequestClose` method in the `Launcher` view to manage close requests. - Updated `using` directives in `Launcher.axaml.cs` to include `Avalonia.Threading`.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds "Move to New Window" and "Copy to New Window" functionality to allow users to transfer repository tabs between windows. The implementation includes localized menu items across 15 language files and core functionality in the Launcher classes.
- Adds context menu options for moving/copying tabs to new windows
- Implements secondary window management with proper cleanup
- Provides localized strings for the new menu items across all supported languages
Reviewed Changes
Copilot reviewed 14 out of 14 changed files in this pull request and generated 2 comments.
File | Description |
---|---|
src/ViewModels/Launcher.cs | Core functionality for window management and menu item creation |
src/Views/Launcher.axaml.cs | Window lifecycle management and close event registration |
src/Resources/Locales/*.axaml | Localized strings for new menu items (15 language files) |
[nitpick] The nested if-else structure could be simplified for better readability. Consider early return pattern: 'if (IsSecondaryWindow) { OnRequestClose?.Invoke(); return; }'
370c592
to
a3ed066
Compare
…when it's not necessary (sourcegit-scm#1577) Signed-off-by: leo <[email protected]>
05dba32
to
6822ae3
Compare
I don't plan to add support for multi-instance or multi-window features now since there are lots of bugs in this PR:
|
Enhanced the user interface by adding new menu items for "Move to New Window" and "Copy to New Window" in various language files. Implemented the corresponding functionality in
Launcher.cs
to allow users to move or copy tabs to new windows.