Skip to content

feat: watch-later queue UI with auto-advance#40

Merged
windoze95 merged 1 commit into
mainfrom
fix/flutter-queue
Jun 28, 2026
Merged

feat: watch-later queue UI with auto-advance#40
windoze95 merged 1 commit into
mainfrom
fix/flutter-queue

Conversation

@windoze95

Copy link
Copy Markdown
Owner

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)

  • Home cards (long-press sheet), search results (⋯), channel detail (existing per-video menu), and the player (top-bar toggle playlist_addplaylist_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, and pushReplacement to 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 format clean · flutter analyze --fatal-infos --fatal-warnings — No issues · flutter test123 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

…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
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@windoze95 windoze95 merged commit d50f1fb into main Jun 28, 2026
6 checks passed
@windoze95 windoze95 deleted the fix/flutter-queue branch June 28, 2026 06:50
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.

1 participant