Regression: in Select -> all similar elements: inability to select the grace notes
GIT commit 5e67739/ Windows 7
1) Load this file created with the mentioned commit: test 3.0 grace.mscz
2) Right-click on an acciaccatura -> Select -> All similar elements
Result: nothing happens
Note: maybe other elements involved? Verify.
Comments
I think everyone understands that these regressions (this issue, and the other, in Select -> Plus) were due to these commits of yesterday, September 22: https://github.com/musescore/MuseScore/pull/2744,
and so I guess it's not really helpful to specify.
I do it, however, for reference.
More likely due to https://github.com/musescore/MuseScore/pull/2832, which got merged, while #2744 just got closed
Note that I changed the behavior and that now, right clicking a note > select all similar elements will select all notes with same notehead. If one wants to select only acciacatura, one should use Select > More.
Actually, it is not true that nothing happens. If there are notes with "cross" headtype, those are selected (subtype=1).
I think it could be caused by the fact that different functions are called for the different "select all" methods.
In my PR I was suggesting to make the behavior the same for all the different "select all" modes: https://github.com/musescore/MuseScore/pull/2744/commits/333871f5b (obviously, this cannot be merged, and it was depending on the other commit of the PR)
Always in that PR, I was suggesting to use the trick of setting type=-1 for grace notes: https://github.com/musescore/MuseScore/pull/2744/commits/037489743
Maybe something similar can be done with the new behavior (at least unify the "select all" behavior).
Ciao,
ABL
EDIT: Moreover, with the code added yesterday, if you click on a "cross"-headtype note and "select all similar", it selects all the normal notes (including grace notes)
That's not good. That means there's a new way of getting into this state: #85631: Range select -> "Notes" button in Inspector includes grace notes in list selection, disabling Inspector
Fixed in branch master, commit d98a3d317b
fix #125756 fix #125761: inability to select similar grace notes, inability to select notes in same voice, staff...
I was confused by the "unify" word. I manually cherry picked ABL pull request and merged it. Regression should be gone.
Well, the code changed, so also the commit for making the behavior the same should be changed.
But I see that you have made some adjustments :-) Thank you.
I will try to test the code.
Is it possible to create automatic tests for the selection filter? I saw that there are some tests for the "interface" selection filter, but I don't know how to make tests for the "select all similar" right-click menu.
We could unit test
scanElements
andscanElementsInRange
by1. Loading a score
2. Make a range selection (for the InRange)
3. Create an ElementPattern or a NotePattern
4. call scanElements(InRange)
5. check that the selection contains the expected elements.
Fixed in branch 2.0.4, commit 5b3f8aa79e
fix #125756 fix #125761: inability to select similar grace notes, inability to select notes in same voice, staff...
Automatically closed -- issue fixed for 2 weeks with no activity.
See #188456: "Select" > "All similar elements" does not select all notes. I was surprised to see "all similar elements" for a note not actually meaning all notes but instead all notes with the same head, surprised enough to consider it a bug. But I am note sure I have an obvious use case where the distinction would actually get in my way.