Skip to content

fix: shuffle entire playlist queue and loop toggle - #99

Open
SyahrulBhudiF wants to merge 2 commits into
noFAYZ:mainfrom
SyahrulBhudiF:fix/shuffle-playlist-and-loop
Open

fix: shuffle entire playlist queue and loop toggle#99
SyahrulBhudiF wants to merge 2 commits into
noFAYZ:mainfrom
SyahrulBhudiF:fix/shuffle-playlist-and-loop

Conversation

@SyahrulBhudiF

Copy link
Copy Markdown

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 verify passes — 30 checks passed
  • cargo test not required — no src-tauri/ files changed
  • Ran the app and tested playlist Shuffle while the current track was near the end
  • Ran the app and tested the Up next shuffle actions
  • Ran the app and tested the collection header loop cycle
  • Screenshots included below

What changed

1. Shuffle the whole playlist — issue #88 and #98

The queue now supports two distinct actions:

  • Shuffle what's next: only reorders tracks already after the current track.
  • Shuffle the whole playlist: includes tracks that already played, moves the current track to the front, and creates a new shuffled order for every other playlist track.

For a 91-song playlist, the expected result is:

  • 1 current track
  • 90 tracks in Up next

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:

Up next: 50 songs
Up next: 90 songs

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:

Loop      = off
Loop all  = repeat the whole playlist/queue
Loop one  = repeat the current song

Clicking cycles:

Loop → Loop all → Loop one → Loop

The active state has a distinct label, tooltip, accessible name, and icon. Loop one uses the repeat-one icon with the 1 marker. 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.

shuffle-whats-next shuffle-whole-playlist

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.

playlist-shuffle-result

Issue #98 — Loop toggle bug and new feature Loop one

The following screenshots show the header control states:

  1. Loop all — highlighted control, tooltip Loop the whole playlist.
  2. Loop one — highlighted control with the repeat-one icon, tooltip Loop current song.
  3. Loop off — neutral control after toggling back off, tooltip Loop the whole playlist.
loop-all loop-one loop-off

Notes for the reviewer

  • The existing Shuffle what's next behavior is intentionally preserved.
  • Playlist/album/artist header Shuffle uses the full loaded collection and applies shuffle before the first player-state update.
  • The queue keeps a snapshot so disabling shuffle can restore the original order.
  • The loop-state UI change is focused on the collection header and its state wiring.
  • The player-bar three-state loop behavior remains compatible.
  • Shuffled repeat-all laps now receive a fresh queue order instead of always restarting with the same first track.
  • No Rust/Tauri backend code changed.

@vercel

vercel Bot commented Aug 21, 2026

Copy link
Copy Markdown

@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.

@SyahrulBhudiF

SyahrulBhudiF commented Aug 21, 2026

Copy link
Copy Markdown
Author

@noFAYZ could you please review this PR when available? It addresses #88 and #98. npm run verify passes, and screenshots are included. I would appreciated your feedback, thanks.

@SyahrulBhudiF SyahrulBhudiF changed the title fix: shuffle entire playlist queue fix: shuffle entire playlist queue and loop toggle Aug 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Fix playlist shuffle queue and loop behavior Shuffle entire playlist regardless of current song

1 participant