Skip to content

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

Open
wants to merge 7 commits into
base: develop
Choose a base branch
from

Conversation

massimopaganigh
Copy link
Contributor

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.

image

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`.
@Copilot Copilot AI review requested due to automatic review settings July 21, 2025 08:39
Copy link

@Copilot 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

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; }'
@love-linger love-linger force-pushed the develop branch 3 times, most recently from 370c592 to a3ed066 Compare July 21, 2025 09:36
@love-linger love-linger force-pushed the develop branch 2 times, most recently from 05dba32 to 6822ae3 Compare July 21, 2025 09:52
@love-linger
Copy link
Collaborator

I don't plan to add support for multi-instance or multi-window features now since there are lots of bugs in this PR:

  • The App only holds a single instance of ViewModels.Launcher, which is used to dispatch notification or exceptions
  • ViewModels.Repository.GetOwnerPage does not work in this PR
  • In this PR, if the user cannot determine which is the first window, it is easy to close the first one and cause the program to exit.
  • The Workspace feature does not work correctly in this mode.

@love-linger love-linger self-assigned this Jul 22, 2025
@love-linger love-linger added the not-planned It's not planned in the future label Jul 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
not-planned It's not planned in the future
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants