feat(ios): split autoplay next video from the suggestion setting - #225
Conversation
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
🟡 Changes recommended
There are correctness/reliability issues in the updated UI copy and UI test flow that should be addressed before approval.
Get a fresh assessment by requesting another Copilot review.
Pull request overview
Splits iOS “Up Next” suggestion enablement (account setting) from autoplay behavior (per-user config key autoplay_next_video), aligning with the web app contract and extending harness proof to cover manual play-next, offline successors, and VoiceOver labels.
Changes:
- Introduces
PutioAppConfigModelto load/save the config-backed autoplay flag, and wires it through the tab shell and Playback Preferences UI. - Updates next-video playback behavior to read autoplay policy at suggestion time and prefer offline successor playback sources.
- Expands unit/UI/harness coverage and documentation to prove manual-next, retry behavior, and accessibility labels.
File summaries
| File | Description |
|---|---|
| Tools/PutioHarness/Sources/PutioHarnessKit/SimulatorHarness.swift | Increases playback-preferences journey time allowance to reduce harness timeouts. |
| Tools/PutioHarness/Sources/PutioHarnessKit/Models.swift | Updates the harness test identifier to match the renamed UI test. |
| Tests/iOSUITests/Sources/PlaybackPreferencesJourneyTests.swift | Extends the Playback Preferences journey to prove manual-next (autoplay off), retry, and persistence. |
| Tests/iOS/Sources/PutioVideoPlaybackModelTests.swift | Adds coverage ensuring local successor playback doesn’t trigger online resolution. |
| Tests/iOS/Sources/PutioNextVideoModelTests.swift | Adds coverage for late-loaded autoplay policy and offline successor resolution. |
| Tests/iOS/Sources/AppConfigModelTests.swift | Adds unit tests for config load/save/retry semantics and authoritative-value behavior. |
| docs/HARNESS.md | Updates harness journey documentation to reflect new autoplay/manual-next proof steps. |
| Apps/Shared/Sources/HarnessSeededAPI.swift | Extends seeded config endpoints/fixtures to serve and persist autoplay_next_video with retry proof. |
| Apps/iOS/Sources/VideoPlayback.swift | Changes autoplay input from a Bool to a policy closure passed into PutioNextVideoModel. |
| Apps/iOS/Sources/VideoNext.swift | Reads autoplay policy at suggestion time and adds resolveSuccessorSource to prefer offline sources. |
| Apps/iOS/Sources/PutioApp.swift | Instantiates/loads PutioAppConfigModel, injects into settings and playback, and prefers offline successor sources. |
| Apps/iOS/Sources/PlaybackPreferencesView.swift | Adds a “Next video” section with config-backed autoplay toggle + retry UI. |
| Apps/iOS/Sources/AppConfigModel.swift | New app-owned model for config document loading and saving autoplay_next_video. |
Review details
- Files reviewed: 13/13 changed files
- Comments generated: 2
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
6f4c39e to
5240a96
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 5240a96a3c
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Autoplay reads the per-user config document (autoplay_next_video) through a config model owned by the tab shell; the suggestion keeps following the account setting. Playback Preferences gains the toggle with failed-save retry and reload recovery. A downloaded successor plays from its local source. The seeded preferences journey proves the manual play-next path with autoplay off, the toggle's retry, and persistence across relaunch. Refs #132
…in the queue The end-of-video decision awaits a config load still in flight, or starts one when nothing loaded, so a late document still enables autoplay. When the server cannot answer the successor lookup, the next downloaded video in the same folder comes from the offline queue.
5240a96 to
f61c38f
Compare
There was a problem hiding this comment.
🟢 Approval recommended
The behavior split is implemented end-to-end with updated UI, harness fixtures, and comprehensive unit/journey coverage for the new autoplay and offline-successor flows.
Review details
- Files reviewed: 15/15 changed files
- Comments generated: 0 new
- Review effort level: Lite
Problem
iOS derived both the Up Next suggestion and autoplay from the account's
next_episodesetting. The web app treats them separately: the suggestion follows the account setting, autoplay follows the per-user config keyautoplay_next_video(default off). The remaining #132 criteria also lacked proof for the manual play-next path, offline successors, and VoiceOver labels.Solution
PutioAppConfigModel(tab-shell owned) loads the config document throughruntime.appConfig()and saves throughsetAutoplayNextVideo. The local value flips only after the server acknowledges; a failed save keeps the authoritative value with a retry, and a failed load offers a reload. A load already in flight is awaited rather than duplicated.PutioNextVideoModelshows the suggestion first, then awaits the autoplay policy. The app's policy (resolveAutoplayNextVideo) joins a config load still in flight, or starts one when nothing loaded, so a document that arrives after playback ends still counts. Manual play and cancel while the policy settles win over a late autoplay. With autoplay off the suggestion stays with its manual play and cancel actions.PutioOfflineQueue.nextVideo(after:)returns the next downloaded video in the same folder by name, so a finished download still advances offline. A server answer of "none" never consults the queue.PutioOfflineQueue.localSource(for:), so a downloaded successor plays from its local file with its locally recorded position.autoplay_next_video(on for the recorded journey; persisted production default off under the playback-preferences fixture with one failed save for retry proof).Proof
AppConfigModelTests,PutioNextVideoModelTests,PutioVideoPlaybackModelTests,OfflineDownloadsTestscover the late config load (arrives true → autoplay, false → suggestion only, cancel/manual play during the wait), the offline successor fallback (queue answers only after a failed server lookup, never after a cancelled one or a definitive "none"), and the queue's folder-name ordering among downloaded videos.mise run harness -- test --platform ios(404 feature tests, 0 failures),mise run harness -- journey --platform ios --scenario files-browser(1/1),mise run verify(exit 0). Earlier captures: runtime-playback-preferences.png and runtime-playback.png.Refs #132