Skip to content

Turn Add to Next Up into a toggle in the reader (issue #160)#175

Merged
mapitman merged 1 commit into
mainfrom
next-up-indicator-episode-view-160
Jul 17, 2026
Merged

Turn Add to Next Up into a toggle in the reader (issue #160)#175
mapitman merged 1 commit into
mainfrom
next-up-indicator-episode-view-160

Conversation

@mapitman

Copy link
Copy Markdown
Owner

Summary

  • The reader's top-bar "Add to Next Up" icon (issue Add to next up from episode view #144) now reflects whether the on-screen episode is currently queued, and toggles it on tap instead of only adding.
  • ReaderViewModel exposes a new queuedItemIds: StateFlow<Set<String>> derived from QueueRepository.observeQueue(), kept reactive across pager swipes and external queue changes; a new removeFromQueue(itemId) removes an episode.
  • ReaderScreen swaps between PlaylistAdd/PlaylistAddCheck icons and cd_add_to_queue/cd_remove_from_next_up content descriptions based on the current page's queued state.
  • New string cd_remove_from_next_up added to values/values-de/values-es/values-fr/values-it.

Closes #160

Test plan

  • ./gradlew assembleDebug testDebugUnitTest lintDebug — clean except one known-flaky failure per run (ArticleListViewModelTest / QueueViewModelTest, matching the Investigate CI-only hang in SettingsViewModelTest #54/Investigate CI-only failure in ArticleListViewModelTest.defaultToAllArticleViewSetting_showsAllByDefault #60 "Dispatchers.Main used concurrently" pattern), confirmed unrelated by re-running the affected class alone and seeing it pass.
  • New ReaderViewModelTest cases: queuedItemIds reflects addToQueue, and removeFromQueue actually removes the item (verified via the reactive flow before the direct repository check, to avoid a DB-commit race).
  • Manual on-device verification still pending (no device/emulator available in this environment): open an episode, tap the Next Up icon to add it, confirm the icon changes to the "queued" state, tap again to remove, and confirm it swipes correctly across pager pages with independent per-episode state.

The reader's top-bar button only ever added the on-screen episode to
the Next Up queue; there was no way to see or undo that from the
reader itself. ReaderViewModel now exposes queuedItemIds, a StateFlow
derived from QueueRepository.observeQueue(), so the icon reflects the
current page's queued state live as the user swipes the pager and
updates immediately if the queue changes elsewhere (e.g. the queue
screen). Tapping the icon now adds when not queued and removes (via
the new removeFromQueue) when already queued, swapping the icon and
content description accordingly.
@mapitman
mapitman merged commit faa2118 into main Jul 17, 2026
1 check failed
@mapitman
mapitman deleted the next-up-indicator-episode-view-160 branch July 17, 2026 20:54
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.

When viewing an episode, show whether it is in next up or not

1 participant