Add a play queue: Play next, Add to queue, Play all and Shuffle #5

Merged
salix merged 4 commits from t3code/playlist-queue-controls into main 2026-10-02 13:53:06 +02:00
Owner

Adds a play queue to every client: "Play next" and "Add to queue" on video menus, and "Play all" / "Shuffle" where a client lacked them.

Behaviour (same on all four clients)

  • Play next puts the video straight after the one playing; if it is already queued it moves to the front.
  • Add to queue appends it; if it is already queued nothing changes ("Already in the queue").
  • Queuing the video that is playing says "Already playing". With nothing playing, both actions just open the video.
  • Shorts get neither action.
  • The queue lives in app-level player state, so it survives the mini player. Expanding the mini player keeps it.
  • Editing the queue never reloads, seeks or un-pauses the current video. The end-of-video countdown picks its target when it finishes, so edits made during it count.
  • Behaviour change: queued videos now play through even with Autoplay off. The Autoplay switch only governs suggestions.

Per client

  • GNOME: card menus get Play Next / Add to Queue with a toast. Library lists (not History) and remote playlists get Play All / Shuffle. Up next re-renders live when the queue changes. Fixes expanding the mini player clearing the queue. The media-key Next skips to the queue head.
  • Android: the queue moves from the open request to PlayerHostState. The long-press action sheet gets Play next / Add to queue (hidden on TV, where the player has no queue). Remote playlists get Play all / Shuffle.
  • macOS: the queue moves from the watch route to AppModel. Context menus get Play Next / Add to Queue with a small toast. Play All / Shuffle were missing entirely and are added to library and remote playlists.
  • Web: video menus get Play next / Add to queue. A queue built from menus uses ?list=queue, plays through the watch page and mini player, and survives a reload (sessionStorage).

Testing

  • GNOME: xvfb-run -a cargo test -- --test-threads=1 passes, including new play_queue tests.
  • Android: :app:testDebugUnitTest passes, including new PlayerHostStateTest cases.
  • Web: node --test passes, including new queueInsert / shuffled tests. A Playwright run against a local debug server with Direct YouTube playback passed 23/23 checks: queue edits and toasts, edits from the feed while the mini player plays, expand, countdown retargeting, reload, card menu, Play all.
  • macOS has not been compiled (no Swift toolchain was available). It needs swift build && swift test on a Mac before merging. New tests are in Tests/InvioTests/PlayQueueTests.swift.
Adds a play queue to every client: "Play next" and "Add to queue" on video menus, and "Play all" / "Shuffle" where a client lacked them. ## Behaviour (same on all four clients) - **Play next** puts the video straight after the one playing; if it is already queued it moves to the front. - **Add to queue** appends it; if it is already queued nothing changes ("Already in the queue"). - Queuing the video that is playing says "Already playing". With nothing playing, both actions just open the video. - Shorts get neither action. - The queue lives in app-level player state, so it survives the mini player. Expanding the mini player keeps it. - Editing the queue never reloads, seeks or un-pauses the current video. The end-of-video countdown picks its target when it finishes, so edits made during it count. - **Behaviour change:** queued videos now play through even with Autoplay off. The Autoplay switch only governs suggestions. ## Per client - **GNOME:** card menus get Play Next / Add to Queue with a toast. Library lists (not History) and remote playlists get Play All / Shuffle. Up next re-renders live when the queue changes. Fixes expanding the mini player clearing the queue. The media-key Next skips to the queue head. - **Android:** the queue moves from the open request to `PlayerHostState`. The long-press action sheet gets Play next / Add to queue (hidden on TV, where the player has no queue). Remote playlists get Play all / Shuffle. - **macOS:** the queue moves from the watch route to `AppModel`. Context menus get Play Next / Add to Queue with a small toast. Play All / Shuffle were missing entirely and are added to library and remote playlists. - **Web:** video menus get Play next / Add to queue. A queue built from menus uses `?list=queue`, plays through the watch page and mini player, and survives a reload (sessionStorage). ## Testing - GNOME: `xvfb-run -a cargo test -- --test-threads=1` passes, including new `play_queue` tests. - Android: `:app:testDebugUnitTest` passes, including new `PlayerHostStateTest` cases. - Web: `node --test` passes, including new `queueInsert` / `shuffled` tests. A Playwright run against a local debug server with Direct YouTube playback passed 23/23 checks: queue edits and toasts, edits from the feed while the mini player plays, expand, countdown retargeting, reload, card menu, Play all. - **macOS has not been compiled** (no Swift toolchain was available). It needs `swift build && swift test` on a Mac before merging. New tests are in `Tests/InvioTests/PlayQueueTests.swift`.
- Video menus get Play Next and Add to Queue (not for Shorts), confirmed with a toast
- Playlist and library list pages get Play All and Shuffle (not History)
- Queued videos play through even with Autoplay off; Autoplay now covers suggestions only
- Up next re-renders when the queue changes, and the countdown picks the queue head when it ends
- Expanding the mini player no longer clears the queue
- The media-key Next skips to the head of the queue
- The queue moves from the watch route to AppModel, so editing it never reloads the page and the mini player keeps it
- Video context menus get Play Next and Add to Queue (not for Shorts), confirmed with a short toast
- Library playlists and remote playlists get Play All and Shuffle (not History)
- Queued videos play through even with Autoplay off; the next video is picked when the countdown ends
- The queue moves from the open request to PlayerHostState, so screens can edit it and the mini player keeps it
- The video action sheet gets Play next and Add to queue (not for Shorts or on TV), confirmed with a toast
- Remote playlists get Play all and Shuffle
- Queued videos play through even with Autoplay off; the next video is picked when the countdown ends
server: add Play next and Add to queue to video menus
All checks were successful
Build x86_64 Flatpak / flatpak (pull_request) Successful in 4m19s
4f49a17636
- Every video menu (except Shorts) can queue a video behind the one playing, confirmed with a toast
- A queue built from menus plays through the watch page and the mini player, and survives a reload
- Next, previous and the end-of-video countdown read the queue when they fire, so edits made from other pages still apply
- Expanding the mini player keeps the queue it was playing
salix merged commit 8385f4b453 into main 2026-10-02 13:53:06 +02:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
salix/invio!5
No description provided.