Implement shuffle - #3381
Open
FrayxRulez wants to merge 1 commit into
Open
Conversation
FrayxRulez
force-pushed
the
playback-reconcile
branch
from
August 27, 2026 14:54
3b08a55 to
f2b71db
Compare
FrayxRulez
force-pushed
the
playback-shuffle
branch
from
August 27, 2026 14:54
e6346dd to
90167bf
Compare
FrayxRulez
force-pushed
the
playback-reconcile
branch
from
August 31, 2026 14:24
f2b71db to
769a985
Compare
FrayxRulez
force-pushed
the
playback-shuffle
branch
from
August 31, 2026 14:28
90167bf to
ee8c4b7
Compare
The button existed in two places and set IsReversed, since shuffle itself was never written. It now walks a fixed shuffled order, so Previous goes back to what was actually heard, and pages loaded later are folded into the part not yet played. Paging is measured against the playlist rather than the order being walked, which shuffle reaches the ends of in no particular order. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
FrayxRulez
force-pushed
the
playback-reconcile
branch
from
August 31, 2026 14:32
769a985 to
ef067b5
Compare
FrayxRulez
force-pushed
the
playback-shuffle
branch
from
August 31, 2026 14:32
ee8c4b7 to
d190afe
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Third of three. Stacked on #3380 — base retargets as the stack merges.
Shuffle has been a
GlyphToggleButtoninPlaybackHeaderandPlaybackPopupwith its handlercommented out, setting
IsReversedinstead, because shuffle itself was never written.The order
_shuffledholds the same items as the playlist in a fixed order, andNext/Previouswalk itinstead of the playlist. Fixed rather than a fresh random pick each time, so
Previousgoes backto the track that was actually heard.
MoveNextImplandMovePreviousImplneeded one line each —they now index
Orderinstead of_items, and the existing bounds, repeat and stop handlingworks unchanged on it.
The track playing when shuffle is switched on goes to the front of the order, rather than sitting
somewhere
Nextwould reach again later. Switching shuffle off drops the order instead ofremembering it: coming back to a shuffle from an hour ago is not what the button means.
Pages loaded later are inserted at random positions after the current one. What is behind it
has been heard, and dropping a new track back there would have
Previousreplay something thatnever played.
Paging
SetSourceno longer derives the paging trigger from the index it was given, since with shufflethat index is a position in the shuffled order and says nothing about how much of the playlist is
left to load.
LoadMoreAroundlooks the track up in the playlist instead.Play(PlaybackItem)—jumping straight to a track from the popup — now triggers it too, which it never did.
Notifications
SettingsChangedis new onIPlaybackService. Repeat and shuffle can both be changed from thesystem transport controls, so the buttons cannot only be refreshed by whoever pressed them; both
surfaces subscribe alongside
StateChanged.UpdateRepeatis renamedUpdateModesnow that itdrives both buttons.
The shuffle button's tooltip is the plain
Strings.Shufflerather than a state-specific pair likerepeat's. Repeat is tri-state and a two-state toggle cannot express it, so its name has to carry
it; shuffle is binary and
ToggleButtonannounces on/off on its own, so a state-specific namewould say it twice. No new strings needed.
Notes
drag-reorder there maps onto
setProfileAudioPosition, which only means anything in the realorder.
way; say the word if you want a reshuffle on wrap.
IsReversednow has no writer. The shuffle button was its only one. It is still onIPlaybackServiceand still threaded through the navigation logic, where it does nothing. Leftalone rather than deleted in the same PR that adds shuffle — removing it would simplify
MoveNextImpl/MovePreviousImplnoticeably, if you want that as a follow-up.Testing
Builds clean. Not exercised at runtime.
🤖 Generated with Claude Code