musescore / musescore/MuseScore
Review all the different Notifications/Channels that we have throughout the interfaces in the notation module
Open
Nobody has claimed this yet.
tech debt
- Dominant language
- C++
- Stars
- 15.1k
- Forks
- 3.3k
- Avg merge
- 2d 2h
- Merged PRs (30d)
- 91
Description
We have many interfaces, and many notifications, and it isn't always immediately clear through which interface an operation should be done, or through which notification/channel we will be notified of which things.
Examples of unclear task distribution over interfaces:
- Shadow note is managed by AbstractNotationPaintView and NotationInteraction, but the rest of note input goes through NotationNoteInput.
- Retrieving the selection goes via NotationSelection, but changing the selection goes through NotationInteraction.
- (not really about interfaces, but) I keep being confused about the task distribution between AbstractNotationPaintView, NotationViewInputController, NotationInteraction
Examples of notification unclarity:
- When exactly is
notationChangedfired? When an undo stack transaction (begin/endCommand) is performed? Or also when the view mode changes, for example? Well, apparently also when just a style value is changed in the style dialog, while that's not a complete transaction. But not for some actions that go through theNotationNoteInputinterface, and also not when doing actions that don't go throughNotationInteraction, but just useNotationUndoStack::prepareChanges/commitChanges. - It feels not great to have
notationChangedandchangesChannel. They are very similar, but not the same, but the difference is far from obvious. - Judging from
NotationInteraction::apply, there's sometimes also adropChangednotification, that's emitted instead ofnotationChanged, makingnotationChangedeven less general/reliable. - if you need to do something when the selection is changed, and when the notation is modified, you'd need to subscribe to both notifications, but sometimes both are fired for the same transaction, so your handler will be performed twice. We don't have a general way of handling this.
It seems time to review the interfaces and notifications we have, and increase consistency and reduce redundancy.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.