fix: shuffle entire playlist queue and loop toggle - #99
Open
SyahrulBhudiF wants to merge 2 commits into
Open
Conversation
|
@SyahrulBhudiF is attempting to deploy a commit to the Faizan Asad's projects Team on Vercel. A member of the Team first needs to authorize it. |
Author
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.
What and why
This PR fixes playlist-wide shuffle and clarifies loop controls. Previously, pressing shuffle while a playlist was already in progress only reordered the remaining tail. For example, in a 91-song playlist near the end, Up next could contain only 8 songs; tracks that had already played were not returned to the queue. Playlist Shuffle now rebuilds the queue from the complete current playlist, keeps the selected/current track playing, moves it to the front, and shuffles every other playlist track after it. The queue is prepared before the loading state is emitted, so the UI does not briefly show the old partial count before switching to the full count. The PR also fixes the collection header Loop button, which previously could be enabled but not toggled back off, and makes its three loop states explicit.
Closes #88
Closes #98
How it was checked
npm run verifypasses — 30 checks passedcargo testnot required — nosrc-tauri/files changedWhat changed
1. Shuffle the whole playlist — issue #88 and #98
The queue now supports two distinct actions:
For a 91-song playlist, the expected result is:
This works even when the current track was originally near the end of the playlist.
2. Queue update without the temporary partial count
Previously, playlist Shuffle first loaded the playlist in its original order and only shuffled afterward. That caused a visible intermediate state such as:
The shuffle is now applied while the queue is being prepared, before the loading state is emitted. The user sees the final queue directly.
3. Loop header toggle bug and Loop one state — issue #98
The collection header previously allowed Loop to be enabled but not toggled back off. It now exposes the same three loop states already supported by the player controls:
Clicking cycles:
The active state has a distinct label, tooltip, accessible name, and icon.
Loop oneuses the repeat-one icon with the1marker. The header can also be toggled back to off.4. Shuffled repeat-all laps
When a shuffled playlist reaches its end with Loop all enabled, the next lap receives a fresh shuffled order instead of always restarting with the same queue item.
Screenshots
Issue #88 — Up next shuffle actions
The first screenshot shows Shuffle what's next. It preserves the current queue scope and only reorders the songs already ahead of the current track.
The second screenshot shows Shuffle the whole playlist. Its tooltip makes the broader action explicit. The queue contains 90 upcoming songs for the 91-song playlist, including tracks that had already played.
issues #88 and #98 — Playlist-wide shuffle
The playlist contains 91 songs, while the current track is selected from the collection. After using the playlist header Shuffle action, Up next shows 90 songs. The queue is rebuilt from the complete playlist, including tracks that had already played, instead of only shuffling the old remaining tail.
This implements the behavior requested in #88 and fixes the related queue behavior tracked in #98.
Issue #98 — Loop toggle bug and new feature Loop one
The following screenshots show the header control states:
Loop the whole playlist.Loop current song.Loop the whole playlist.Notes for the reviewer