Conversation
stakira
left a comment
There was a problem hiding this comment.
Thanks! This looks correct and low-risk. Using the selection matches the other part actions, since right-clicking an unselected part selects it first, and the translations without {0} still work (string.Format just ignores the name).
One change I'd ask for before merging:
Make splitting several parts one undo step. Each SplitPart opens its own undo group, so splitting 5 parts takes 5 undos. Also, answering "No" in the "notes in the way" dialog for a later part leaves the earlier ones already split. Suggestion: first go through the selected parts, asking the question where needed and working out each split tick. Then do all the remove/add commands inside a single StartUndoGroup()/EndUndoGroup(). That also keeps the undo group from staying open while a dialog is waiting.
Nits:
- The command lambda no longer uses its argument, so
ReactiveCommand.Create<UPart>(async _ => await SplitParts())would make that clear. - There's a whitespace-only blank line after
SplitParts(). - The other languages won't show the part name until their captions get a
{0}. Not a blocker, just worth mentioning to translators.
|
Asking a clarifying question regarding the "notes in the way" dialog, Is intended behaviour to abort the split if the user responds no, or to continue with the split, skipping the split for the part the user responded no to? |
Either is fine for me. But again, no undo should be pushed if no part is splitted. |
|
Changes have been made. Extra changes:
|
|
Thanks for this! The undo grouping looks right: all dialogs finish before One bug though: when the selection includes a wave part, the first loop Simplest fix is to filter to voice parts up front, then every remaining part adds exactly one entry and the indices line up: UVoicePart[] selectedParts = viewModel.TracksViewModel.Parts
.Where(viewModel.TracksViewModel.SelectedParts.Contains)
.OfType<UVoicePart>()
.OrderBy(part => part.trackNo)
.ToArray();(and drop the Smaller things:
|
- Changed caption to match logs - Set play position outsite loop - Add error redundancy to split part loop

Summary
Select multiple parts, and if they are under the playhead, it will split them one by one.
Also modifies the Split Part warning to take the part name.