musescore / MuseScore

MuseScore is an open source and free music notation software. For support, contribution, bug reports, visit MuseScore.org. Fork and make pull requests!
https://musescore.org
Other
11.98k stars 2.58k forks source link

Undo doesn't restore page re-layout (amount of systems on page) after reverting one action #23406

Open wizofaus opened 1 month ago

wizofaus commented 1 month ago

Issue type

UX/Interaction bug (incorrect behaviour)

Bug description

After certain operations that decrease the number of systems per page, undo does not restore the score to its previous state

Steps to reproduce

  1. Create score from String orchestra template
  2. Make sure page size is A4 (or change it to A4 in Right click on empty space>Page settings>Page size ) - score by default should show 3 systems per page
  3. Add C note to Violas staff
  4. Move that note several octaves higher with Ctr/Cmd+Up arrow until the first page increases to 2 systems
  5. Undo one time - the note goes back to previous place, but the page still has 2 systems

You should Undo several times until that note disappears

Expected: The pages should restore to 3 systems state after the first Undo

Screenshots/Screen recordings

https://github.com/musescore/MuseScore/assets/90187801/098116b6-9495-4ca0-9b68-4ff0ccfc3e65

MuseScore Version

4.4

Regression

No

The same in 4.0 and 3.6.2

Operating system

Windows 11

Additional context

No response

bkunda commented 1 month ago

@DmitryArefiev pls check

DmitryArefiev commented 1 month ago
  1. Create a new string orchestra score, that by default shows 3 systems per page

@wizofaus String orchestra template has 3 systems per page by default. Do you mean String quartet?

  1. Add a note to one of the middle staves (e.g. viola) and set its pitch high or low enough that the 3rd system is forced onto the next page.

With String quartet I can't reproduce with only one note shifting

Please correct the steps or add the video

DmitryArefiev commented 1 month ago

The issue could be in automatic re-layout (not Undo itself). On video, when removing the 2nd note:

https://github.com/musescore/MuseScore/assets/90187801/70953a83-c47a-4402-8596-08d05103adaf

wizofaus commented 1 month ago

No, I mean string orchestra. By default for me it's 3 systems per page. If I add a note and drag it high (or low) enough, it re-formats to 2 systems on the first page. Undo restores the note position but not the layout.

wizofaus commented 1 month ago

Your video demonstrates what I saw (where you've moved the note back to its original position but the # of systems per page doesn't reset), however I wouldn't necessarily consider that a bug, as you haven't done "undo", which is explicitly a request to say "revert that last change I made and go back to the previous state".

MarcSabatella commented 1 month ago

Note the defaults depend on where in the world you are located - A4 vs Letter page size. For me it was only two systems by default on Letter but changed to three when I set page size to A4. And I could then reproduce the problem with the original steps

wizofaus commented 1 month ago

Sure, that might be possible, but the problem can happen in principle with any number of systems per page.

DmitryArefiev commented 1 month ago

however I wouldn't necessarily consider that a bug, as you haven't done "undo", which is explicitly a request to say "revert that last change I made and go back to the previous state".

I think this is the same action (Undo and moving the note to previous place)

DmitryArefiev commented 1 month ago

Note the defaults depend on where in the world you are located - A4 vs Letter page size. For me it was only two systems by default on Letter but changed to three when I set page size to A4. And I could then reproduce the problem with the original steps

Yeah, you're absolutely right. Thanks!

DmitryArefiev commented 1 month ago

I'll modify the summary and description

@wizofaus @MarcSabatella Thanks for reporting and additional details!

wizofaus commented 1 month ago

however I wouldn't necessarily consider that a bug, as you haven't done "undo", which is explicitly a request to say "revert that last change I made and go back to the previous state".

I think this is the same action (Undo and moving the note to previous place)

There are lots of cases where performing one action then its logical reverse (e.g. changing the duration of a note to make it longer, then explicitly changing back to previous duration) won't necessarily return the score to the same state. Whether it should always dynamically recalculate systems per page every time a note is changed in pitch is at least debatable. But "undo" always should return you to the previous state.

MarcSabatella commented 1 month ago

Duration isn’t layout - changing duration modifies the content of the score. For layout, I don’t think it’s debatable at all. The layout should be deterministic - returning a note to its original position should return the layout to its original configuration as well, regardless of which command got it there. After all, there won’t be a command history saved with the score, and it’s important the layout after save/reload not change.

But there have long been cases where this is broken in cases that don’t involve undo. I know I submitted such an issue against MU3 some years ago but the issue tracker is impossible to search now, so I can’t find a link.