feat: scroll to new position after moving item in menu #552
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
When moving around items the scroll position doesn't update, which can be annoying when moving things around in a large playlist. Instead the menu should scroll with the moved item.
The problem with this is that scrolling itself causes a render, which means the menu gets rendered once with the updated scroll position but with the playlist item still in it's old position, and then again when the playlist itself gets updated, leading to a short visual artifact.
I can't think of a good solution to this.
It's possible to stop scrolling from requesting renders and instead request renders in other places instead, but that would still lead to problems when something else (e.g. playback position update) causes a render.
It's also possible to preemptively move the menu item in the menu itself, but then if the underlying data doesn't change for whatever reason there is a disconnect between what the menu shows and what's actually there.