feat: watch-later queue UI with auto-advance#40
Merged
Conversation
…vance
Wire the iOS app up to the new queue API (POST/DELETE
/api/videos/{id}/queue, GET /api/queue).
- ApiService: addToQueue, removeFromQueue, getQueue — getQueue reuses the
VideoPage cursor envelope, like search.
- queueProvider (Notifier): loads the queue, paginates, and applies
add/remove optimistically with rollback + rethrow on failure.
nextAfter() picks the auto-advance target without mutating state.
- Add/Remove-from-Queue actions on home video cards (long-press), search
results, channel detail, and the player controls. A Queue screen reached
from the Library app bar lists the queue with tap-to-play and a
reorder-free remove; pull-to-refresh reloads it.
- Player auto-advance: when a video plays to the end (never on manual
back-out) it consumes the finished item if queued and plays the next
queued one. The incoming player re-asserts immersive/landscape so the
replaced route's teardown can't reset the system UI.
Tests: queue provider — getQueue page parsing, optimistic add/remove with
revert, idempotent add, toggle, pagination, and nextAfter.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RXMKM1rDWn8wNh93MMUtxY
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
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.
Watch-later queue (roadmap LATER tier, #2 client) consuming the merged queue API.
Add to Queue (one shared optimistic
queueProvider, so labels stay in sync)playlist_add↔playlist_add_check).Queue view
Reached from the Library app-bar Queue icon (
/queue): queued videos in play order, tap-to-play (starts a preview for not-yet-downloaded items), per-row Remove, infinite-scroll pagination, pull-to-refresh, empty/error states.Auto-advance
A listener on
VideoPlayerValue.isCompleted(genuine end-of-video only, never manual back-out): on completion, advance to the item after the finished one (or the queue head if the finished video wasn't queued), consume it from the queue, andpushReplacementto the next player; stays put if nothing follows. Incoming player re-asserts immersive/landscape via a post-frame callback to win the dispose race.Verification
dart formatclean ·flutter analyze --fatal-infos --fatal-warnings— No issues ·flutter test— 123 passed (+18 queue tests: optimistic add/remove + revert, pagination, nextAfter).Note: auto-advance treats the queue as a draining "up next" (removes the finished item). Easy to switch to persistent if preferred.
🤖 Generated with Claude Code
https://claude.ai/code/session_01RXMKM1rDWn8wNh93MMUtxY