Repository navigation
Uiux fluidity overhaul - #4
Conversation
…an-out
The home and library "Recommended" surfaces fetched the section layout and
then re-fetched every section's items one-by-one. But /home/sections and
/library/{id}/sections already return each section with its items hydrated
inline -- verified against the dev server: byte-for-byte the same item
objects the per-section /items endpoint returns (progress + user_state
included). The fan-out was an N+1 re-downloading data already in hand
(10-14 extra requests per library, ~24 for home).
- HomeViewModel, TvLibraryDetailViewModel: render directly from the layout's
embedded items; fall back to per-section /items only for sections the
server leaves un-inlined (items empty but total_count > 0).
- TvLibraryDetailViewModel: defer the /catalog/filters call (3-15s, scales
with library size) to Browse-tab entry instead of eagerly in init.
- ContinuumHttpClient (Android): raise OkHttp maxRequestsPerHost 5 -> 16 so
any remaining fan-out and image loads aren't throttled into waves of 5.
Result: a library Recommended page loads from 1 request (was 1 + 10-14)
and home from 1 request (was 1 + 24); the slow filters call no longer
fires on library entry.
Co-Authored-By: Claude Opus 4.8 <[email protected]>
Remove the notifications/inbox surface from both clients: - Phone: drop the badged inbox button from the home chrome and main top bar, the Inbox route, and the onInboxClick wiring. - TV: drop the Inbox route/screen wiring, the profile-menu "Notifications" row, and the NotificationsRepository unread-count plumbing. Polish the TV top-menu cascade: - Commit a library tab's Recommended section on Enter (onSelectTab). - Fade cascade preview panels in/out (animateFloatAsState) instead of a hard alpha cut. - Shorten the flyout-follow debounce 150ms -> 80ms. - Clear a stale panelEntersFocus flag when focus returns to a bar button, fixing a frozen-preview case when moving along the tabs. The InboxScreen / TvInboxScreen composables are left in place but are no longer routed. Co-Authored-By: Claude Opus 4.8 <[email protected]>
…perf - Splash plays only on a genuine cold launch (process-lifetime flag); skipped on warm re-open / Activity recreation. Phone + TV. - Remove the dead Light/Dark/System theme toggle and its plumbing (ThemeManager, ThemePreference, AppearanceSettings); keep dark-only. - Coil SingletonImageLoader.Factory on both apps: 512MB artwork disk cache so posters survive between sessions. - FeaturedCarousel: remember() the per-frame chip/format work. - Top-bar Search + account buttons: add contentDescription for TalkBack. - Delete dead code (TvAnimatedMeshBackground, FavoriteButton, WatchlistButton). Co-Authored-By: Claude Opus 4.8 <[email protected]>
- MediaRow (Continue Watching) and the Favorites/Watchlist grids use Modifier.animateItem() so removals/reorders slide instead of snapping. - Replace the hardcoded 104dp top-bar content offset with statusBars + 76dp (the bar body height) so it tracks the real bar height on tall-cutout / large-display devices. Co-Authored-By: Claude Opus 4.8 <[email protected]>
- Port the ThumbHash decoder (android-shared) and wire it into ThumbhashImage: decode the base64 hash to a tiny bitmap and hand it to Coil as the crossfade placeholder, so every poster/backdrop/hero blurs up instead of popping in from a flat color. Malformed hashes fall back to the neutral placeholder (no crash). - ThumbhashImage gains an optional decodeSizePx cap; the full-screen blurred Libraries hero decodes at 360px instead of near-full-res, cutting that bitmap's memory ~16x with no visible quality change. Co-Authored-By: Claude Opus 4.8 <[email protected]>
Replace bare centered spinners with content-shaped shimmer skeletons so screens are laid out from the first frame and only the pixels resolve in: - Skeleton kit: rememberShimmerProgress + Modifier.skeleton, plus MediaRowSkeleton / MediaRowsSkeleton / PosterGridSkeleton / DetailLoadingSkeleton (modeled on the existing SimilarRailPlaceholder). - Home, ItemDetail, Browse, and Libraries (Recommended sections, Browse catalog, Collections) show skeletons while loading; the sub-second libraries-list fetch keeps its spinner. Co-Authored-By: Claude Opus 4.8 <[email protected]>
- Default the Media3 buffer policy to QuickStart (~3s to first frame) instead of the hardcoded SmoothPlayback (~5s); the QuickStart profile was already defined but never selected. - Plumb bufferedPosition into the player UI and give PlayerProgressBar a three-region track (played / buffered-ahead / not-yet-buffered) so the phone scrubber shows where a seek will land instantly, matching what the TV scrubber already does. Co-Authored-By: Claude Opus 4.8 <[email protected]>
- Provide TvSmoothBringIntoViewSpec (the tuned 320ms glide whose own doc says it avoids the default spring's "snap") to the Skyline feed and TvCatalogGrid, so TV Home, library Recommended feeds, library Browse grids, and Search all inherit it - previously only item-detail did. - Remove TvSkylineSectionFeed's manual animateScrollToItem, which fought the focus system's own bringIntoView; vertical scroll is now one glide. Source test updated to assert no manual scroll remains. Co-Authored-By: Claude Opus 4.8 <[email protected]>
- Anchor the bottom-nav popUpTo on the graph's actual start destination (findStartDestination) instead of the hardcoded "video" route, which was never on the back stack - so tab switches no longer accumulate entries and Back exits cleanly. Robust for the offline->Downloads start too. - Redirect the post-auth entry points (device pair, server switch, profile selection) to the canonical Home route, and delete the dead video/audio/reading aliases and their composables. Co-Authored-By: Claude Opus 4.8 <[email protected]>
…spec) Phase 3's PlayerProgressBar buffered track uses Material3 Slider's experimental `track` slot, and phase 4's TvCatalogGrid / TvSkylineSectionFeed use the experimental foundation LocalBringIntoViewSpec — both opt-in-required, so compileDebugKotlinAndroid failed. Add the @OptIn annotations, matching the existing TvItemDetailScreen usage. Both apps now compile clean. (These were committed unbuilt in phases 3/4 because their validation trusted the wrapper script's exit code instead of grepping gradle's result.) Co-Authored-By: Claude Opus 4.8 <[email protected]>
Self-contained guide to resume the overhaul in a new session: branch state, the Windows build/verify procedure (grep gradle output, don't trust the wrapper exit code), the 4 pre-existing ebook URI test failures, and detailed plans + file refs + decisions + gotchas for phase 6 (shared-element hero), 7 (TV focus refactor, gated), and 8 (R8 + baseline profile, gated). Co-Authored-By: Claude Opus 4.8 <[email protected]>
Tapping a poster now morphs that artwork into the item-detail backdrop (and reverses on back) instead of nav-compose's flat fade — the thing you tapped visibly carries you into the detail page. - Wrap the phone NavHost in SharedTransitionLayout and publish the SharedTransitionScope plus each destination's AnimatedVisibilityScope via CompositionLocals (LocalSharedTransitionScope / LocalNavAnimatedVisibilityScope), so deep descendants opt in without threading scopes through every signature. - New Modifier.heroSharedBounds(contentId) helper tags both ends with one shared key. sharedBounds (not sharedElement) is the correct API here because the two ends are different images (2:3 poster vs wide backdrop): it crossfades the artwork while morphing the bounds, with RemeasureToBounds keeping the image crop-filling the animating rectangle each frame. - Sources: poster MediaCards in the home rails (MediaRow) and the detail "More Like This" rail (SimilarRail). Target: the detail backdrop (DetailHero). Home->detail and detail->detail both morph. - Safe by construction: heroSharedBounds no-ops when no scope is present (previews, unwired screens, book/audiobook details with no backdrop), and duplicate same-key posters degrade gracefully (verified against the resolved 1.7.6 impl: no at-rest glitch, no crash — worst case the morph origin shifts to another copy). - Source guard MobileSharedElementSourceTest locks the wiring end-to-end. Scope is the plan's stated minimum (home poster rows + similar rail + hero); Libraries/For You/Browse/grids and the continue-watching backdrop cards are a one-liner-per-surface follow-up (wrap the destination, pass the id). androidApp compiles clean; MobileSharedElementSourceTest (4) and MobileListPerformanceSourceTest (8) both green. Co-Authored-By: Claude Opus 4.8 <[email protected]>
Phase 6 shipped in 816d54c. Records what landed (sharedBounds container transform, scope plumbing, wired surfaces), the not-visually-verified caveat (emulator is a TV image), and the one-liner-per-surface follow-up list. Co-Authored-By: Claude Opus 4.8 <[email protected]>
The androidTvApp test source set has failed to COMPILE since 071e1c0 (an ancestor of this branch's base): that commit removed the `tvWatchTogetherHostTarget` helper + `TvWatchTogetherHostTarget` type from TvItemDetailScreen but left TvWatchTogetherHostTargetTest.kt referencing them. Because the whole set didn't compile, `:androidTvApp:testDebugUnitTest` ran ZERO tests — so every TV source guard (including ones the overhaul plan lists as "must stay green") was silently dormant, and three had drifted stale against correct source: - TvSkylineSectionFeedSourceTest forbade `animateScrollToItem`, but the string now appears only in an explanatory comment (phase 4 removed the actual call). Tightened to the call form `.animateScrollToItem(`. - TvPlayerViewModelSharedCoordinatorTest expected `startSession(`; the method was renamed `startSessionV2(`. Behavior preserved. - TvCascadeInteractionSourceTest expected a library tab `onClick = { onSelectRoot(destination) }`; the bar now commits via `onClick = { onSelectTab(type) }` (validated by its sibling test). Delete the orphaned, uncompilable watch-together test (its host-target logic was inlined into TvItemDetailScreen; re-extracting it with fresh coverage is filed separately) and update the three stale assertions to match current correct source. The suite now compiles and runs: 371 tests, 0 failures across 75 suites. Co-Authored-By: Claude Opus 4.8 <[email protected]>
TvMainShell hand-rolled focus/back coordination across ~5 mutable Int counters + booleans + the outer Back onPreviewKeyEvent, mutated from a dozen sites — the file has 34 commits, many titled "fix focus". Consolidate that into ONE holder, TvShellFocusState, with a derived `mode` enum (Content / MenuFocused / ProfileMenu / Panel) and named transitions (previewPanel / enterPanel / closePanel / toggleProfileMenu / dismissProfileMenu / requestMenuFocus / updateMenuFocused / onBack). Every mutation in TvMainShell now routes through it; no call site bumps a raw counter or flips a bare flag. Crucially, the routing logic those 34 fixes kept getting wrong is extracted into PURE functions — tvShellMode() and tvShellBackAction() (the historical 4-way Back precedence: panel > profile menu > focused bar > nav) — so it is covered by REAL unit tests (TvShellFocusStateTest, 15 cases incl. holder transitions), not just string guards. The Compose-side focus-dispatch guards that can't be unit-tested (UP-exit cancel, the double-move prevention, runCatching-wrapped requestFocus, >0 counter guards, centralized shell Back) are pinned by TvShellFocusSourceTest, each tied to the fix commit it came from (b823d1f / 253b6ee / be6f1f3 / 79fa8a5). Behavior-preserving: each transition maps 1:1 to the prior scattered mutation. The menu-refocus / avatar-refocus / panel-entry COUNTERS are retained (the bar + cascade observe them to re-run focus effects) rather than collapsed into direct FocusRequester calls — that crosses the shell/child boundary and needs on-device D-pad verification, left as a follow-up. GATED: androidTvApp main compiles clean and the full unit suite is green (371 tests, incl. 20 new focus tests), but D-pad focus *dispatch* can only be confirmed on a real/emulated TV. Recommend verifying before merge: Up from the top content row → selected tab; dropdown open/close → avatar; library-tab Down → cascade + Back closes it; menu-focused Back → content (not app exit); cascade commit → scoped content. Co-Authored-By: Claude Opus 4.8 <[email protected]>
Launch-prep. Neither app had a buildTypes block, so release was unminified
with no resource shrinking, no baseline profile.
R8 / resource shrinking (both apps):
- A release buildType with isMinifyEnabled + isShrinkResources, sharing one
root proguard-rules.pro. This stack is reflection/JNI-heavy, so the rules
pin every component that resolves types by name/reflection/JNI: kotlinx
.serialization generated serializers (com.continuum.app.**), Koin-resolved
ViewModels, the Media3 FFmpeg renderer (loaded via Class.forName), libmpv
JNI (dev.jdtech.mpv.** + native callbacks), BouncyCastle TLS-PSK pairing,
Room entities/DB impl, plus dontwarns for Ktor/OkHttp/Coil3/zxing optionals.
- Debug-signed so the gated on-device smoke test is installable (no release
keystore yet, pre-1.0).
- VERIFIED: both apps' assembleRelease build clean through R8 (~35-42 MB
per-ABI; the FFmpeg + libmpv native libs dominate). R8 breakage is
runtime-only, so a minified install still needs the gated device smoke
test: boot + Media3 playback + MPV playback + LAN (TLS-PSK) pairing.
Baseline Profile:
- androidx.profileinstaller in BOTH apps (installs + AOT-compiles the profile
at first run).
- New :baselineprofile macrobenchmark module (com.android.test) with a
cold-start + best-effort-scroll generator targeting :androidApp and a
headless managed device (pixel6Api34). The root build.gradle now pins
com.android.test / kotlin-android / androidx.baselineprofile apply-false so
the new module reconciles with the app modules' shared AGP + Kotlin
artifacts (otherwise Gradle can't verify their versions across modules).
- VERIFIED: module configures, generator compiles, generation variants
assemble. GENERATION is device-gated — run on a device/emulator:
./gradlew :baselineprofile:generateBaselineProfile
A richer logged-in Home-scroll journey needs a test server/account.
GATED: declaring done needs the owner's on-device smoke test of a minified
install plus a baseline-profile generation run.
Co-Authored-By: Claude Opus 4.8 <[email protected]>
Records phase 7 (TV focus holder, e9184e2) and phase 8 (R8 + Baseline Profile, d4fbba3) as implemented + verified-as-far-as-possible, both awaiting the owner's on-device checkpoint. Also documents the dormant :androidTvApp test suite found + fixed in phase 7, and the 11 (not 4) pre-existing :androidApp env/test failures. Co-Authored-By: Claude Opus 4.8 <[email protected]>
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThis PR adds plan-aware playback routing and recovery, updates pairing transport and TV setup flows, refactors mobile and TV playback startup, and introduces release and baseline-profile tooling plus related docs. ChangesPlan-aware playback and routing
Pairing transport and TV setup flow
Android mobile UI, navigation, and image placeholders
Android TV shell, focus, and catalog interaction
Build, release, baseline profile, and miscellaneous tooling
Estimated code review effort🎯 5 (Critical) | ⏱️ ~120 minutes 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
|
Caution Failed to replace (edit) comment. This is likely due to insufficient permissions or the comment being deleted. Error details |
There was a problem hiding this comment.
Actionable comments posted: 17
Note
Due to the large number of review comments, Critical, Major severity comments were prioritized as inline comments.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
androidTvApp/src/androidMain/kotlin/com/continuum/app/tv/ui/screens/library/TvLibraryDetailViewModel.kt (1)
266-277: 🎯 Functional Correctness | 🟠 Major | ⚡ Quick winReset
loadedFilterson failed filter fetch so Browse can retry.Line 266 marks filters as loaded before the request, but failure paths at Line 276 never clear it. Because Line 127 only calls
loadFilters()when!loadedFilters, one transient failure can block filter loading for the rest of the session.💡 Suggested fix
private fun loadFilters() { - loadedFilters = true + if (loadedFilters) return + loadedFilters = true viewModelScope.launch { _uiState.update { it.copy(filtersLoading = true) } when (val filters = catalogRepository.getFilters(libraryId)) { is ApiResult.Success -> _uiState.update { it.copy( genres = filters.data.genres.sorted(), filtersLoading = false, ) } - else -> _uiState.update { it.copy(filtersLoading = false) } + else -> { + loadedFilters = false + _uiState.update { it.copy(filtersLoading = false) } + } } } }🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@androidTvApp/src/androidMain/kotlin/com/continuum/app/tv/ui/screens/library/TvLibraryDetailViewModel.kt` around lines 266 - 277, The loadedFilters flag is set to true before the API request completes, but it is never reset to false when the filter fetch fails in the else branch. This prevents retries since line 127 only calls loadFilters() when !loadedFilters. Add loadedFilters = false assignment in the else branch (the failure path) to reset the flag on failed filter fetches, allowing the Browse screen to retry loading filters on subsequent attempts.
🟡 Minor comments (6)
docs/plans/uiux-overhaul-remaining-phases.md-59-59 (1)
59-59: 📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick winAdd a language to the fenced code block.
Line 59 opens a code fence without a language, which trips markdownlint MD040.
Suggested fix
-``` +```text🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@docs/plans/uiux-overhaul-remaining-phases.md` at line 59, The fenced code block opening on line 59 is missing a language identifier after the triple backticks, which violates markdownlint rule MD040. Add "text" as the language specifier immediately after the opening ``` to fix this linting error.Source: Linters/SAST tools
android-shared/src/androidMain/kotlin/com/continuum/app/common/player/PlaybackCapabilityDetector.kt-324-328 (1)
324-328: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick winAvoid falling back to the first track when no track is selected.
Returning the first format can evaluate an unselected track and produce false
Unsupported*outcomes during transient selection states. Returningnullis safer here.🐛 Proposed fix
private fun Tracks.Group.selectedFormat() = (0 until length) .firstOrNull { isTrackSelected(it) } ?.let { getTrackFormat(it) } - ?: if (mediaTrackGroup.length > 0) mediaTrackGroup.getFormat(0) else null🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@android-shared/src/androidMain/kotlin/com/continuum/app/common/player/PlaybackCapabilityDetector.kt` around lines 324 - 328, The selectedFormat() helper in PlaybackCapabilityDetector should not fall back to the first track when no selected track exists. Update Tracks.Group.selectedFormat() so it only returns the currently selected track format via isTrackSelected/getTrackFormat, and returns null when none are selected instead of using mediaTrackGroup.getFormat(0). This keeps transient unselected states from being treated as supported by accident.androidTvApp/src/androidMain/kotlin/com/continuum/app/tv/ui/shell/TvMainShell.kt-235-236 (1)
235-236: 🎯 Functional Correctness | 🟡 MinorAdd route-reset safeguard for
contentUpFallbackto prevent stale Up-key routing.Shell passes
onContentUpFallbackChanged = { contentUpFallback = it }to six routes (ForYou, Movies, Series, Music, Audiobooks at lines 567, 584, 628, 641, 654, 667), and the Up-key handler at line 519 invokes the callback if set. However, the shell's route-change LaunchedEffect does not resetcontentUpFallbackto null. While no producer screens currently invoke this callback, the infrastructure is architecturally vulnerable: if any producer later callsonContentUpFallbackChanged(callback), that callback will persist across route transitions, causing stale Up-key routing on routes that don't set a fallback. AddLaunchedEffect(currentRoute) { contentUpFallback = null }in TvMainShell to reset the state on every route change.Also applies to: 519–531, 565–667
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@androidTvApp/src/androidMain/kotlin/com/continuum/app/tv/ui/shell/TvMainShell.kt` around lines 235 - 236, The contentUpFallback mutable state variable is not reset when the currentRoute changes, which can cause stale callbacks from previous routes to persist and affect Up-key navigation on subsequent routes. Add a LaunchedEffect block in TvMainShell that observes currentRoute as its key and resets contentUpFallback to null inside that effect. This ensures that whenever the route changes, the fallback callback is cleared before the new route's callback (if any) can be set via onContentUpFallbackChanged, preventing stale routing across route transitions.androidTvApp/src/androidMain/kotlin/com/continuum/app/tv/ui/components/TvFocusMarqueeModel.kt-133-136 (1)
133-136: 📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick winAlign badge documentation with the new emitted labels.
The logic now normalizes Dolby Vision-like HDR to
HDRand Atmos-only audio toAUDIO, but nearby docs/examples still describeDOLBY VISION/ATMOS.📝 Suggested doc update
-/** Codec/HDR + content-rating chips (`4K`, `DOLBY VISION`, `ATMOS`). */ +/** Codec/HDR + content-rating chips (`4K`, `HDR`, `AUDIO`). */ -// Codec/HDR + content-rating chips (`4K · DOLBY VISION · ATMOS · +// Codec/HDR + content-rating chips (`4K · HDR · AUDIO ·🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@androidTvApp/src/androidMain/kotlin/com/continuum/app/tv/ui/components/TvFocusMarqueeModel.kt` around lines 133 - 136, Update the documentation and comments in the TvFocusMarqueeModel class to reflect the actual badge normalization behavior. The code now normalizes Dolby Vision-like HDR values to "HDR" and Atmos-only audio to "AUDIO", but any nearby documentation, comments, or examples (such as KDoc comments or inline descriptions of what badges are emitted) likely still reference the old labels like "DOLBY VISION" or "ATMOS". Find and update these documentation references to accurately describe that the badges property will emit "HDR" for Dolby Vision content and "AUDIO" for Atmos-only audio instead of the unnormalized values.android-shared/src/androidUnitTest/kotlin/com/continuum/app/common/player/ContinuumPlaybackServiceEngineSourceTest.kt-48-50 (1)
48-50: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick winMake the source slice fail closed when
bindNewPlayeris not found.
substringAfterfalls back to the full file when the marker is missing, so this test can accidentally assert against unrelated text instead of failing on the missing function boundary.Suggested fix
- val bindBody = src.substringAfter("private fun bindNewPlayer(") - .substringBefore("/** Carry full playback state across a swap") + val bindStart = src.indexOf("private fun bindNewPlayer(") + assertTrue(bindStart >= 0, "bindNewPlayer must exist") + val bindBody = src.substring(bindStart) + .substringBefore( + delimiter = "/** Carry full playback state across a swap", + missingDelimiterValue = "", + ) + assertTrue(bindBody.isNotBlank(), "bindNewPlayer body boundary must be found")🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@android-shared/src/androidUnitTest/kotlin/com/continuum/app/common/player/ContinuumPlaybackServiceEngineSourceTest.kt` around lines 48 - 50, The issue is that substringAfter on the src variable returns the entire file content if the "private fun bindNewPlayer(" marker is not found, allowing the test to potentially pass when asserting against unrelated text. Add validation to ensure the function boundary was actually found before using the extracted bindBody, either by checking that the result differs from the original src string or by using a require/check statement to fail the test immediately when the marker is not found in the source.androidTvApp/src/androidMain/kotlin/com/continuum/app/tv/ui/screens/player/TvPlayerHud.kt-435-435 (1)
435-435: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick winKeep the stats-based HDR fallback when no plan badge exists.
playbackPlanis nullable/defaulted, so legacy/local or not-yet-hydrated plan paths now drop the HDR badge even ifstats.hdrModeis populated. Prefer the plan badge, but fall back to the runtime stats badge.Suggested fix
- playbackPlan.validatedHdrBadge()?.let { add(it) } + (playbackPlan.validatedHdrBadge() ?: stats.hdrMode?.takeIf { it.isNotBlank() }) + ?.let { add(it) }🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@androidTvApp/src/androidMain/kotlin/com/continuum/app/tv/ui/screens/player/TvPlayerHud.kt` at line 435, The HDR badge logic in TvPlayerHud’s badge-building flow should keep the plan-based badge as the primary source, but restore the runtime fallback when the plan badge is absent. Update the existing playbackPlan.validatedHdrBadge() check so the same badge list also considers stats.hdrMode (or the existing stats-based HDR helper) for legacy/local or unhydrated playbackPlan cases, ensuring the fallback is only used when no plan badge is available.
🧹 Nitpick comments (5)
shared/src/commonMain/kotlin/com/continuum/app/model/playback/PlaybackModels.kt (1)
325-325: 🗄️ Data Integrity & Integration | 🔵 Trivial | 🏗️ Heavy liftType
quality_preferencein the wire model instead of using rawString.This weakens the new typed routing contract and allows silent invalid values across client/server negotiation. A serializable enum (ideally with an unknown-safe fallback strategy) is safer for forward/backward compatibility.
♻️ Proposed direction
+@Serializable +enum class PlaybackQualityPreference { + `@SerialName`("auto") AUTO, + `@SerialName`("prefer_quality") PREFER_QUALITY, + `@SerialName`("prefer_stability") PREFER_STABILITY, +} + `@Serializable` data class StartPlaybackRequest( @@ - `@SerialName`("quality_preference") val qualityPreference: String? = null, + `@SerialName`("quality_preference") val qualityPreference: PlaybackQualityPreference? = null,🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@shared/src/commonMain/kotlin/com/continuum/app/model/playback/PlaybackModels.kt` at line 325, The qualityPreference field in the PlaybackModels.kt file is currently typed as a raw String, which allows any arbitrary value and weakens type safety for the wire model contract. Replace the String type with a serializable enum that defines all valid quality preference values, ensuring the enum is decorated with `@Serializable` for proper serialization support. Include an unknown or fallback value in the enum to safely handle unexpected values from the server during forward/backward compatibility scenarios, and update the qualityPreference field declaration to use this new enum type instead of String.android-shared/src/androidUnitTest/kotlin/com/continuum/app/common/player/PlaybackSessionManagerTranscodeFallbackTest.kt (1)
39-55: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winAdd assertions for forwarded
audio_track_indexandsubtitle_track_index.This suite validates codec fields, but it doesn’t lock in the newly added fallback-track forwarding contract. Add one case that passes non-default indices and asserts both JSON fields.
✅ Suggested test extension
val result = manager.startTranscodeFallback( session = session(playMethod = PlayMethod.REMUX), seekSeconds = 42.5, resolution = "1080p", mode = PlaybackSessionManager.TranscodeMode.REMUX, + audioTrackIndex = 2, + subtitleTrackIndex = 3, ) @@ assertEquals("copy", body["target_codec_video"]!!.jsonPrimitive.content) assertEquals("copy", body["target_codec_audio"]!!.jsonPrimitive.content) assertEquals(0, body["target_bitrate_kbps"]!!.jsonPrimitive.int) + assertEquals(2, body["audio_track_index"]!!.jsonPrimitive.int) + assertEquals(3, body["subtitle_track_index"]!!.jsonPrimitive.int)🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@android-shared/src/androidUnitTest/kotlin/com/continuum/app/common/player/PlaybackSessionManagerTranscodeFallbackTest.kt` around lines 39 - 55, The test for startTranscodeFallback validates codec fields but does not verify the newly added audio_track_index and subtitle_track_index forwarding behavior. Extend the test by adding non-default audio_track_index and subtitle_track_index values when creating the session object in the startTranscodeFallback call, then add assertions to verify that both audio_track_index and subtitle_track_index fields are correctly present in the captured request body JSON (similar to how target_codec_video, target_codec_audio, and target_bitrate_kbps are currently asserted).shared/src/commonMain/kotlin/com/continuum/app/repository/PlaybackRepository.kt (1)
35-88: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winDeduplicate StartPlaybackRequest construction across
startPlaybackanddecidePlayback.Both methods manually map the same fields; this is likely to drift as request schema evolves. Extract a single private builder/helper and reuse it in both call paths.
♻️ Proposed refactor
class PlaybackRepository( private val playbackApi: PlaybackApi, ) { + private fun buildStartPlaybackRequest( + fileId: Int, + profileId: String, + qualityPreference: String?, + audioTrackIndex: Int?, + subtitleTrackIndex: Int?, + startPosition: Double?, + capabilities: ClientCodecCapabilities, + clientPlaybackContext: ClientPlaybackContext?, + preserveDirectAudioSelection: Boolean, + playMethod: PlayMethod?, + ) = StartPlaybackRequest( + fileId = fileId, + profileId = profileId, + playMethod = playMethod?.wireValue(), + startPosition = startPosition, + audioTrackIndex = audioTrackIndex, + subtitleTrackIndex = subtitleTrackIndex, + qualityPreference = qualityPreference, + preserveDirectAudioSelection = preserveDirectAudioSelection, + codecsVideo = capabilities.codecsVideo, + codecsAudio = capabilities.codecsAudio, + containers = capabilities.containers, + maxResolution = capabilities.maxResolution, + hdr = capabilities.hdr, + hdrDetails = capabilities.hdrDetails, + audioPassthrough = capabilities.audioPassthrough, + clientPlaybackContext = clientPlaybackContext, + ) + suspend fun startPlayback(...): ApiResult<PlaybackSessionResponse> = - playbackApi.startPlayback( - StartPlaybackRequest( - ... - ), - ) + playbackApi.startPlayback( + buildStartPlaybackRequest( + fileId, profileId, qualityPreference, audioTrackIndex, subtitleTrackIndex, + startPosition, capabilities, clientPlaybackContext, preserveDirectAudioSelection, playMethod + ) + ) suspend fun decidePlayback(...): ApiResult<PlaybackPlanResponse> = - playbackApi.decidePlayback( - StartPlaybackRequest( - ... - ), - ) + playbackApi.decidePlayback( + buildStartPlaybackRequest( + fileId, profileId, qualityPreference, audioTrackIndex, subtitleTrackIndex, + startPosition, capabilities, clientPlaybackContext, preserveDirectAudioSelection, playMethod + ) + ) }🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@shared/src/commonMain/kotlin/com/continuum/app/repository/PlaybackRepository.kt` around lines 35 - 88, Both the startPlayback and decidePlayback methods contain identical StartPlaybackRequest construction logic with the same field mappings, creating code duplication. Extract this common logic into a private helper method (for example, buildStartPlaybackRequest) that takes the required parameters and returns a properly constructed StartPlaybackRequest object. Then refactor both startPlayback and decidePlayback to call this helper method instead of duplicating the object construction, ensuring any future schema changes only need to be made in one place.androidTvApp/src/androidMain/kotlin/com/continuum/app/tv/ui/shell/TvTopMenuBar.kt (1)
140-145: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winRequire
onSelectTabexplicitly instead of defaulting to a no-op.Library-tab click/Enter now depend on this callback; keeping a default
{}can silently disable core navigation if a caller omits wiring.♻️ Proposed change
fun TvTopMenuBar( selectedRoot: TvRootDestination?, destinations: List<TvRootDestination>, accountState: TvAccountState, onSelectRoot: (TvRootDestination) -> Unit, - onSelectTab: (TvLibraryTabType) -> Unit = {}, + onSelectTab: (TvLibraryTabType) -> Unit, onSearchClick: () -> Unit,🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@androidTvApp/src/androidMain/kotlin/com/continuum/app/tv/ui/shell/TvTopMenuBar.kt` around lines 140 - 145, The onSelectTab parameter in the TvTopMenuBar composable function has a default no-op lambda value (= {}) which can silently disable tab navigation if a caller forgets to provide the callback. Remove the default value (= {}) from the onSelectTab parameter declaration to make it required, ensuring all callers must explicitly wire the tab selection callback rather than unknowingly using a no-op implementation.android-shared/src/androidUnitTest/kotlin/com/continuum/app/common/player/video/VideoPlaybackSessionCoordinatorTest.kt (1)
31-67: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winAdd an assertion for
playbackPlanmapping in the ready-state test.This test now validates
delivery, butplaybackPlanwas added to the same mapping path and is still unasserted. Please include a non-null fixture value and assert it onready.playbackPlan.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@android-shared/src/androidUnitTest/kotlin/com/continuum/app/common/player/video/VideoPlaybackSessionCoordinatorTest.kt` around lines 31 - 67, In the `startMapsReadyResultToReadyUiState` test, add a non-null fixture value for the `playbackPlan` parameter when creating the `VideoPlaybackStartResult.Ready` object within the `FakePlaybackStarter` instantiation, and then add an assertion to verify that the `ready.playbackPlan` property matches the fixture value, similar to how other fields like `delivery` are currently asserted after the coordinator state is obtained.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In
`@android-shared/src/androidMain/kotlin/com/continuum/app/common/pairing/TlsPskPairingTransport.kt`:
- Around line 155-162: The TLS handshake loop in TlsPskPairingTransport is
unbounded because rawIn.read() can block indefinitely before PairingTransport is
created. Update the handshake path around the while (!protocol.isConnected) loop
to temporarily set a short socket soTimeout for the read, then restore the
previous timeout immediately after the protocol connects. Make the change in the
handshake/setup flow that uses rawIn, rawOut, and protocol so stalled peers time
out quickly without affecting the normal connected state.
In
`@android-shared/src/androidMain/kotlin/com/continuum/app/common/pairing/TvPairingAdvertiser.kt`:
- Around line 119-126: Stop accepting new clients after pairing reaches
Completed by changing the release path in TvPairingAdvertiser so it
closes/unregisters the NSD listener and socket instead of calling
setAdvertising() when receiver.status is PairingReceiverStatus.Completed. Update
the logic around busy.set(false) and the running/status check to preserve the
Completed state, while still allowing normal re-advertising only for
non-terminal states.
In
`@android-shared/src/androidMain/kotlin/com/continuum/app/common/player/PlaybackCapabilityDetector.kt`:
- Around line 182-187: The `audioDecodeCodecs` is being populated with values
from `caps.codecsAudio`, which already includes passthrough codecs from the
detect() call. This overstates the actual decode capability. Modify the
assignments for `mpvAudio` (when ffmpeg is available) and the fallback case
(when ffmpeg is not available) to exclude passthrough codecs from the values
assigned to `audioDecodeCodecs`. Only include the actual local decode
capabilities by filtering out codecs that the device can only pass through but
cannot decode, ensuring accurate server route decisions.
- Around line 78-82: The profile 8 case in the when expression within
PlaybackCapabilityDetector.kt currently only checks for DV8 or HDR10 support,
which causes valid Profile 8.4 HLG-base routes to be incorrectly rejected. Add
HLG support to the profile 8 condition by including a check for supportedHdr.hlg
alongside the existing dolbyVisionProfiles and hdr10 checks, so the condition
includes all three possible fallback paths for profile 8 playback capability
detection.
In
`@android-shared/src/androidMain/kotlin/com/continuum/app/common/player/PlaybackRecoveryPlanner.kt`:
- Around line 14-16: The UnsupportedDvProfile case in the
PlaybackRecoveryPlanner is directly returning ServerTranscode without consulting
the planned fallbacks. Instead of immediately returning ServerTranscode for the
UnsupportedDvProfile playability error, use the currentPlan.fallbacks to attempt
intermediate recovery options (such as alternate direct engines or remux
candidates) first, and only fall back to ServerTranscode if those intermediate
options are exhausted or unavailable. This ensures safer recovery paths are
attempted before forcing the heavier ServerTranscode fallback.
In
`@android-shared/src/androidMain/kotlin/com/continuum/app/common/ui/components/ThumbHash.kt`:
- Around line 37-42: The luminance basis count calculation in the ThumbHash
decoding logic is hardcoded based only on the hasAlpha flag, but it should
instead be extracted from the header16 encoded value to properly decode
non-square hashes. Replace the hardcoded lCount assignment on line 37 with an
extraction from header16 using bitwise operations (following the same pattern
used for pScale, qScale, and isLandscape extraction), so that lx and ly
calculations on lines 41-42 use the correct header16-driven luminance count
rather than the simplified hasAlpha-based value.
In `@androidApp/build.gradle.kts`:
- Around line 121-124: The release build configuration unconditionally assigns
the debug signingConfig via signingConfigs.getByName("debug"), which can
accidentally produce debug-signed release artifacts. Add an explicit opt-in
check before assigning the debug signing configuration so it is only applied
when a specific gradle property or environment variable is explicitly set to
true. If the opt-in is not provided, either omit the signingConfig assignment or
ensure the build fails with a clear error message to prevent accidental
debug-signed releases from being built in CI or distribution flows.
In
`@androidApp/src/androidMain/kotlin/com/continuum/app/android/ui/screens/MainScreen.kt`:
- Around line 134-139: The popUpTo call in the LaunchedEffect block for
currentTab and visibleTabs is using
navController.graph.findStartDestination().id, which can incorrectly resolve to
authentication destinations (like Login or ProfileSelection) instead of the tab
root. This breaks the navigation back stack behavior. Replace the
findStartDestination() call with a reference to a dedicated main-tabs root
destination or a nested tabs graph's start destination to ensure popUpTo always
targets the correct tab navigation hierarchy rather than the app-level start
destination.
In
`@androidApp/src/androidMain/kotlin/com/continuum/app/android/ui/screens/player/PlayerViewModel.kt`:
- Around line 1281-1289: The startSessionV2 method call is missing the selected
audio track information. While requestedPlayMethod is computed from
currentState.selectedAudioIndex, the actual selectedAudioIndex value is not
being passed to the startSessionV2 call, which causes the server to potentially
start a different audio track than intended and breaks lifecycle recovery. Add
the selectedAudioIndex (or appropriate audio track selection parameter) from
currentState to the startSessionV2 call arguments to ensure the server uses the
correct audio track. Apply this same fix to the other occurrence of
startSessionV2 referenced in the comment.
- Around line 625-634: The onEngineSwitchFailed method currently marks playback
as failed immediately, terminating the playback attempt without attempting
recovery. Instead of directly setting error state and stopping playback in
onEngineSwitchFailed, route the engine-switch failure through the fallback
handling mechanism by invoking onUnsupportedPlayback with the failure message.
This allows the system to attempt server-side fallback recovery before surfacing
the error as terminal to the user.
In `@androidTvApp/build.gradle.kts`:
- Around line 104-121: The release build type in the buildTypes block is
currently using the debug keystore via signingConfig =
signingConfigs.getByName("debug"), which poses a security risk as it would sign
distributable release artifacts with a known debug key. Remove or replace this
line in the release build configuration to either use no signing configuration
for now or reference a proper release keystore that should be created before
production distribution, ensuring that release builds are not inadvertently
signed with the debug key.
In
`@androidTvApp/src/androidMain/kotlin/com/continuum/app/tv/ui/screens/player/TvPlayerScreen.kt`:
- Around line 263-292: The `remember` block creating `videoBackend` includes
`state.subtitleUrls` in its dependency list, causing the backend to be recreated
whenever subtitles change, which triggers a remount that races with the
dedicated refresh path. Remove `state.subtitleUrls` from the dependency list of
the `remember` block so subtitle-only changes do not trigger a backend remount,
and ensure subtitle list changes including styled-subtitle engine switches are
handled exclusively through the dedicated refresh mechanism at the current
playback position.
In
`@androidTvApp/src/androidMain/kotlin/com/continuum/app/tv/ui/screens/player/TvPlayerViewModel.kt`:
- Around line 1025-1031: In the selectedSubtitleTrackIndex function, the
fallback return value of selected.index should be changed to -1. The issue is
that when a selected subtitle track has no match in subtitleUrls, returning
selected.index sends a Media3 flattened index to startTranscodeFallback which
can select the wrong server subtitle. Instead, only return an index when the
selected track was actually matched to mounted server metadata via the
firstOrNull call; otherwise return -1 to indicate no valid server subtitle match
was found.
- Around line 166-179: In the normalizedSubtitleCodec function, the current
logic doesn't properly handle empty strings from extensionless URLs or the
Media3 text/vtt MIME type. Add an additional check in the normalization section
to handle blank strings by returning null if the normalized value is empty after
trimming, and add a condition in the when statement to match the text/vtt MIME
type (checking if normalized contains "text/vtt" or equals "text/vtt") so it
correctly normalizes to "vtt" for proper subtitle codec matching.
In
`@androidTvApp/src/androidMain/kotlin/com/continuum/app/tv/ui/screens/player/TvVideoPlaybackStarter.kt`:
- Around line 129-136: The issue is that both the startTranscodeFallback call
and its secondary fallback path are converting null subtitleTrackIndex values to
-1 using the elvis operator, which disables default subtitle selection. Instead
of using `request.subtitleTrackIndex ?: -1` for the subtitleTrackIndex parameter
in both the startTranscodeFallback method call (around line 135) and the second
fallback path (around lines 155-162), preserve the null value by passing
`request.subtitleTrackIndex` directly without the elvis operator conversion,
allowing the system to respect the user's default or profile subtitle
preferences when they have not explicitly chosen a subtitle track.
In `@shared/src/commonMain/kotlin/com/continuum/app/viewmodel/HomeViewModel.kt`:
- Around line 124-126: The when expression in the getHomeSectionItems call is
incorrectly marking a section as fully resolved (true) even when the API
response contains no actual section data (when itemsResult.data.section is
null). Modify the success branch to check whether itemsResult.data.section is
not null before returning true as the resolution status. If the response data
section is null, return false to indicate the section is unresolved, keeping the
fallback section as unresolved so it doesn't get persisted as a complete
resolution in the home cache.
In
`@shared/src/commonTest/kotlin/com/continuum/app/model/playback/PlaybackModelsV2SerializationTest.kt`:
- Around line 3-5: The serialization test is missing the kotlinx.serialization
decodeFromString import, which breaks the calls to json.decodeFromString in
PlaybackModelsV2SerializationTest. Add the missing import alongside
encodeToString and Json so the existing deserialize assertions compile, and keep
the fix scoped to the test file’s import list.
---
Outside diff comments:
In
`@androidTvApp/src/androidMain/kotlin/com/continuum/app/tv/ui/screens/library/TvLibraryDetailViewModel.kt`:
- Around line 266-277: The loadedFilters flag is set to true before the API
request completes, but it is never reset to false when the filter fetch fails in
the else branch. This prevents retries since line 127 only calls loadFilters()
when !loadedFilters. Add loadedFilters = false assignment in the else branch
(the failure path) to reset the flag on failed filter fetches, allowing the
Browse screen to retry loading filters on subsequent attempts.
---
Minor comments:
In
`@android-shared/src/androidMain/kotlin/com/continuum/app/common/player/PlaybackCapabilityDetector.kt`:
- Around line 324-328: The selectedFormat() helper in PlaybackCapabilityDetector
should not fall back to the first track when no selected track exists. Update
Tracks.Group.selectedFormat() so it only returns the currently selected track
format via isTrackSelected/getTrackFormat, and returns null when none are
selected instead of using mediaTrackGroup.getFormat(0). This keeps transient
unselected states from being treated as supported by accident.
In
`@android-shared/src/androidUnitTest/kotlin/com/continuum/app/common/player/ContinuumPlaybackServiceEngineSourceTest.kt`:
- Around line 48-50: The issue is that substringAfter on the src variable
returns the entire file content if the "private fun bindNewPlayer(" marker is
not found, allowing the test to potentially pass when asserting against
unrelated text. Add validation to ensure the function boundary was actually
found before using the extracted bindBody, either by checking that the result
differs from the original src string or by using a require/check statement to
fail the test immediately when the marker is not found in the source.
In
`@androidTvApp/src/androidMain/kotlin/com/continuum/app/tv/ui/components/TvFocusMarqueeModel.kt`:
- Around line 133-136: Update the documentation and comments in the
TvFocusMarqueeModel class to reflect the actual badge normalization behavior.
The code now normalizes Dolby Vision-like HDR values to "HDR" and Atmos-only
audio to "AUDIO", but any nearby documentation, comments, or examples (such as
KDoc comments or inline descriptions of what badges are emitted) likely still
reference the old labels like "DOLBY VISION" or "ATMOS". Find and update these
documentation references to accurately describe that the badges property will
emit "HDR" for Dolby Vision content and "AUDIO" for Atmos-only audio instead of
the unnormalized values.
In
`@androidTvApp/src/androidMain/kotlin/com/continuum/app/tv/ui/screens/player/TvPlayerHud.kt`:
- Line 435: The HDR badge logic in TvPlayerHud’s badge-building flow should keep
the plan-based badge as the primary source, but restore the runtime fallback
when the plan badge is absent. Update the existing
playbackPlan.validatedHdrBadge() check so the same badge list also considers
stats.hdrMode (or the existing stats-based HDR helper) for legacy/local or
unhydrated playbackPlan cases, ensuring the fallback is only used when no plan
badge is available.
In
`@androidTvApp/src/androidMain/kotlin/com/continuum/app/tv/ui/shell/TvMainShell.kt`:
- Around line 235-236: The contentUpFallback mutable state variable is not reset
when the currentRoute changes, which can cause stale callbacks from previous
routes to persist and affect Up-key navigation on subsequent routes. Add a
LaunchedEffect block in TvMainShell that observes currentRoute as its key and
resets contentUpFallback to null inside that effect. This ensures that whenever
the route changes, the fallback callback is cleared before the new route's
callback (if any) can be set via onContentUpFallbackChanged, preventing stale
routing across route transitions.
In `@docs/plans/uiux-overhaul-remaining-phases.md`:
- Line 59: The fenced code block opening on line 59 is missing a language
identifier after the triple backticks, which violates markdownlint rule MD040.
Add "text" as the language specifier immediately after the opening ``` to fix
this linting error.
---
Nitpick comments:
In
`@android-shared/src/androidUnitTest/kotlin/com/continuum/app/common/player/PlaybackSessionManagerTranscodeFallbackTest.kt`:
- Around line 39-55: The test for startTranscodeFallback validates codec fields
but does not verify the newly added audio_track_index and subtitle_track_index
forwarding behavior. Extend the test by adding non-default audio_track_index and
subtitle_track_index values when creating the session object in the
startTranscodeFallback call, then add assertions to verify that both
audio_track_index and subtitle_track_index fields are correctly present in the
captured request body JSON (similar to how target_codec_video,
target_codec_audio, and target_bitrate_kbps are currently asserted).
In
`@android-shared/src/androidUnitTest/kotlin/com/continuum/app/common/player/video/VideoPlaybackSessionCoordinatorTest.kt`:
- Around line 31-67: In the `startMapsReadyResultToReadyUiState` test, add a
non-null fixture value for the `playbackPlan` parameter when creating the
`VideoPlaybackStartResult.Ready` object within the `FakePlaybackStarter`
instantiation, and then add an assertion to verify that the `ready.playbackPlan`
property matches the fixture value, similar to how other fields like `delivery`
are currently asserted after the coordinator state is obtained.
In
`@androidTvApp/src/androidMain/kotlin/com/continuum/app/tv/ui/shell/TvTopMenuBar.kt`:
- Around line 140-145: The onSelectTab parameter in the TvTopMenuBar composable
function has a default no-op lambda value (= {}) which can silently disable tab
navigation if a caller forgets to provide the callback. Remove the default value
(= {}) from the onSelectTab parameter declaration to make it required, ensuring
all callers must explicitly wire the tab selection callback rather than
unknowingly using a no-op implementation.
In
`@shared/src/commonMain/kotlin/com/continuum/app/model/playback/PlaybackModels.kt`:
- Line 325: The qualityPreference field in the PlaybackModels.kt file is
currently typed as a raw String, which allows any arbitrary value and weakens
type safety for the wire model contract. Replace the String type with a
serializable enum that defines all valid quality preference values, ensuring the
enum is decorated with `@Serializable` for proper serialization support. Include
an unknown or fallback value in the enum to safely handle unexpected values from
the server during forward/backward compatibility scenarios, and update the
qualityPreference field declaration to use this new enum type instead of String.
In
`@shared/src/commonMain/kotlin/com/continuum/app/repository/PlaybackRepository.kt`:
- Around line 35-88: Both the startPlayback and decidePlayback methods contain
identical StartPlaybackRequest construction logic with the same field mappings,
creating code duplication. Extract this common logic into a private helper
method (for example, buildStartPlaybackRequest) that takes the required
parameters and returns a properly constructed StartPlaybackRequest object. Then
refactor both startPlayback and decidePlayback to call this helper method
instead of duplicating the object construction, ensuring any future schema
changes only need to be made in one place.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 3765d55e-21de-4372-9d0f-2d91e1981ae4
📒 Files selected for processing (133)
CLAUDE.mdFEATURES.mdandroid-shared/src/androidMain/kotlin/com/continuum/app/common/pairing/PairingReceiver.ktandroid-shared/src/androidMain/kotlin/com/continuum/app/common/pairing/TlsPskPairingTransport.ktandroid-shared/src/androidMain/kotlin/com/continuum/app/common/pairing/TvPairingAdvertiser.ktandroid-shared/src/androidMain/kotlin/com/continuum/app/common/player/AudioCapabilityManager.ktandroid-shared/src/androidMain/kotlin/com/continuum/app/common/player/ContinuumPlaybackService.ktandroid-shared/src/androidMain/kotlin/com/continuum/app/common/player/ContinuumPlayerFactory.ktandroid-shared/src/androidMain/kotlin/com/continuum/app/common/player/DisplayHdrProbe.ktandroid-shared/src/androidMain/kotlin/com/continuum/app/common/player/PlaybackCapabilityDetector.ktandroid-shared/src/androidMain/kotlin/com/continuum/app/common/player/PlaybackRecoveryPlanner.ktandroid-shared/src/androidMain/kotlin/com/continuum/app/common/player/PlaybackSessionLifecycle.ktandroid-shared/src/androidMain/kotlin/com/continuum/app/common/player/PlaybackSessionManager.ktandroid-shared/src/androidMain/kotlin/com/continuum/app/common/player/VideoPlayerMediaMounter.ktandroid-shared/src/androidMain/kotlin/com/continuum/app/common/player/VideoPlayerMediaSpec.ktandroid-shared/src/androidMain/kotlin/com/continuum/app/common/player/backend/MpvVideoPlaybackBackend.ktandroid-shared/src/androidMain/kotlin/com/continuum/app/common/player/backend/PlaybackEngineDecision.ktandroid-shared/src/androidMain/kotlin/com/continuum/app/common/player/backend/VideoPlaybackBackendRequest.ktandroid-shared/src/androidMain/kotlin/com/continuum/app/common/player/backend/VideoPlaybackBackendSelector.ktandroid-shared/src/androidMain/kotlin/com/continuum/app/common/player/mpv/MpvPlayer.ktandroid-shared/src/androidMain/kotlin/com/continuum/app/common/player/video/OriginalPlaybackRequestPolicy.ktandroid-shared/src/androidMain/kotlin/com/continuum/app/common/player/video/PlaybackContainerPolicy.ktandroid-shared/src/androidMain/kotlin/com/continuum/app/common/player/video/PlaybackDeliveryResolver.ktandroid-shared/src/androidMain/kotlin/com/continuum/app/common/player/video/VideoPlaybackSessionCoordinator.ktandroid-shared/src/androidMain/kotlin/com/continuum/app/common/player/video/VideoPlaybackStartRequest.ktandroid-shared/src/androidMain/kotlin/com/continuum/app/common/player/video/VideoPlaybackStartResult.ktandroid-shared/src/androidMain/kotlin/com/continuum/app/common/player/video/VideoPlayerUiState.ktandroid-shared/src/androidMain/kotlin/com/continuum/app/common/ui/components/ThumbHash.ktandroid-shared/src/androidMain/kotlin/com/continuum/app/common/ui/components/ThumbhashImage.ktandroid-shared/src/androidUnitTest/kotlin/com/continuum/app/common/pairing/PairingReceiverTest.ktandroid-shared/src/androidUnitTest/kotlin/com/continuum/app/common/player/ContinuumPlaybackServiceEngineSourceTest.ktandroid-shared/src/androidUnitTest/kotlin/com/continuum/app/common/player/PlaybackCapabilityDetectorSourceTest.ktandroid-shared/src/androidUnitTest/kotlin/com/continuum/app/common/player/PlaybackRecoveryPlannerTest.ktandroid-shared/src/androidUnitTest/kotlin/com/continuum/app/common/player/PlaybackSessionManagerTranscodeFallbackTest.ktandroid-shared/src/androidUnitTest/kotlin/com/continuum/app/common/player/VideoPlayerMediaSpecTest.ktandroid-shared/src/androidUnitTest/kotlin/com/continuum/app/common/player/backend/PlaybackEngineCommandTest.ktandroid-shared/src/androidUnitTest/kotlin/com/continuum/app/common/player/backend/PlaybackEngineDecisionTest.ktandroid-shared/src/androidUnitTest/kotlin/com/continuum/app/common/player/backend/VideoPlaybackBackendSelectorTest.ktandroid-shared/src/androidUnitTest/kotlin/com/continuum/app/common/player/mpv/MpvPlayerSourceTest.ktandroid-shared/src/androidUnitTest/kotlin/com/continuum/app/common/player/video/OriginalPlaybackRequestPolicyTest.ktandroid-shared/src/androidUnitTest/kotlin/com/continuum/app/common/player/video/PlaybackContainerPolicyTest.ktandroid-shared/src/androidUnitTest/kotlin/com/continuum/app/common/player/video/PlaybackDeliveryResolverTest.ktandroid-shared/src/androidUnitTest/kotlin/com/continuum/app/common/player/video/VideoPlaybackSessionCoordinatorTest.ktandroidApp/build.gradle.ktsandroidApp/src/androidMain/kotlin/com/continuum/app/android/ContinuumApplication.ktandroidApp/src/androidMain/kotlin/com/continuum/app/android/MainActivity.ktandroidApp/src/androidMain/kotlin/com/continuum/app/android/di/AndroidModule.ktandroidApp/src/androidMain/kotlin/com/continuum/app/android/ui/components/FavoriteButton.ktandroidApp/src/androidMain/kotlin/com/continuum/app/android/ui/components/HeroBackdropLayers.ktandroidApp/src/androidMain/kotlin/com/continuum/app/android/ui/components/MainAppTopBar.ktandroidApp/src/androidMain/kotlin/com/continuum/app/android/ui/components/MediaCard.ktandroidApp/src/androidMain/kotlin/com/continuum/app/android/ui/components/MediaRow.ktandroidApp/src/androidMain/kotlin/com/continuum/app/android/ui/components/Skeleton.ktandroidApp/src/androidMain/kotlin/com/continuum/app/android/ui/components/WatchlistButton.ktandroidApp/src/androidMain/kotlin/com/continuum/app/android/ui/navigation/AppNavigation.ktandroidApp/src/androidMain/kotlin/com/continuum/app/android/ui/navigation/Routes.ktandroidApp/src/androidMain/kotlin/com/continuum/app/android/ui/navigation/SharedElementTransition.ktandroidApp/src/androidMain/kotlin/com/continuum/app/android/ui/screens/MainScreen.ktandroidApp/src/androidMain/kotlin/com/continuum/app/android/ui/screens/browse/BrowseScreen.ktandroidApp/src/androidMain/kotlin/com/continuum/app/android/ui/screens/detail/DetailSharedComponents.ktandroidApp/src/androidMain/kotlin/com/continuum/app/android/ui/screens/detail/ItemDetailScreen.ktandroidApp/src/androidMain/kotlin/com/continuum/app/android/ui/screens/detail/MediaSelectors.ktandroidApp/src/androidMain/kotlin/com/continuum/app/android/ui/screens/detail/SimilarRail.ktandroidApp/src/androidMain/kotlin/com/continuum/app/android/ui/screens/home/FeaturedCarousel.ktandroidApp/src/androidMain/kotlin/com/continuum/app/android/ui/screens/home/HomeScreen.ktandroidApp/src/androidMain/kotlin/com/continuum/app/android/ui/screens/libraries/LibrariesScreen.ktandroidApp/src/androidMain/kotlin/com/continuum/app/android/ui/screens/personal/PersonalMediaGridContent.ktandroidApp/src/androidMain/kotlin/com/continuum/app/android/ui/screens/player/MobileVideoPlaybackStarter.ktandroidApp/src/androidMain/kotlin/com/continuum/app/android/ui/screens/player/PlayerControls.ktandroidApp/src/androidMain/kotlin/com/continuum/app/android/ui/screens/player/PlayerOverlay.ktandroidApp/src/androidMain/kotlin/com/continuum/app/android/ui/screens/player/PlayerProgressBar.ktandroidApp/src/androidMain/kotlin/com/continuum/app/android/ui/screens/player/PlayerScreen.ktandroidApp/src/androidMain/kotlin/com/continuum/app/android/ui/screens/player/PlayerViewModel.ktandroidApp/src/androidMain/kotlin/com/continuum/app/android/ui/screens/settings/AppearanceSettings.ktandroidApp/src/androidMain/kotlin/com/continuum/app/android/ui/screens/settings/SettingsScreen.ktandroidApp/src/androidMain/kotlin/com/continuum/app/android/ui/screens/settings/SettingsViewModel.ktandroidApp/src/androidMain/kotlin/com/continuum/app/android/ui/theme/Theme.ktandroidApp/src/androidMain/kotlin/com/continuum/app/android/ui/theme/ThemeManager.ktandroidApp/src/androidUnitTest/kotlin/com/continuum/app/android/ui/navigation/MobileSharedElementSourceTest.ktandroidApp/src/androidUnitTest/kotlin/com/continuum/app/android/ui/screens/player/PlayerScreenStartPositionTest.ktandroidApp/src/androidUnitTest/kotlin/com/continuum/app/android/ui/screens/player/PlayerViewModelSharedCoordinatorTest.ktandroidTvApp/build.gradle.ktsandroidTvApp/src/androidMain/kotlin/com/continuum/app/tv/ContinuumTvApplication.ktandroidTvApp/src/androidMain/kotlin/com/continuum/app/tv/MainTvActivity.ktandroidTvApp/src/androidMain/kotlin/com/continuum/app/tv/ui/components/TvAnimatedMeshBackground.ktandroidTvApp/src/androidMain/kotlin/com/continuum/app/tv/ui/components/TvAuroraBackdrop.ktandroidTvApp/src/androidMain/kotlin/com/continuum/app/tv/ui/components/TvCascadeSelector.ktandroidTvApp/src/androidMain/kotlin/com/continuum/app/tv/ui/components/TvCatalogGrid.ktandroidTvApp/src/androidMain/kotlin/com/continuum/app/tv/ui/components/TvFocusMarqueeModel.ktandroidTvApp/src/androidMain/kotlin/com/continuum/app/tv/ui/components/TvSkylineSectionFeed.ktandroidTvApp/src/androidMain/kotlin/com/continuum/app/tv/ui/navigation/TvAppNavigation.ktandroidTvApp/src/androidMain/kotlin/com/continuum/app/tv/ui/navigation/TvRoute.ktandroidTvApp/src/androidMain/kotlin/com/continuum/app/tv/ui/screens/auth/TvLoginScreen.ktandroidTvApp/src/androidMain/kotlin/com/continuum/app/tv/ui/screens/auth/TvServerSetupScreen.ktandroidTvApp/src/androidMain/kotlin/com/continuum/app/tv/ui/screens/detail/TvItemDetailScreen.ktandroidTvApp/src/androidMain/kotlin/com/continuum/app/tv/ui/screens/home/TvHomeScreen.ktandroidTvApp/src/androidMain/kotlin/com/continuum/app/tv/ui/screens/library/TvLibraryDetailScreen.ktandroidTvApp/src/androidMain/kotlin/com/continuum/app/tv/ui/screens/library/TvLibraryDetailViewModel.ktandroidTvApp/src/androidMain/kotlin/com/continuum/app/tv/ui/screens/player/TvPlayerHud.ktandroidTvApp/src/androidMain/kotlin/com/continuum/app/tv/ui/screens/player/TvPlayerScreen.ktandroidTvApp/src/androidMain/kotlin/com/continuum/app/tv/ui/screens/player/TvPlayerViewModel.ktandroidTvApp/src/androidMain/kotlin/com/continuum/app/tv/ui/screens/player/TvVideoPlaybackStarter.ktandroidTvApp/src/androidMain/kotlin/com/continuum/app/tv/ui/screens/profiles/TvProfileSelectionScreen.ktandroidTvApp/src/androidMain/kotlin/com/continuum/app/tv/ui/shell/TvMainShell.ktandroidTvApp/src/androidMain/kotlin/com/continuum/app/tv/ui/shell/TvShellFocusState.ktandroidTvApp/src/androidMain/kotlin/com/continuum/app/tv/ui/shell/TvTopMenuBar.ktandroidTvApp/src/androidMain/kotlin/com/continuum/app/tv/ui/theme/Layout.ktandroidTvApp/src/androidUnitTest/kotlin/com/continuum/app/tv/ui/components/TvSkylineSectionFeedSourceTest.ktandroidTvApp/src/androidUnitTest/kotlin/com/continuum/app/tv/ui/screens/player/PlayerTrackEntriesTest.ktandroidTvApp/src/androidUnitTest/kotlin/com/continuum/app/tv/ui/screens/player/TvPlayerEngineRequestHelpersTest.ktandroidTvApp/src/androidUnitTest/kotlin/com/continuum/app/tv/ui/screens/player/TvPlayerScreenStartPositionTest.ktandroidTvApp/src/androidUnitTest/kotlin/com/continuum/app/tv/ui/screens/player/TvPlayerViewModelSharedCoordinatorTest.ktandroidTvApp/src/androidUnitTest/kotlin/com/continuum/app/tv/ui/screens/profiles/TvProfileSelectionScreenSourceTest.ktandroidTvApp/src/androidUnitTest/kotlin/com/continuum/app/tv/ui/screens/watchtogether/TvWatchTogetherHostTargetTest.ktandroidTvApp/src/androidUnitTest/kotlin/com/continuum/app/tv/ui/shell/TvCascadeInteractionSourceTest.ktandroidTvApp/src/androidUnitTest/kotlin/com/continuum/app/tv/ui/shell/TvShellFocusSourceTest.ktandroidTvApp/src/androidUnitTest/kotlin/com/continuum/app/tv/ui/shell/TvShellFocusStateTest.ktbaselineprofile/build.gradle.ktsbaselineprofile/src/main/kotlin/com/continuum/app/baselineprofile/BaselineProfileGenerator.ktbuild.gradle.ktsdocs/media3/09-direct-play-route-planning-spec.mddocs/media3/README.mddocs/plans/uiux-overhaul-remaining-phases.mdgradle/libs.versions.tomlproguard-rules.proscripts/build-push-shield.shsettings.gradle.ktsshared/src/androidMain/kotlin/com/continuum/app/network/ContinuumHttpClient.android.ktshared/src/commonMain/kotlin/com/continuum/app/model/playback/PlaybackModels.ktshared/src/commonMain/kotlin/com/continuum/app/network/api/PlaybackApi.ktshared/src/commonMain/kotlin/com/continuum/app/repository/PlaybackRepository.ktshared/src/commonMain/kotlin/com/continuum/app/viewmodel/HomeViewModel.ktshared/src/commonTest/kotlin/com/continuum/app/model/playback/PlaybackModelsV2SerializationTest.kt
💤 Files with no reviewable changes (10)
- androidTvApp/src/androidUnitTest/kotlin/com/continuum/app/tv/ui/screens/watchtogether/TvWatchTogetherHostTargetTest.kt
- androidApp/src/androidMain/kotlin/com/continuum/app/android/ui/components/FavoriteButton.kt
- androidApp/src/androidMain/kotlin/com/continuum/app/android/ui/components/WatchlistButton.kt
- androidApp/src/androidMain/kotlin/com/continuum/app/android/ui/screens/settings/AppearanceSettings.kt
- androidApp/src/androidMain/kotlin/com/continuum/app/android/ui/theme/Theme.kt
- androidApp/src/androidMain/kotlin/com/continuum/app/android/ui/screens/settings/SettingsScreen.kt
- androidApp/src/androidMain/kotlin/com/continuum/app/android/ui/theme/ThemeManager.kt
- androidTvApp/src/androidMain/kotlin/com/continuum/app/tv/ui/components/TvAnimatedMeshBackground.kt
- androidApp/src/androidMain/kotlin/com/continuum/app/android/ui/screens/settings/SettingsViewModel.kt
- androidTvApp/src/androidMain/kotlin/com/continuum/app/tv/ui/navigation/TvRoute.kt
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 8e64e10d9a
ℹ️ 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".
| compileSdk = 36 | ||
| defaultConfig { | ||
| applicationId = "com.continuum.app.tv" | ||
| applicationId = "com.silo.app.tv" |
There was a problem hiding this comment.
For any upgrade or ADB install over the existing Android TV app, changing the package from com.continuum.app.tv to com.silo.app.tv makes Android treat this as a separate application, so current users won't receive an in-place update and their existing tokens/settings/download metadata remain under the old package. This also violates the repo instruction in AGENTS.md to keep the existing application ID namespaces for install continuity during the migration.
Useful? React with 👍 / 👎.
| composable(Route.Reading.route) { | ||
| MainScreen(navController, Tab.Libraries) | ||
| } | ||
| composable(Route.Home.route) { |
There was a problem hiding this comment.
Keep legacy tab aliases in the nav graph
On phone upgrades where Navigation restores an existing back stack that still contains the old video, audio, or reading route, this graph no longer has any destination that can satisfy those saved entries, even though the previous code explicitly kept aliases to avoid old back stacks crashing. Re-adding those aliases to Home/Libraries preserves install continuity without exposing them as bottom-nav tabs.
Useful? React with 👍 / 👎.
| uiState.playbackPlan, | ||
| uiState.delivery, | ||
| uiState.container, | ||
| uiState.subtitleTracks, |
There was a problem hiding this comment.
Avoid remounting playback when subtitles refresh
When a user downloads or AI-generates a subtitle during playback, refreshSubtitles updates uiState.subtitleTracks and the refresh nonce, but making the whole subtitle list part of the remembered backend identity recreates videoBackend first; that retriggers the initial mount effect and calls mount with uiState.startPosition instead of preserving the live position via the refresh path, so playback can jump back to the original start/resume point.
Useful? React with 👍 / 👎.
| } | ||
| val effectiveStreamUrl = localUri ?: streamUrl | ||
| val plan = if (localUri == null) uiState.playbackPlan else null | ||
| val delivery = if (localUri == null) plan?.delivery ?: uiState.delivery else null |
There was a problem hiding this comment.
Clear stale delivery after audio stream switches
When a phone audio-track change returns a different stream/play method, PlayerViewModel.onSelectAudio updates only streamUrl and playMethod, so uiState.delivery can still describe the previous route. This line then passes that stale delivery into VideoPlayerMediaSpec; because ContinuumPlayerFactory gives delivery precedence over playMethod, switching from a direct stream to a transcoded/remuxed HLS stream can be mounted with the old MIME/backend decision and fail to load.
Useful? React with 👍 / 👎.
… perf Correctness: - MPV: guard seamless playlist advance so the END_FILE of the finished item no longer raises a spurious fatal error mid-queue - Playback plan: tolerant deserializer degrades a present-but-incomplete plan to null (V1 fallback) instead of failing the whole session-start response - Recovery: single-flight guard; attempted-engine tracking (no MEDIA3<->MPV ping-pong); unsupported audio/channel transcodes instead of remux-copy; engine-switch failure uses the planner ladder; ServerRemux carries delivery - Bounded same-route retry for transient network errors before demoting - HomeViewModel: honor the top-level items field in a section refetch response - MPV passthrough: normalize codec variants; log unmappable (AC-4) instead of silently disabling passthrough - PlayMethod.wireValue() mirrors @SerialName exhaustively Quality: - ThumbHash placeholder decodes off the composition thread + process cache - Memoize the static MediaCodec/HDR probe (was ~4x per playback start) - Remove dead VideoPlaybackStartResult.Error.cause; log the throwable instead - Extract triplicated immediateServerFallbackMode into a shared typed helper - TV up-nav: move focus synchronously when the target row is laid out Defensive: - Re-add video/audio/reading/inbox route aliases that redirect to Home so a restored back stack can't hit an unregistered destination Tests: tolerant-plan serialization case; recovery planner cases for transcode-not-remux, attempted-engine exclusion, and carried remux delivery. Co-Authored-By: Claude Opus 4.8 <[email protected]>
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)
shared/src/commonMain/kotlin/com/continuum/app/model/playback/PlaybackModels.kt (1)
163-173: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winLog the swallowed deserialization failure for observability.
The tolerant degrade-to-null behavior is well-reasoned, but silently dropping the plan makes it hard to detect when the server is shipping malformed/incomplete plans in the field — playback will quietly fall back to legacy V1 routing with no signal. Capturing the exception (debug log/metric) before returning
nullpreserves the safe degrade while keeping the failure diagnosable, and resolves the detektSwallowedExceptionflag at Line 170.♻️ Suggested change
return try { jsonDecoder.json.decodeFromJsonElement(delegate, element) } catch (e: SerializationException) { + // Plan present but incomplete/malformed: degrade to legacy V1 routing. + // Log so field issues with server-sent plans remain diagnosable. + co.touch.logging.log.w(e) { "Dropping malformed playback_plan; falling back to V1 routing" } null }Adjust the logger call to match the project's logging facility.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@shared/src/commonMain/kotlin/com/continuum/app/model/playback/PlaybackModels.kt` around lines 163 - 173, The SerializationException caught in the catch block within the deserialize method is being silently swallowed without any logging, making it impossible to detect malformed plans from the server in production. Add a log statement before returning null in the catch block to capture the exception details using the project's logging facility, preserving the safe degrade-to-null behavior while maintaining observability and resolving the detekt SwallowedException flag.Source: Linters/SAST tools
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In
`@android-shared/src/androidMain/kotlin/com/continuum/app/common/player/video/ImmediateServerFallbackPolicy.kt`:
- Around line 23-31: The `immediateServerFallbackMode()` function currently
returns `null` in the `else` branch for any unrecognized route blockers, which
allows playback to proceed with direct launch even when blockers are present.
Instead, check if the `blockers` set is not empty in the `else` branch and
return `PlaybackSessionManager.TranscodeMode.FULL` to safely degrade when
encountering unknown blockers, only returning `null` when no blockers are
present at all.
---
Nitpick comments:
In
`@shared/src/commonMain/kotlin/com/continuum/app/model/playback/PlaybackModels.kt`:
- Around line 163-173: The SerializationException caught in the catch block
within the deserialize method is being silently swallowed without any logging,
making it impossible to detect malformed plans from the server in production.
Add a log statement before returning null in the catch block to capture the
exception details using the project's logging facility, preserving the safe
degrade-to-null behavior while maintaining observability and resolving the
detekt SwallowedException flag.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 61026aff-1619-4765-84dc-331e3eed6eff
📒 Files selected for processing (18)
android-shared/src/androidMain/kotlin/com/continuum/app/common/player/MediaCodecCapabilitiesProbe.ktandroid-shared/src/androidMain/kotlin/com/continuum/app/common/player/PlaybackCapabilityDetector.ktandroid-shared/src/androidMain/kotlin/com/continuum/app/common/player/PlaybackRecoveryPlanner.ktandroid-shared/src/androidMain/kotlin/com/continuum/app/common/player/mpv/MpvPlayer.ktandroid-shared/src/androidMain/kotlin/com/continuum/app/common/player/video/ImmediateServerFallbackPolicy.ktandroid-shared/src/androidMain/kotlin/com/continuum/app/common/player/video/VideoPlaybackStartResult.ktandroid-shared/src/androidMain/kotlin/com/continuum/app/common/ui/components/ThumbhashImage.ktandroid-shared/src/androidUnitTest/kotlin/com/continuum/app/common/player/PlaybackRecoveryPlannerTest.ktandroidApp/src/androidMain/kotlin/com/continuum/app/android/ui/navigation/AppNavigation.ktandroidApp/src/androidMain/kotlin/com/continuum/app/android/ui/screens/player/MobileVideoPlaybackStarter.ktandroidApp/src/androidMain/kotlin/com/continuum/app/android/ui/screens/player/PlayerViewModel.ktandroidTvApp/src/androidMain/kotlin/com/continuum/app/tv/ui/components/TvSkylineSectionFeed.ktandroidTvApp/src/androidMain/kotlin/com/continuum/app/tv/ui/screens/player/TvPlayerViewModel.ktandroidTvApp/src/androidMain/kotlin/com/continuum/app/tv/ui/screens/player/TvVideoPlaybackStarter.ktshared/src/commonMain/kotlin/com/continuum/app/model/playback/PlaybackModels.ktshared/src/commonMain/kotlin/com/continuum/app/repository/PlaybackRepository.ktshared/src/commonMain/kotlin/com/continuum/app/viewmodel/HomeViewModel.ktshared/src/commonTest/kotlin/com/continuum/app/model/playback/PlaybackModelsV2SerializationTest.kt
💤 Files with no reviewable changes (1)
- android-shared/src/androidMain/kotlin/com/continuum/app/common/player/video/VideoPlaybackStartResult.kt
🚧 Files skipped from review as they are similar to previous changes (11)
- shared/src/commonTest/kotlin/com/continuum/app/model/playback/PlaybackModelsV2SerializationTest.kt
- shared/src/commonMain/kotlin/com/continuum/app/viewmodel/HomeViewModel.kt
- android-shared/src/androidMain/kotlin/com/continuum/app/common/ui/components/ThumbhashImage.kt
- shared/src/commonMain/kotlin/com/continuum/app/repository/PlaybackRepository.kt
- androidTvApp/src/androidMain/kotlin/com/continuum/app/tv/ui/components/TvSkylineSectionFeed.kt
- androidApp/src/androidMain/kotlin/com/continuum/app/android/ui/navigation/AppNavigation.kt
- android-shared/src/androidMain/kotlin/com/continuum/app/common/player/PlaybackCapabilityDetector.kt
- androidTvApp/src/androidMain/kotlin/com/continuum/app/tv/ui/screens/player/TvVideoPlaybackStarter.kt
- androidApp/src/androidMain/kotlin/com/continuum/app/android/ui/screens/player/PlayerViewModel.kt
- androidTvApp/src/androidMain/kotlin/com/continuum/app/tv/ui/screens/player/TvPlayerViewModel.kt
- android-shared/src/androidMain/kotlin/com/continuum/app/common/player/mpv/MpvPlayer.kt
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In
`@androidApp/src/androidMain/kotlin/com/continuum/app/android/ui/screens/player/PlayerViewModel.kt`:
- Around line 552-568: In the onUnsupportedPlayback method, the
startTranscodeFallback call does not preserve the user's current audio and
subtitle track selections when initiating the fallback. Extract the current
selected audio track index and subtitle track index from the state object
(similar to how selectedVersionIndex is retrieved), and pass these values to the
startTranscodeFallback method call so that user track preferences are maintained
during the fallback instead of being reset to defaults.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 1f9eff47-d87c-4380-9146-0a00134cd767
📒 Files selected for processing (18)
android-shared/src/androidMain/kotlin/com/continuum/app/common/pairing/TlsPskPairingTransport.ktandroid-shared/src/androidMain/kotlin/com/continuum/app/common/pairing/TvPairingAdvertiser.ktandroid-shared/src/androidMain/kotlin/com/continuum/app/common/player/PlaybackCapabilityDetector.ktandroid-shared/src/androidMain/kotlin/com/continuum/app/common/player/PlaybackSessionManager.ktandroid-shared/src/androidMain/kotlin/com/continuum/app/common/player/video/ImmediateServerFallbackPolicy.ktandroid-shared/src/androidMain/kotlin/com/continuum/app/common/ui/components/ThumbHash.ktandroidApp/build.gradle.ktsandroidApp/src/androidMain/kotlin/com/continuum/app/android/ui/screens/MainScreen.ktandroidApp/src/androidMain/kotlin/com/continuum/app/android/ui/screens/player/MobileVideoPlaybackStarter.ktandroidApp/src/androidMain/kotlin/com/continuum/app/android/ui/screens/player/PlayerScreen.ktandroidApp/src/androidMain/kotlin/com/continuum/app/android/ui/screens/player/PlayerViewModel.ktandroidTvApp/build.gradle.ktsandroidTvApp/src/androidMain/kotlin/com/continuum/app/tv/ui/screens/player/TvPlayerScreen.ktandroidTvApp/src/androidMain/kotlin/com/continuum/app/tv/ui/screens/player/TvPlayerViewModel.ktandroidTvApp/src/androidMain/kotlin/com/continuum/app/tv/ui/screens/player/TvVideoPlaybackStarter.ktshared/src/commonMain/kotlin/com/continuum/app/model/playback/PlaybackModels.ktshared/src/commonMain/kotlin/com/continuum/app/viewmodel/HomeViewModel.ktshared/src/commonTest/kotlin/com/continuum/app/model/playback/PlaybackModelsV2SerializationTest.kt
🚧 Files skipped from review as they are similar to previous changes (11)
- shared/src/commonMain/kotlin/com/continuum/app/viewmodel/HomeViewModel.kt
- android-shared/src/androidMain/kotlin/com/continuum/app/common/player/PlaybackCapabilityDetector.kt
- androidApp/src/androidMain/kotlin/com/continuum/app/android/ui/screens/player/MobileVideoPlaybackStarter.kt
- androidApp/build.gradle.kts
- android-shared/src/androidMain/kotlin/com/continuum/app/common/pairing/TvPairingAdvertiser.kt
- shared/src/commonMain/kotlin/com/continuum/app/model/playback/PlaybackModels.kt
- androidApp/src/androidMain/kotlin/com/continuum/app/android/ui/screens/player/PlayerScreen.kt
- android-shared/src/androidMain/kotlin/com/continuum/app/common/pairing/TlsPskPairingTransport.kt
- androidTvApp/src/androidMain/kotlin/com/continuum/app/tv/ui/screens/player/TvPlayerScreen.kt
- androidTvApp/src/androidMain/kotlin/com/continuum/app/tv/ui/screens/player/TvPlayerViewModel.kt
- android-shared/src/androidMain/kotlin/com/continuum/app/common/ui/components/ThumbHash.kt
Summary
This PR bundles the Android player hardening and UI/QoL fluidity work from
uiux-fluidity-overhaul.The biggest change is playback routing: Android now understands typed playback plans, per-engine capabilities, route delivery, fallback candidates, and route-event reporting instead of inferring too much from
play_methodand URL shape. Phone and TV playback both pass richer start context, preserve selected tracks through fallback, await engine switches before mounting media, and can recover through alternate direct engines, server remux, or server transcode when direct playback fails.It also lands the UI/UX polish pass across phone and TV: thumbhash blur-up placeholders, content-shaped skeleton loaders, shared-element phone hero transitions, QuickStart buffering, a buffered scrubber, smoother TV scroll/focus behavior, cleaned-up navigation routes, and removal of currently-unexposed inbox/notifications entry points.
Highlights
TvShellFocusStateValidation
:androidTvApp:testDebugUnitTestwas revived and now runs the TV suite instead of silently compiling zero tests.Known follow-ups / gated checks
:baselineprofile:generateBaselineProfileneeds a device/emulator run.:androidApp:testDebugUnitTeststill has pre-existing unrelated failures noted in the branch docs.Summary by CodeRabbit