Skip to content

Enhance track selection, batch operations, and UI feedback#2103

Open
rokujyushi wants to merge 7 commits into
openutau:masterfrom
rokujyushi:pr2-track-menu-ui
Open

Enhance track selection, batch operations, and UI feedback#2103
rokujyushi wants to merge 7 commits into
openutau:masterfrom
rokujyushi:pr2-track-menu-ui

Conversation

@rokujyushi
Copy link
Copy Markdown
Contributor

This is a pull request that splits #2055.
Please merge the following PR first: #2102

This pull request introduces several enhancements and UI improvements to the track header and context menu system, focusing on better multi-track operations, improved menu item presentation, and more robust command handling. The changes include new commands for batch operations, custom UI controls for menus, improved track selection logic, and refactoring for clearer menu item view models.

UI and Menu Enhancements:

  • Added custom controls ApplyToAllTracksButton and FavouriteToggleButton for use in context menus, enabling actions like applying settings to all tracks and toggling singer favorites directly from the menu. These controls include improved pointer event handling to prevent event bubbling. [1] [2]
  • Updated TrackHeader.axaml to use new DataTemplates for context menu items, displaying the custom controls and supporting both single and batch actions. This includes visual improvements and the ability to trigger secondary commands (like "apply to all tracks") from the menu. [1] [2]

Menu Item ViewModel Refactor:

  • Refactored MenuItemViewModel to support a SecondaryCommand and a HeaderViewModel property, enabling richer menu item templates and secondary actions. Introduced PhonemizerMenuItemViewModel for better type separation. [1] [2]

Track and Selection Command Improvements:

  • Added TrackChangeSettingsCommand to support undoable changes to track mute, volume, and pan, facilitating batch and standardized settings changes.
  • Improved the MoveTrackCommand to handle edge cases gracefully by checking index bounds before executing or undoing track moves.
  • Added new context menu commands for standardizing track settings and rotating singers across selected tracks, with corresponding string resources for localization. [1] [2]

Command Infrastructure:

  • Expanded TrackHeaderViewModel to include new commands for batch operations, such as setting singers or phonemizers for all tracks.

Most important changes:

UI & Menu Improvements:

  • Introduced ApplyToAllTracksButton and enhanced FavouriteToggleButton for use in menu templates, improving batch operation UI and menu interactivity. [1] [2]
  • Updated TrackHeader.axaml to use DataTemplates with new controls and secondary commands, enabling batch actions and richer menu layouts. [1] [2]

Menu ViewModel Refactor:

  • Refactored MenuItemViewModel to support secondary commands and header view models, and introduced PhonemizerMenuItemViewModel for improved menu logic and templating. [1] [2]

Track Command Enhancements:

  • Added TrackChangeSettingsCommand for undoable mute, volume, and pan changes, and improved MoveTrackCommand to handle invalid indices safely. [1] [2]

New Context Menu Actions:

  • Added context menu items and string resources for "Standardize Track Settings" and "Rotate singers across selected tracks" for batch operations. [1] [2]

…h UI feedback

We have implemented track selection and multiple selection (supporting Shift/Ctrl/⌘) via TrackHeader clicks, and now explicitly display the selection status in the UI. We added `IsSelected` and `HeaderBorderBrush` to `TrackHeaderViewModel` and introduced a mechanism in `TracksViewModel` to manage and notify the selection status. The selection status is now properly updated when tracks are added or removed, and when projects are loaded. Additionally, we reorganized the artist selection logic to make it easier to support batch application in the future.
Copilot AI review requested due to automatic review settings May 6, 2026 07:42
Since this PR does not include any UI-related changes, the changes have been reverted.

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
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

This PR extends OpenUtau’s track-header UX to better support multi-track selection and batch operations, while upgrading the singer/phonemizer context menus to richer templates (including secondary “apply to all” style actions).

Changes:

  • Added track selection state management (SelectedTracks) and a TrackSelectionEvent, and wired selection highlighting into track headers.
  • Refactored menu item view models/templates to support richer headers and secondary commands, introducing new context-menu controls.
  • Added/expanded batch track operations (standardize settings, rotate singers, undoable settings changes) and hardened track move bounds checks.

Reviewed changes

Copilot reviewed 10 out of 10 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
OpenUtau/ViewModels/TracksViewModel.cs Adds selected-track state and selection events; integrates selection updates into command notifications.
OpenUtau/ViewModels/TrackHeaderViewModel.cs Adds batch commands, selection styling, and new multi-track operations (standardize/rotate/etc.).
OpenUtau/ViewModels/MenuItemViewModel.cs Adds SecondaryCommand + HeaderViewModel and introduces PhonemizerMenuItemViewModel.
OpenUtau/Controls/TrackHeaderCanvas.cs Subscribes to track selection/theme events and propagates selection state to header VMs.
OpenUtau/Controls/TrackHeader.axaml.cs Implements pointer-based multi-select behavior (Shift/Ctrl/Cmd).
OpenUtau/Controls/TrackHeader.axaml Switches context menus to DataTemplate-based rendering with new controls + secondary commands.
OpenUtau/Controls/FavouriteToggleButton.cs Moves into OpenUtau.App.Controls and adds pointer handling to prevent menu event bubbling.
OpenUtau/Controls/ApplyToAllTracksButton.cs New context-menu button control intended to trigger secondary/batch actions.
OpenUtau.Core/Commands/TrackCommands.cs Adds TrackChangeSettingsCommand and bounds checks for MoveTrackCommand.
OpenUtau/Strings/Strings.axaml Adds new localized strings for new batch menu actions.
Comments suppressed due to low confidence (1)

OpenUtau/ViewModels/TrackHeaderViewModel.cs:557

  • ManuallyRaise() raises property-changed notifications for Mute, Muted, Solo, Volume, and Pan without re-syncing the corresponding view-model properties from the underlying track. With the new batch/undoable commands that mutate these fields via TrackChangeSettingsCommand, the UI can show stale values after refresh/undo. Update the reactive properties from track (e.g., Mute = track.Mute, Volume = track.Volume, etc.) before raising notifications.
        public void ManuallyRaise() {
            TrackName = track.TrackName;
            TrackAccentColor = ThemeManager.GetTrackColor(track.TrackColor).AccentColor;
            TrackColor = Preferences.Default.UseTrackColor
                ? ThemeManager.GetTrackColor(track.TrackColor)
                : ThemeManager.GetTrackColor("Blue");
            RefreshSelectionStyle();
            this.RaisePropertyChanged(nameof(Singer));
            this.RaisePropertyChanged(nameof(TrackNo));
            this.RaisePropertyChanged(nameof(TrackName));
            this.RaisePropertyChanged(nameof(TrackAccentColor));
            this.RaisePropertyChanged(nameof(TrackColor));
            this.RaisePropertyChanged(nameof(Phonemizer));
            this.RaisePropertyChanged(nameof(PhonemizerTag));
            this.RaisePropertyChanged(nameof(Renderer));
            this.RaisePropertyChanged(nameof(Mute));
            this.RaisePropertyChanged(nameof(Muted));
            this.RaisePropertyChanged(nameof(Solo));
            this.RaisePropertyChanged(nameof(Volume));
            this.RaisePropertyChanged(nameof(Pan));

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

Comment thread OpenUtau/Controls/ApplyToAllTracksButton.cs
Comment thread OpenUtau/ViewModels/TracksViewModel.cs
Comment thread OpenUtau/ViewModels/TrackHeaderViewModel.cs
Comment thread OpenUtau/ViewModels/TrackHeaderViewModel.cs
rokujyushi added 4 commits May 6, 2026 17:01
…le tracks

We have added batch operations (delete, move up/down, rename/change color, duplicate, duplicate settings, unify, batch settings for Singer/Phonemeizer/Renderer, and Singer rotation) to the TrackHeaderViewModel when multiple tracks are selected.
A new command supporting Undo/Redo for track setting changes (TrackChangeSettingsCommand) has been added.
Out-of-range protection has been implemented for the MoveTrackCommand.
…ites

Added “Standardize Track Settings” and “Rotate Singers for Selected Tracks” to the track header context menu, and added resources to Strings.axaml. Introduced a custom DataTemplate to the singer and phonemeizer selection menu to display the ‘Favorites’ toggle button and the “Apply to All Tracks” button. Improved the implementation of the FavouriteToggleButton and added a new ApplyToAllTracksButton. Added a SecondaryCommand to MenuItemViewModel and added support for command configuration in TrackHeaderViewModel. These changes expand the UI to allow for intuitive bulk operations and favorite management.
@rokujyushi rokujyushi force-pushed the pr2-track-menu-ui branch from 30d7da3 to 80904b5 Compare May 6, 2026 08:22
keirokeer added a commit to keirokeer/OpenUtau-DiffSinger-Lunai that referenced this pull request May 19, 2026
Rework track header layout, singer/phonemizer menus, mute/solo chips,
and drag-to-reorder via the track number badge (ReorderTrackCommand).

Based on upstream OpenUtau PR openutau#2103 (track header improvements).
keirokeer added a commit to keirokeer/OpenUtau-DiffSinger-Lunai that referenced this pull request May 20, 2026
Rework track header layout, singer/phonemizer menus, mute/solo chips,
and drag-to-reorder via the track number badge (ReorderTrackCommand).

Based on upstream OpenUtau PR openutau#2103 (track header improvements).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants