Skip to content

Uiux fluidity overhaul - #4

Merged
Quick104 merged 29 commits into
mainfrom
uiux-fluidity-overhaul
Jun 23, 2026
Merged

Quick104 merged 29 commits into
mainfrom
uiux-fluidity-overhaul

Conversation

@Quick104

@Quick104 Quick104 commented Jun 23, 2026 •

Copy link
Copy Markdown
Contributor

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_method and 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

  • Improve playback startup and recovery:
    • richer Media3/MPV backend requests
    • awaited engine switching before mount
    • direct/remux/transcode delivery resolution
    • server fallback with selected audio/subtitle preservation
    • player-error and preflight recovery planning
  • Improve player QoL:
    • QuickStart buffer policy
    • buffered progress track on phone
    • better start-position handling
    • TV subtitle preselection mapped against mounted subtitle metadata
  • Improve app fluidity:
    • thumbhash blur-up image placeholders
    • shimmer skeletons for Home, Detail, Browse, and Libraries loading states
    • phone shared-element poster-to-detail hero transition
    • animated list item removals/reorders
    • status-bar-aware top-bar spacing
  • Improve Android TV navigation and focus:
    • consolidated TvShellFocusState
    • tested shell back/focus routing
    • smoother skyline/library focus scrolling
    • refined top-menu cascade behavior and tab commit handling
    • TV login/server setup/profile UI polish
  • Add release prep:
    • R8 minify + resource shrinking for both apps
    • shared ProGuard rules for serialization, Koin, Media3, MPV, BouncyCastle, Room, etc.
    • new baseline profile module
    • profile installer dependency in both apps

Validation

  • :androidTvApp:testDebugUnitTest was revived and now runs the TV suite instead of silently compiling zero tests.
  • TV focus/source guard coverage was added for the shell focus state machine.
  • Playback routing/recovery/unit coverage was added across shared player, backend selector, playback delivery, fallback, and serialization paths.
  • Branch notes record both app release builds passing through R8.
  • Baseline profile module configures and its generation variants assemble.

Known follow-ups / gated checks

  • TV D-pad focus dispatch still needs owner/device verification before merge.
  • Minified release install needs runtime smoke testing: boot, Media3 playback, MPV playback, and LAN TLS-PSK pairing.
  • :baselineprofile:generateBaselineProfile needs a device/emulator run.
  • Full :androidApp:testDebugUnitTest still has pre-existing unrelated failures noted in the branch docs.
  • Phone shared-element animation needs visual confirmation on a real phone image/device.

Summary by CodeRabbit

  • New Features
    • Plan-aware playback with improved remux/transcode fallbacks and safer engine switching.
    • Shared-element hero transitions (mobile), shimmer-based loading skeletons, ThumbHash blurred placeholders, and buffered-ahead seek/progress UI.
    • Improved pairing/status flow and enhanced TV server setup experience.
  • Bug Fixes
    • Improved Dolby Vision launch safety by blocking DV Profile 7 and strengthening playback recovery.
  • UI Updates
    • Removed inbox/notifications entry points and theme appearance controls.
    • Updated top navigation/shell behavior and adjusted loading/placeholder visuals across screens.
  • Chores
    • Added baseline profile generation; refined release/R8 + ProGuard; improved HTTP connection pooling.

Quick104 and others added 26 commits June 22, 2026 13:49
…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]>
@coderabbitai

coderabbitai Bot commented Jun 23, 2026 •

Copy link
Copy Markdown

Review Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 939c11fd-719b-4cc8-a9af-fc632afc8b92

📥 Commits

Reviewing files that changed from the base of the PR and between 060dd1d and 293d5f9.

📒 Files selected for processing (1)
  • androidApp/src/androidMain/kotlin/com/continuum/app/android/ui/screens/player/PlayerViewModel.kt

📝 Walkthrough

Walkthrough

This 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.

Changes

Plan-aware playback and routing

Layer / File(s) Summary
Contracts, APIs, and session wiring
shared/src/commonMain/kotlin/com/continuum/app/model/playback/PlaybackModels.kt, shared/src/commonMain/kotlin/com/continuum/app/network/api/PlaybackApi.kt, shared/src/commonMain/kotlin/com/continuum/app/repository/PlaybackRepository.kt, android-shared/src/androidMain/kotlin/com/continuum/app/common/player/video/VideoPlaybackStartRequest.kt, android-shared/src/androidMain/kotlin/com/continuum/app/common/player/video/VideoPlaybackStartResult.kt, android-shared/src/androidMain/kotlin/com/continuum/app/common/player/video/VideoPlayerUiState.kt, android-shared/src/androidMain/kotlin/com/continuum/app/common/player/video/VideoPlaybackSessionCoordinator.kt, android-shared/src/androidMain/kotlin/com/continuum/app/common/player/PlaybackSessionLifecycle.kt, android-shared/src/androidMain/kotlin/com/continuum/app/common/player/PlaybackSessionManager.kt, shared/src/commonTest/kotlin/com/continuum/app/model/playback/PlaybackModelsV2SerializationTest.kt, android-shared/src/androidUnitTest/kotlin/com/continuum/app/common/player/**
Playback requests, responses, plan models, route events, and session APIs now carry plan, delivery, subtitle, and client-context fields, with serialization and session tests updated accordingly.
Capability detection and route selection
android-shared/src/androidMain/kotlin/com/continuum/app/common/player/video/*, android-shared/src/androidMain/kotlin/com/continuum/app/common/player/PlaybackCapabilityDetector.kt, android-shared/src/androidMain/kotlin/com/continuum/app/common/player/backend/*, android-shared/src/androidUnitTest/kotlin/com/continuum/app/common/player/**
Direct-play policy, delivery resolution, backend selection, and playback capability detection now use plan-aware engine, container, HDR, and subtitle checks with matching tests.
Recovery planning and engine fallback
android-shared/src/androidMain/kotlin/com/continuum/app/common/player/PlaybackRecoveryPlanner.kt, android-shared/src/androidMain/kotlin/com/continuum/app/common/player/video/ImmediateServerFallbackPolicy.kt, android-shared/src/androidUnitTest/kotlin/com/continuum/app/common/player/PlaybackRecoveryPlannerTest.kt
Recovery actions now track attempted engines and delivery modes, and immediate fallback classification is based on plan blockers and server remux delivery.
Shared player engines and media spec wiring
android-shared/src/androidMain/kotlin/com/continuum/app/common/player/ContinuumPlayerFactory.kt, android-shared/src/androidMain/kotlin/com/continuum/app/common/player/VideoPlayerMediaSpec.kt, android-shared/src/androidMain/kotlin/com/continuum/app/common/player/VideoPlayerMediaMounter.kt, android-shared/src/androidMain/kotlin/com/continuum/app/common/player/mpv/MpvPlayer.kt, android-shared/src/androidMain/kotlin/com/continuum/app/common/player/backend/MpvVideoPlaybackBackend.kt, android-shared/src/androidUnitTest/kotlin/com/continuum/app/common/player/mpv/*
Media item construction, MPV passthrough/TLS behavior, and backend mount/refresh paths now carry delivery and audio passthrough data into the engine.
Playback flow docs and helper models
docs/media3/*, android-shared/src/androidMain/kotlin/com/continuum/app/common/player/AudioCapabilityManager.kt, android-shared/src/androidMain/kotlin/com/continuum/app/common/player/DisplayHdrProbe.kt, android-shared/src/androidMain/kotlin/com/continuum/app/common/player/MediaCodecCapabilitiesProbe.kt, android-shared/src/androidMain/kotlin/com/continuum/app/common/player/ContinuumPlaybackService.kt
HDR notes, audio probing, display capability checks, and player handoff behavior are adjusted to match the new playback flow.

Pairing transport and TV setup flow

Layer / File(s) Summary
Receiver, transport, and advertiser lifecycle
android-shared/src/androidMain/kotlin/com/continuum/app/common/pairing/PairingReceiver.kt, android-shared/src/androidMain/kotlin/com/continuum/app/common/pairing/TlsPskPairingTransport.kt, android-shared/src/androidMain/kotlin/com/continuum/app/common/pairing/TvPairingAdvertiser.kt, android-shared/src/androidUnitTest/kotlin/com/continuum/app/common/pairing/PairingReceiverTest.kt
Pairing statuses now carry server-specific progress, the TLS transport uses a non-blocking protocol flow, and the advertiser logs lifecycle events while stopping after completion.
TV login and server setup UI
androidTvApp/src/androidMain/kotlin/com/continuum/app/tv/ui/screens/auth/TvLoginScreen.kt, androidTvApp/src/androidMain/kotlin/com/continuum/app/tv/ui/screens/auth/TvServerSetupScreen.kt, androidTvApp/src/androidMain/kotlin/com/continuum/app/tv/ui/navigation/TvAppNavigation.kt, androidTvApp/src/androidMain/kotlin/com/continuum/app/tv/ui/screens/profiles/TvProfileSelectionScreen.kt, androidTvApp/src/androidUnitTest/kotlin/com/continuum/app/tv/ui/screens/auth/*, androidTvApp/src/androidUnitTest/kotlin/com/continuum/app/tv/ui/screens/profiles/*
TV login/setup adds change-server actions, active pairing panels, and completion handling based on the expanded pairing state.

Android mobile UI, navigation, and image placeholders

Layer / File(s) Summary
Image loading and thumbhash placeholders
android-shared/src/androidMain/kotlin/com/continuum/app/common/ui/components/ThumbHash.kt, android-shared/src/androidMain/kotlin/com/continuum/app/common/ui/components/ThumbhashImage.kt, androidApp/src/androidMain/kotlin/com/continuum/app/android/ContinuumApplication.kt, androidTvApp/src/androidMain/kotlin/com/continuum/app/tv/ContinuumTvApplication.kt, androidApp/src/androidMain/kotlin/com/continuum/app/android/ui/components/HeroBackdropLayers.kt
Thumbhash decoding becomes a bitmap placeholder path, and both Android apps now supply a Coil singleton image loader with disk caching.
Theme, routes, top bar, and shared hero transitions
androidApp/src/androidMain/kotlin/com/continuum/app/android/MainActivity.kt, androidApp/src/androidMain/kotlin/com/continuum/app/android/ui/navigation/*, androidApp/src/androidMain/kotlin/com/continuum/app/android/ui/theme/*, androidApp/src/androidMain/kotlin/com/continuum/app/android/ui/components/MainAppTopBar.kt, androidApp/src/androidMain/kotlin/com/continuum/app/android/ui/screens/MainScreen.kt, androidApp/src/androidMain/kotlin/com/continuum/app/android/di/AndroidModule.kt, androidApp/src/androidUnitTest/kotlin/com/continuum/app/android/ui/navigation/*
Theme selection and inbox wiring are removed, navigation now anchors on Home and publishes shared-transition scopes, and the top bar/entry screens align with the new route structure.
Skeleton screens, cards, and screen polish
androidApp/src/androidMain/kotlin/com/continuum/app/android/ui/components/Skeleton.kt, androidApp/src/androidMain/kotlin/com/continuum/app/android/ui/components/MediaCard.kt, androidApp/src/androidMain/kotlin/com/continuum/app/android/ui/components/MediaRow.kt, androidApp/src/androidMain/kotlin/com/continuum/app/android/ui/screens/**
Loading states switch to shimmer skeletons, media cards gain shared-content hooks, and several screen components adopt the new visuals and item animation behavior.
Detail metadata and home data fetching polish
androidApp/src/androidMain/kotlin/com/continuum/app/android/ui/screens/detail/MediaSelectors.kt, shared/src/commonMain/kotlin/com/continuum/app/viewmodel/HomeViewModel.kt, androidApp/src/androidMain/kotlin/com/continuum/app/android/ui/screens/home/FeaturedCarousel.kt
Detail badges and audio summaries are simplified, home section loading reuses inline items where possible, and featured carousel derived values are memoized.

Android TV shell, focus, and catalog interaction

Layer / File(s) Summary
TV splash, shell focus state, and top menu
androidTvApp/src/androidMain/kotlin/com/continuum/app/tv/MainTvActivity.kt, androidTvApp/src/androidMain/kotlin/com/continuum/app/tv/ui/shell/*, androidTvApp/src/androidMain/kotlin/com/continuum/app/tv/ui/screens/home/TvHomeScreen.kt, androidTvApp/src/androidUnitTest/kotlin/com/continuum/app/tv/ui/shell/*
TV shell focus/back handling moves into a dedicated focus state, splash replay is gated per process, and top-menu selection is separated from panel entry while unread badge UI is removed.
TV content navigation and bring-into-view behavior
androidTvApp/src/androidMain/kotlin/com/continuum/app/tv/ui/components/TvSkylineSectionFeed.kt, androidTvApp/src/androidMain/kotlin/com/continuum/app/tv/ui/components/TvCatalogGrid.kt, androidTvApp/src/androidMain/kotlin/com/continuum/app/tv/ui/screens/library/TvLibraryDetailScreen.kt, androidTvApp/src/androidMain/kotlin/com/continuum/app/tv/ui/screens/library/TvLibraryDetailViewModel.kt, androidTvApp/src/androidMain/kotlin/com/continuum/app/tv/ui/screens/detail/TvItemDetailScreen.kt
TV content screens add content-up fallback callbacks, custom bring-into-view behavior for row bands and grids, and lazy browse filter and section item loading.
TV playback UI and player engine flow
androidTvApp/src/androidMain/kotlin/com/continuum/app/tv/ui/screens/player/*, androidTvApp/src/androidUnitTest/kotlin/com/continuum/app/tv/ui/screens/player/*
TV player startup and recovery now use execution plans, subtitle ordinal resolution, route-event reporting, awaited engine switching, and plan-derived HUD metadata.

Build, release, baseline profile, and miscellaneous tooling

Layer / File(s) Summary
Release build and baseline profile tooling
androidApp/build.gradle.kts, androidTvApp/build.gradle.kts, baselineprofile/*, build.gradle.kts, gradle/libs.versions.toml, proguard-rules.pro, settings.gradle.kts
Release minification, profile installer dependencies, a baselineprofile module, shared plugin wiring, and a root ProGuard ruleset are added.
HTTP client, docs, and housekeeping
shared/src/androidMain/kotlin/com/continuum/app/network/ContinuumHttpClient.android.kt, docs/plans/*, docs/media3/*, scripts/build-push-shield.sh, CLAUDE.md, FEATURES.md
The Android HTTP client is tuned, handoff and route-planning docs are updated, the TV package id is propagated to a script, and CLAUDE.md now links to AGENTS.md.

Estimated code review effort

🎯 5 (Critical) | ⏱️ ~120 minutes

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 15.64% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'Uiux fluidity overhaul' directly reflects the main changes—UI/UX improvements with playback routing enhancements.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch uiux-fluidity-overhaul

Comment @coderabbitai help to get the list of available commands.

@coderabbitai

coderabbitai Bot commented Jun 23, 2026

Copy link
Copy Markdown

Caution

Failed to replace (edit) comment. This is likely due to insufficient permissions or the comment being deleted.

Error details
{"name":"HttpError","status":500,"request":{"method":"PATCH","url":"https://api.github.com/repos/Silo-Server/silo-android/issues/comments/4779945272","headers":{"accept":"application/vnd.github.v3+json","user-agent":"octokit.js/0.0.0-development octokit-core.js/7.0.6 Node.js/24","authorization":"token [REDACTED]","content-type":"application/json; charset=utf-8"},"body":{"body":"<!-- This is an auto-generated comment: summarize by coderabbit.ai -->\n<!-- review_stack_entry_start -->\n\n[![Review Change Stack](https://storage.googleapis.com/coderabbit_public_assets/review-stack-in-coderabbit-ui.svg)](https://app.coderabbit.ai/change-stack/Silo-Server/silo-android/pull/4?utm_source=github_walkthrough&utm_medium=github&utm_campaign=change_stack)\n\n<!-- review_stack_entry_end -->\n<!-- This is an auto-generated comment: review in progress by coderabbit.ai -->\n\n> [!NOTE]\n> Currently processing new changes in this PR. This may take a few minutes, please wait...\n> \n> <details>\n> <summary>⚙️ Run configuration</summary>\n> \n> **Configuration used**: Organization UI\n> \n> **Review profile**: CHILL\n> \n> **Plan**: Pro Plus\n> \n> **Run ID**: `3765d55e-21de-4372-9d0f-2d91e1981ae4`\n> \n> </details>\n> \n> <details>\n> <summary>📥 Commits</summary>\n> \n> Reviewing files that changed from the base of the PR and between 071e1c04330c72609b6cc7674ca35889898d094e and 8e64e10d9a820edcf0c35babf7acdb9d0c491560.\n> \n> </details>\n> \n> <details>\n> <summary>📒 Files selected for processing (133)</summary>\n> \n> * `CLAUDE.md`\n> * `FEATURES.md`\n> * `android-shared/src/androidMain/kotlin/com/continuum/app/common/pairing/PairingReceiver.kt`\n> * `android-shared/src/androidMain/kotlin/com/continuum/app/common/pairing/TlsPskPairingTransport.kt`\n> * `android-shared/src/androidMain/kotlin/com/continuum/app/common/pairing/TvPairingAdvertiser.kt`\n> * `android-shared/src/androidMain/kotlin/com/continuum/app/common/player/AudioCapabilityManager.kt`\n> * `android-shared/src/androidMain/kotlin/com/continuum/app/common/player/ContinuumPlaybackService.kt`\n> * `android-shared/src/androidMain/kotlin/com/continuum/app/common/player/ContinuumPlayerFactory.kt`\n> * `android-shared/src/androidMain/kotlin/com/continuum/app/common/player/DisplayHdrProbe.kt`\n> * `android-shared/src/androidMain/kotlin/com/continuum/app/common/player/PlaybackCapabilityDetector.kt`\n> * `android-shared/src/androidMain/kotlin/com/continuum/app/common/player/PlaybackRecoveryPlanner.kt`\n> * `android-shared/src/androidMain/kotlin/com/continuum/app/common/player/PlaybackSessionLifecycle.kt`\n> * `android-shared/src/androidMain/kotlin/com/continuum/app/common/player/PlaybackSessionManager.kt`\n> * `android-shared/src/androidMain/kotlin/com/continuum/app/common/player/VideoPlayerMediaMounter.kt`\n> * `android-shared/src/androidMain/kotlin/com/continuum/app/common/player/VideoPlayerMediaSpec.kt`\n> * `android-shared/src/androidMain/kotlin/com/continuum/app/common/player/backend/MpvVideoPlaybackBackend.kt`\n> * `android-shared/src/androidMain/kotlin/com/continuum/app/common/player/backend/PlaybackEngineDecision.kt`\n> * `android-shared/src/androidMain/kotlin/com/continuum/app/common/player/backend/VideoPlaybackBackendRequest.kt`\n> * `android-shared/src/androidMain/kotlin/com/continuum/app/common/player/backend/VideoPlaybackBackendSelector.kt`\n> * `android-shared/src/androidMain/kotlin/com/continuum/app/common/player/mpv/MpvPlayer.kt`\n> * `android-shared/src/androidMain/kotlin/com/continuum/app/common/player/video/OriginalPlaybackRequestPolicy.kt`\n> * `android-shared/src/androidMain/kotlin/com/continuum/app/common/player/video/PlaybackContainerPolicy.kt`\n> * `android-shared/src/androidMain/kotlin/com/continuum/app/common/player/video/PlaybackDeliveryResolver.kt`\n> * `android-shared/src/androidMain/kotlin/com/continuum/app/common/player/video/VideoPlaybackSessionCoordinator.kt`\n> * `android-shared/src/androidMain/kotlin/com/continuum/app/common/player/video/VideoPlaybackStartRequest.kt`\n> * `android-shared/src/androidMain/kotlin/com/continuum/app/common/player/video/VideoPlaybackStartResult.kt`\n> * `android-shared/src/androidMain/kotlin/com/continuum/app/common/player/video/VideoPlayerUiState.kt`\n> * `android-shared/src/androidMain/kotlin/com/continuum/app/common/ui/components/ThumbHash.kt`\n> * `android-shared/src/androidMain/kotlin/com/continuum/app/common/ui/components/ThumbhashImage.kt`\n> * `android-shared/src/androidUnitTest/kotlin/com/continuum/app/common/pairing/PairingReceiverTest.kt`\n> * `android-shared/src/androidUnitTest/kotlin/com/continuum/app/common/player/ContinuumPlaybackServiceEngineSourceTest.kt`\n> * `android-shared/src/androidUnitTest/kotlin/com/continuum/app/common/player/PlaybackCapabilityDetectorSourceTest.kt`\n> * `android-shared/src/androidUnitTest/kotlin/com/continuum/app/common/player/PlaybackRecoveryPlannerTest.kt`\n> * `android-shared/src/androidUnitTest/kotlin/com/continuum/app/common/player/PlaybackSessionManagerTranscodeFallbackTest.kt`\n> * `android-shared/src/androidUnitTest/kotlin/com/continuum/app/common/player/VideoPlayerMediaSpecTest.kt`\n> * `android-shared/src/androidUnitTest/kotlin/com/continuum/app/common/player/backend/PlaybackEngineCommandTest.kt`\n> * `android-shared/src/androidUnitTest/kotlin/com/continuum/app/common/player/backend/PlaybackEngineDecisionTest.kt`\n> * `android-shared/src/androidUnitTest/kotlin/com/continuum/app/common/player/backend/VideoPlaybackBackendSelectorTest.kt`\n> * `android-shared/src/androidUnitTest/kotlin/com/continuum/app/common/player/mpv/MpvPlayerSourceTest.kt`\n> * `android-shared/src/androidUnitTest/kotlin/com/continuum/app/common/player/video/OriginalPlaybackRequestPolicyTest.kt`\n> * `android-shared/src/androidUnitTest/kotlin/com/continuum/app/common/player/video/PlaybackContainerPolicyTest.kt`\n> * `android-shared/src/androidUnitTest/kotlin/com/continuum/app/common/player/video/PlaybackDeliveryResolverTest.kt`\n> * `android-shared/src/androidUnitTest/kotlin/com/continuum/app/common/player/video/VideoPlaybackSessionCoordinatorTest.kt`\n> * `androidApp/build.gradle.kts`\n> * `androidApp/src/androidMain/kotlin/com/continuum/app/android/ContinuumApplication.kt`\n> * `androidApp/src/androidMain/kotlin/com/continuum/app/android/MainActivity.kt`\n> * `androidApp/src/androidMain/kotlin/com/continuum/app/android/di/AndroidModule.kt`\n> * `androidApp/src/androidMain/kotlin/com/continuum/app/android/ui/components/FavoriteButton.kt`\n> * `androidApp/src/androidMain/kotlin/com/continuum/app/android/ui/components/HeroBackdropLayers.kt`\n> * `androidApp/src/androidMain/kotlin/com/continuum/app/android/ui/components/MainAppTopBar.kt`\n> * `androidApp/src/androidMain/kotlin/com/continuum/app/android/ui/components/MediaCard.kt`\n> * `androidApp/src/androidMain/kotlin/com/continuum/app/android/ui/components/MediaRow.kt`\n> * `androidApp/src/androidMain/kotlin/com/continuum/app/android/ui/components/Skeleton.kt`\n> * `androidApp/src/androidMain/kotlin/com/continuum/app/android/ui/components/WatchlistButton.kt`\n> * `androidApp/src/androidMain/kotlin/com/continuum/app/android/ui/navigation/AppNavigation.kt`\n> * `androidApp/src/androidMain/kotlin/com/continuum/app/android/ui/navigation/Routes.kt`\n> * `androidApp/src/androidMain/kotlin/com/continuum/app/android/ui/navigation/SharedElementTransition.kt`\n> * `androidApp/src/androidMain/kotlin/com/continuum/app/android/ui/screens/MainScreen.kt`\n> * `androidApp/src/androidMain/kotlin/com/continuum/app/android/ui/screens/browse/BrowseScreen.kt`\n> * `androidApp/src/androidMain/kotlin/com/continuum/app/android/ui/screens/detail/DetailSharedComponents.kt`\n> * `androidApp/src/androidMain/kotlin/com/continuum/app/android/ui/screens/detail/ItemDetailScreen.kt`\n> * `androidApp/src/androidMain/kotlin/com/continuum/app/android/ui/screens/detail/MediaSelectors.kt`\n> * `androidApp/src/androidMain/kotlin/com/continuum/app/android/ui/screens/detail/SimilarRail.kt`\n> * `androidApp/src/androidMain/kotlin/com/continuum/app/android/ui/screens/home/FeaturedCarousel.kt`\n> * `androidApp/src/androidMain/kotlin/com/continuum/app/android/ui/screens/home/HomeScreen.kt`\n> * `androidApp/src/androidMain/kotlin/com/continuum/app/android/ui/screens/libraries/LibrariesScreen.kt`\n> * `androidApp/src/androidMain/kotlin/com/continuum/app/android/ui/screens/personal/PersonalMediaGridContent.kt`\n> * `androidApp/src/androidMain/kotlin/com/continuum/app/android/ui/screens/player/MobileVideoPlaybackStarter.kt`\n> * `androidApp/src/androidMain/kotlin/com/continuum/app/android/ui/screens/player/PlayerControls.kt`\n> * `androidApp/src/androidMain/kotlin/com/continuum/app/android/ui/screens/player/PlayerOverlay.kt`\n> * `androidApp/src/androidMain/kotlin/com/continuum/app/android/ui/screens/player/PlayerProgressBar.kt`\n> * `androidApp/src/androidMain/kotlin/com/continuum/app/android/ui/screens/player/PlayerScreen.kt`\n> * `androidApp/src/androidMain/kotlin/com/continuum/app/android/ui/screens/player/PlayerViewModel.kt`\n> * `androidApp/src/androidMain/kotlin/com/continuum/app/android/ui/screens/settings/AppearanceSettings.kt`\n> * `androidApp/src/androidMain/kotlin/com/continuum/app/android/ui/screens/settings/SettingsScreen.kt`\n> * `androidApp/src/androidMain/kotlin/com/continuum/app/android/ui/screens/settings/SettingsViewModel.kt`\n> * `androidApp/src/androidMain/kotlin/com/continuum/app/android/ui/theme/Theme.kt`\n> * `androidApp/src/androidMain/kotlin/com/continuum/app/android/ui/theme/ThemeManager.kt`\n> * `androidApp/src/androidUnitTest/kotlin/com/continuum/app/android/ui/navigation/MobileSharedElementSourceTest.kt`\n> * `androidApp/src/androidUnitTest/kotlin/com/continuum/app/android/ui/screens/player/PlayerScreenStartPositionTest.kt`\n> * `androidApp/src/androidUnitTest/kotlin/com/continuum/app/android/ui/screens/player/PlayerViewModelSharedCoordinatorTest.kt`\n> * `androidTvApp/build.gradle.kts`\n> * `androidTvApp/src/androidMain/kotlin/com/continuum/app/tv/ContinuumTvApplication.kt`\n> * `androidTvApp/src/androidMain/kotlin/com/continuum/app/tv/MainTvActivity.kt`\n> * `androidTvApp/src/androidMain/kotlin/com/continuum/app/tv/ui/components/TvAnimatedMeshBackground.kt`\n> * `androidTvApp/src/androidMain/kotlin/com/continuum/app/tv/ui/components/TvAuroraBackdrop.kt`\n> * `androidTvApp/src/androidMain/kotlin/com/continuum/app/tv/ui/components/TvCascadeSelector.kt`\n> * `androidTvApp/src/androidMain/kotlin/com/continuum/app/tv/ui/components/TvCatalogGrid.kt`\n> * `androidTvApp/src/androidMain/kotlin/com/continuum/app/tv/ui/components/TvFocusMarqueeModel.kt`\n> * `androidTvApp/src/androidMain/kotlin/com/continuum/app/tv/ui/components/TvSkylineSectionFeed.kt`\n> * `androidTvApp/src/androidMain/kotlin/com/continuum/app/tv/ui/navigation/TvAppNavigation.kt`\n> * `androidTvApp/src/androidMain/kotlin/com/continuum/app/tv/ui/navigation/TvRoute.kt`\n> * `androidTvApp/src/androidMain/kotlin/com/continuum/app/tv/ui/screens/auth/TvLoginScreen.kt`\n> * `androidTvApp/src/androidMain/kotlin/com/continuum/app/tv/ui/screens/auth/TvServerSetupScreen.kt`\n> * `androidTvApp/src/androidMain/kotlin/com/continuum/app/tv/ui/screens/detail/TvItemDetailScreen.kt`\n> * `androidTvApp/src/androidMain/kotlin/com/continuum/app/tv/ui/screens/home/TvHomeScreen.kt`\n> * `androidTvApp/src/androidMain/kotlin/com/continuum/app/tv/ui/screens/library/TvLibraryDetailScreen.kt`\n> * `androidTvApp/src/androidMain/kotlin/com/continuum/app/tv/ui/screens/library/TvLibraryDetailViewModel.kt`\n> * `androidTvApp/src/androidMain/kotlin/com/continuum/app/tv/ui/screens/player/TvPlayerHud.kt`\n> * `androidTvApp/src/androidMain/kotlin/com/continuum/app/tv/ui/screens/player/TvPlayerScreen.kt`\n> * `androidTvApp/src/androidMain/kotlin/com/continuum/app/tv/ui/screens/player/TvPlayerViewModel.kt`\n> * `androidTvApp/src/androidMain/kotlin/com/continuum/app/tv/ui/screens/player/TvVideoPlaybackStarter.kt`\n> * `androidTvApp/src/androidMain/kotlin/com/continuum/app/tv/ui/screens/profiles/TvProfileSelectionScreen.kt`\n> * `androidTvApp/src/androidMain/kotlin/com/continuum/app/tv/ui/shell/TvMainShell.kt`\n> * `androidTvApp/src/androidMain/kotlin/com/continuum/app/tv/ui/shell/TvShellFocusState.kt`\n> * `androidTvApp/src/androidMain/kotlin/com/continuum/app/tv/ui/shell/TvTopMenuBar.kt`\n> * `androidTvApp/src/androidMain/kotlin/com/continuum/app/tv/ui/theme/Layout.kt`\n> * `androidTvApp/src/androidUnitTest/kotlin/com/continuum/app/tv/ui/components/TvSkylineSectionFeedSourceTest.kt`\n> * `androidTvApp/src/androidUnitTest/kotlin/com/continuum/app/tv/ui/screens/player/PlayerTrackEntriesTest.kt`\n> * `androidTvApp/src/androidUnitTest/kotlin/com/continuum/app/tv/ui/screens/player/TvPlayerEngineRequestHelpersTest.kt`\n> * `androidTvApp/src/androidUnitTest/kotlin/com/continuum/app/tv/ui/screens/player/TvPlayerScreenStartPositionTest.kt`\n> * `androidTvApp/src/androidUnitTest/kotlin/com/continuum/app/tv/ui/screens/player/TvPlayerViewModelSharedCoordinatorTest.kt`\n> * `androidTvApp/src/androidUnitTest/kotlin/com/continuum/app/tv/ui/screens/profiles/TvProfileSelectionScreenSourceTest.kt`\n> * `androidTvApp/src/androidUnitTest/kotlin/com/continuum/app/tv/ui/screens/watchtogether/TvWatchTogetherHostTargetTest.kt`\n> * `androidTvApp/src/androidUnitTest/kotlin/com/continuum/app/tv/ui/shell/TvCascadeInteractionSourceTest.kt`\n> * `androidTvApp/src/androidUnitTest/kotlin/com/continuum/app/tv/ui/shell/TvShellFocusSourceTest.kt`\n> * `androidTvApp/src/androidUnitTest/kotlin/com/continuum/app/tv/ui/shell/TvShellFocusStateTest.kt`\n> * `baselineprofile/build.gradle.kts`\n> * `baselineprofile/src/main/kotlin/com/continuum/app/baselineprofile/BaselineProfileGenerator.kt`\n> * `build.gradle.kts`\n> * `docs/media3/09-direct-play-route-planning-spec.md`\n> * `docs/media3/README.md`\n> * `docs/plans/uiux-overhaul-remaining-phases.md`\n> * `gradle/libs.versions.toml`\n> * `proguard-rules.pro`\n> * `scripts/build-push-shield.sh`\n> * `settings.gradle.kts`\n> * `shared/src/androidMain/kotlin/com/continuum/app/network/ContinuumHttpClient.android.kt`\n> * `shared/src/commonMain/kotlin/com/continuum/app/model/playback/PlaybackModels.kt`\n> * `shared/src/commonMain/kotlin/com/continuum/app/network/api/PlaybackApi.kt`\n> * `shared/src/commonMain/kotlin/com/continuum/app/repository/PlaybackRepository.kt`\n> * `shared/src/commonMain/kotlin/com/continuum/app/viewmodel/HomeViewModel.kt`\n> * `shared/src/commonTest/kotlin/com/continuum/app/model/playback/PlaybackModelsV2SerializationTest.kt`\n> \n> </details>\n> \n> ```ascii\n>  ____________________________________________________________\n> < To iterate is human, to recurse divine. - L. Peter Deutsch >\n>  ------------------------------------------------------------\n>   \\\n>    \\   (\\__/)\n>        (•ㅅ•)\n>        /   づ\n> ```\n\n<!-- end of auto-generated comment: review in progress by coderabbit.ai -->\n\n<!-- finishing_touch_checkbox_start -->\n\n<details>\n<summary>✨ Finishing Touches</summary>\n\n<details>\n<summary>📝 Generate docstrings</summary>\n\n- [ ] <!-- {\"checkboxId\": \"7962f53c-55bc-4827-bfbf-6a18da830691\"} --> Create stacked PR\n- [ ] <!-- {\"checkboxId\": \"3e1879ae-f29b-4d0d-8e06-d12b7ba33d98\"} --> Commit on current branch\n\n</details>\n<details>\n<summary>🧪 Generate unit tests (beta)</summary>\n\n- [ ] <!-- {\"checkboxId\": \"f47ac10b-58cc-4372-a567-0e02b2c3d479\", \"radioGroupId\": \"utg-output-choice-group-unknown_comment_id\"} -->   Create PR with unit tests\n- [ ] <!-- {\"checkboxId\": \"6ba7b810-9dad-11d1-80b4-00c04fd430c8\", \"radioGroupId\": \"utg-output-choice-group-unknown_comment_id\"} -->   Commit unit tests in branch `uiux-fluidity-overhaul`\n\n</details>\n\n</details>\n\n<!-- finishing_touch_checkbox_end -->\n<!-- tips_start -->\n\n---\n\n\n\n\n<sub>Comment `@coderabbitai help` to get the list of available commands.</sub>\n\n<!-- tips_end -->"},"request":{"retryCount":3,"signal":{},"retries":3,"retryAfter":16}}}

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 win

Reset loadedFilters on 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 win

Add 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 win

Avoid 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. Returning null is 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 | 🟡 Minor

Add route-reset safeguard for contentUpFallback to 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 reset contentUpFallback to null. While no producer screens currently invoke this callback, the infrastructure is architecturally vulnerable: if any producer later calls onContentUpFallbackChanged(callback), that callback will persist across route transitions, causing stale Up-key routing on routes that don't set a fallback. Add LaunchedEffect(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 win

Align badge documentation with the new emitted labels.

The logic now normalizes Dolby Vision-like HDR to HDR and Atmos-only audio to AUDIO, but nearby docs/examples still describe DOLBY 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 win

Make the source slice fail closed when bindNewPlayer is not found.

substringAfter falls 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 win

Keep the stats-based HDR fallback when no plan badge exists.

playbackPlan is nullable/defaulted, so legacy/local or not-yet-hydrated plan paths now drop the HDR badge even if stats.hdrMode is 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 lift

Type quality_preference in the wire model instead of using raw String.

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 win

Add assertions for forwarded audio_track_index and subtitle_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 win

Deduplicate StartPlaybackRequest construction across startPlayback and decidePlayback.

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 win

Require onSelectTab explicitly 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 win

Add an assertion for playbackPlan mapping in the ready-state test.

This test now validates delivery, but playbackPlan was added to the same mapping path and is still unasserted. Please include a non-null fixture value and assert it on ready.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

📥 Commits

Reviewing files that changed from the base of the PR and between 071e1c0 and 8e64e10.

📒 Files selected for processing (133)
  • CLAUDE.md
  • FEATURES.md
  • android-shared/src/androidMain/kotlin/com/continuum/app/common/pairing/PairingReceiver.kt
  • android-shared/src/androidMain/kotlin/com/continuum/app/common/pairing/TlsPskPairingTransport.kt
  • android-shared/src/androidMain/kotlin/com/continuum/app/common/pairing/TvPairingAdvertiser.kt
  • android-shared/src/androidMain/kotlin/com/continuum/app/common/player/AudioCapabilityManager.kt
  • android-shared/src/androidMain/kotlin/com/continuum/app/common/player/ContinuumPlaybackService.kt
  • android-shared/src/androidMain/kotlin/com/continuum/app/common/player/ContinuumPlayerFactory.kt
  • android-shared/src/androidMain/kotlin/com/continuum/app/common/player/DisplayHdrProbe.kt
  • android-shared/src/androidMain/kotlin/com/continuum/app/common/player/PlaybackCapabilityDetector.kt
  • android-shared/src/androidMain/kotlin/com/continuum/app/common/player/PlaybackRecoveryPlanner.kt
  • android-shared/src/androidMain/kotlin/com/continuum/app/common/player/PlaybackSessionLifecycle.kt
  • android-shared/src/androidMain/kotlin/com/continuum/app/common/player/PlaybackSessionManager.kt
  • android-shared/src/androidMain/kotlin/com/continuum/app/common/player/VideoPlayerMediaMounter.kt
  • android-shared/src/androidMain/kotlin/com/continuum/app/common/player/VideoPlayerMediaSpec.kt
  • android-shared/src/androidMain/kotlin/com/continuum/app/common/player/backend/MpvVideoPlaybackBackend.kt
  • android-shared/src/androidMain/kotlin/com/continuum/app/common/player/backend/PlaybackEngineDecision.kt
  • android-shared/src/androidMain/kotlin/com/continuum/app/common/player/backend/VideoPlaybackBackendRequest.kt
  • android-shared/src/androidMain/kotlin/com/continuum/app/common/player/backend/VideoPlaybackBackendSelector.kt
  • android-shared/src/androidMain/kotlin/com/continuum/app/common/player/mpv/MpvPlayer.kt
  • android-shared/src/androidMain/kotlin/com/continuum/app/common/player/video/OriginalPlaybackRequestPolicy.kt
  • android-shared/src/androidMain/kotlin/com/continuum/app/common/player/video/PlaybackContainerPolicy.kt
  • android-shared/src/androidMain/kotlin/com/continuum/app/common/player/video/PlaybackDeliveryResolver.kt
  • android-shared/src/androidMain/kotlin/com/continuum/app/common/player/video/VideoPlaybackSessionCoordinator.kt
  • android-shared/src/androidMain/kotlin/com/continuum/app/common/player/video/VideoPlaybackStartRequest.kt
  • android-shared/src/androidMain/kotlin/com/continuum/app/common/player/video/VideoPlaybackStartResult.kt
  • android-shared/src/androidMain/kotlin/com/continuum/app/common/player/video/VideoPlayerUiState.kt
  • android-shared/src/androidMain/kotlin/com/continuum/app/common/ui/components/ThumbHash.kt
  • android-shared/src/androidMain/kotlin/com/continuum/app/common/ui/components/ThumbhashImage.kt
  • android-shared/src/androidUnitTest/kotlin/com/continuum/app/common/pairing/PairingReceiverTest.kt
  • android-shared/src/androidUnitTest/kotlin/com/continuum/app/common/player/ContinuumPlaybackServiceEngineSourceTest.kt
  • android-shared/src/androidUnitTest/kotlin/com/continuum/app/common/player/PlaybackCapabilityDetectorSourceTest.kt
  • android-shared/src/androidUnitTest/kotlin/com/continuum/app/common/player/PlaybackRecoveryPlannerTest.kt
  • android-shared/src/androidUnitTest/kotlin/com/continuum/app/common/player/PlaybackSessionManagerTranscodeFallbackTest.kt
  • android-shared/src/androidUnitTest/kotlin/com/continuum/app/common/player/VideoPlayerMediaSpecTest.kt
  • android-shared/src/androidUnitTest/kotlin/com/continuum/app/common/player/backend/PlaybackEngineCommandTest.kt
  • android-shared/src/androidUnitTest/kotlin/com/continuum/app/common/player/backend/PlaybackEngineDecisionTest.kt
  • android-shared/src/androidUnitTest/kotlin/com/continuum/app/common/player/backend/VideoPlaybackBackendSelectorTest.kt
  • android-shared/src/androidUnitTest/kotlin/com/continuum/app/common/player/mpv/MpvPlayerSourceTest.kt
  • android-shared/src/androidUnitTest/kotlin/com/continuum/app/common/player/video/OriginalPlaybackRequestPolicyTest.kt
  • android-shared/src/androidUnitTest/kotlin/com/continuum/app/common/player/video/PlaybackContainerPolicyTest.kt
  • android-shared/src/androidUnitTest/kotlin/com/continuum/app/common/player/video/PlaybackDeliveryResolverTest.kt
  • android-shared/src/androidUnitTest/kotlin/com/continuum/app/common/player/video/VideoPlaybackSessionCoordinatorTest.kt
  • androidApp/build.gradle.kts
  • androidApp/src/androidMain/kotlin/com/continuum/app/android/ContinuumApplication.kt
  • androidApp/src/androidMain/kotlin/com/continuum/app/android/MainActivity.kt
  • androidApp/src/androidMain/kotlin/com/continuum/app/android/di/AndroidModule.kt
  • androidApp/src/androidMain/kotlin/com/continuum/app/android/ui/components/FavoriteButton.kt
  • androidApp/src/androidMain/kotlin/com/continuum/app/android/ui/components/HeroBackdropLayers.kt
  • androidApp/src/androidMain/kotlin/com/continuum/app/android/ui/components/MainAppTopBar.kt
  • androidApp/src/androidMain/kotlin/com/continuum/app/android/ui/components/MediaCard.kt
  • androidApp/src/androidMain/kotlin/com/continuum/app/android/ui/components/MediaRow.kt
  • androidApp/src/androidMain/kotlin/com/continuum/app/android/ui/components/Skeleton.kt
  • androidApp/src/androidMain/kotlin/com/continuum/app/android/ui/components/WatchlistButton.kt
  • androidApp/src/androidMain/kotlin/com/continuum/app/android/ui/navigation/AppNavigation.kt
  • androidApp/src/androidMain/kotlin/com/continuum/app/android/ui/navigation/Routes.kt
  • androidApp/src/androidMain/kotlin/com/continuum/app/android/ui/navigation/SharedElementTransition.kt
  • androidApp/src/androidMain/kotlin/com/continuum/app/android/ui/screens/MainScreen.kt
  • androidApp/src/androidMain/kotlin/com/continuum/app/android/ui/screens/browse/BrowseScreen.kt
  • androidApp/src/androidMain/kotlin/com/continuum/app/android/ui/screens/detail/DetailSharedComponents.kt
  • androidApp/src/androidMain/kotlin/com/continuum/app/android/ui/screens/detail/ItemDetailScreen.kt
  • androidApp/src/androidMain/kotlin/com/continuum/app/android/ui/screens/detail/MediaSelectors.kt
  • androidApp/src/androidMain/kotlin/com/continuum/app/android/ui/screens/detail/SimilarRail.kt
  • androidApp/src/androidMain/kotlin/com/continuum/app/android/ui/screens/home/FeaturedCarousel.kt
  • androidApp/src/androidMain/kotlin/com/continuum/app/android/ui/screens/home/HomeScreen.kt
  • androidApp/src/androidMain/kotlin/com/continuum/app/android/ui/screens/libraries/LibrariesScreen.kt
  • androidApp/src/androidMain/kotlin/com/continuum/app/android/ui/screens/personal/PersonalMediaGridContent.kt
  • androidApp/src/androidMain/kotlin/com/continuum/app/android/ui/screens/player/MobileVideoPlaybackStarter.kt
  • androidApp/src/androidMain/kotlin/com/continuum/app/android/ui/screens/player/PlayerControls.kt
  • androidApp/src/androidMain/kotlin/com/continuum/app/android/ui/screens/player/PlayerOverlay.kt
  • androidApp/src/androidMain/kotlin/com/continuum/app/android/ui/screens/player/PlayerProgressBar.kt
  • androidApp/src/androidMain/kotlin/com/continuum/app/android/ui/screens/player/PlayerScreen.kt
  • androidApp/src/androidMain/kotlin/com/continuum/app/android/ui/screens/player/PlayerViewModel.kt
  • androidApp/src/androidMain/kotlin/com/continuum/app/android/ui/screens/settings/AppearanceSettings.kt
  • androidApp/src/androidMain/kotlin/com/continuum/app/android/ui/screens/settings/SettingsScreen.kt
  • androidApp/src/androidMain/kotlin/com/continuum/app/android/ui/screens/settings/SettingsViewModel.kt
  • androidApp/src/androidMain/kotlin/com/continuum/app/android/ui/theme/Theme.kt
  • androidApp/src/androidMain/kotlin/com/continuum/app/android/ui/theme/ThemeManager.kt
  • androidApp/src/androidUnitTest/kotlin/com/continuum/app/android/ui/navigation/MobileSharedElementSourceTest.kt
  • androidApp/src/androidUnitTest/kotlin/com/continuum/app/android/ui/screens/player/PlayerScreenStartPositionTest.kt
  • androidApp/src/androidUnitTest/kotlin/com/continuum/app/android/ui/screens/player/PlayerViewModelSharedCoordinatorTest.kt
  • androidTvApp/build.gradle.kts
  • androidTvApp/src/androidMain/kotlin/com/continuum/app/tv/ContinuumTvApplication.kt
  • androidTvApp/src/androidMain/kotlin/com/continuum/app/tv/MainTvActivity.kt
  • androidTvApp/src/androidMain/kotlin/com/continuum/app/tv/ui/components/TvAnimatedMeshBackground.kt
  • androidTvApp/src/androidMain/kotlin/com/continuum/app/tv/ui/components/TvAuroraBackdrop.kt
  • androidTvApp/src/androidMain/kotlin/com/continuum/app/tv/ui/components/TvCascadeSelector.kt
  • androidTvApp/src/androidMain/kotlin/com/continuum/app/tv/ui/components/TvCatalogGrid.kt
  • androidTvApp/src/androidMain/kotlin/com/continuum/app/tv/ui/components/TvFocusMarqueeModel.kt
  • androidTvApp/src/androidMain/kotlin/com/continuum/app/tv/ui/components/TvSkylineSectionFeed.kt
  • androidTvApp/src/androidMain/kotlin/com/continuum/app/tv/ui/navigation/TvAppNavigation.kt
  • androidTvApp/src/androidMain/kotlin/com/continuum/app/tv/ui/navigation/TvRoute.kt
  • androidTvApp/src/androidMain/kotlin/com/continuum/app/tv/ui/screens/auth/TvLoginScreen.kt
  • androidTvApp/src/androidMain/kotlin/com/continuum/app/tv/ui/screens/auth/TvServerSetupScreen.kt
  • androidTvApp/src/androidMain/kotlin/com/continuum/app/tv/ui/screens/detail/TvItemDetailScreen.kt
  • androidTvApp/src/androidMain/kotlin/com/continuum/app/tv/ui/screens/home/TvHomeScreen.kt
  • androidTvApp/src/androidMain/kotlin/com/continuum/app/tv/ui/screens/library/TvLibraryDetailScreen.kt
  • androidTvApp/src/androidMain/kotlin/com/continuum/app/tv/ui/screens/library/TvLibraryDetailViewModel.kt
  • androidTvApp/src/androidMain/kotlin/com/continuum/app/tv/ui/screens/player/TvPlayerHud.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
  • androidTvApp/src/androidMain/kotlin/com/continuum/app/tv/ui/screens/player/TvVideoPlaybackStarter.kt
  • androidTvApp/src/androidMain/kotlin/com/continuum/app/tv/ui/screens/profiles/TvProfileSelectionScreen.kt
  • androidTvApp/src/androidMain/kotlin/com/continuum/app/tv/ui/shell/TvMainShell.kt
  • androidTvApp/src/androidMain/kotlin/com/continuum/app/tv/ui/shell/TvShellFocusState.kt
  • androidTvApp/src/androidMain/kotlin/com/continuum/app/tv/ui/shell/TvTopMenuBar.kt
  • androidTvApp/src/androidMain/kotlin/com/continuum/app/tv/ui/theme/Layout.kt
  • androidTvApp/src/androidUnitTest/kotlin/com/continuum/app/tv/ui/components/TvSkylineSectionFeedSourceTest.kt
  • androidTvApp/src/androidUnitTest/kotlin/com/continuum/app/tv/ui/screens/player/PlayerTrackEntriesTest.kt
  • androidTvApp/src/androidUnitTest/kotlin/com/continuum/app/tv/ui/screens/player/TvPlayerEngineRequestHelpersTest.kt
  • androidTvApp/src/androidUnitTest/kotlin/com/continuum/app/tv/ui/screens/player/TvPlayerScreenStartPositionTest.kt
  • androidTvApp/src/androidUnitTest/kotlin/com/continuum/app/tv/ui/screens/player/TvPlayerViewModelSharedCoordinatorTest.kt
  • androidTvApp/src/androidUnitTest/kotlin/com/continuum/app/tv/ui/screens/profiles/TvProfileSelectionScreenSourceTest.kt
  • androidTvApp/src/androidUnitTest/kotlin/com/continuum/app/tv/ui/screens/watchtogether/TvWatchTogetherHostTargetTest.kt
  • androidTvApp/src/androidUnitTest/kotlin/com/continuum/app/tv/ui/shell/TvCascadeInteractionSourceTest.kt
  • androidTvApp/src/androidUnitTest/kotlin/com/continuum/app/tv/ui/shell/TvShellFocusSourceTest.kt
  • androidTvApp/src/androidUnitTest/kotlin/com/continuum/app/tv/ui/shell/TvShellFocusStateTest.kt
  • baselineprofile/build.gradle.kts
  • baselineprofile/src/main/kotlin/com/continuum/app/baselineprofile/BaselineProfileGenerator.kt
  • build.gradle.kts
  • docs/media3/09-direct-play-route-planning-spec.md
  • docs/media3/README.md
  • docs/plans/uiux-overhaul-remaining-phases.md
  • gradle/libs.versions.toml
  • proguard-rules.pro
  • scripts/build-push-shield.sh
  • settings.gradle.kts
  • shared/src/androidMain/kotlin/com/continuum/app/network/ContinuumHttpClient.android.kt
  • shared/src/commonMain/kotlin/com/continuum/app/model/playback/PlaybackModels.kt
  • shared/src/commonMain/kotlin/com/continuum/app/network/api/PlaybackApi.kt
  • shared/src/commonMain/kotlin/com/continuum/app/repository/PlaybackRepository.kt
  • shared/src/commonMain/kotlin/com/continuum/app/viewmodel/HomeViewModel.kt
  • shared/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

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment thread androidTvApp/build.gradle.kts Outdated
compileSdk = 36
defaultConfig {
applicationId = "com.continuum.app.tv"
applicationId = "com.silo.app.tv"

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Restore the TV application ID

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) {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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,

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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]>

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 win

Log 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 null preserves the safe degrade while keeping the failure diagnosable, and resolves the detekt SwallowedException flag 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

📥 Commits

Reviewing files that changed from the base of the PR and between 8e64e10 and aff96c0.

📒 Files selected for processing (18)
  • android-shared/src/androidMain/kotlin/com/continuum/app/common/player/MediaCodecCapabilitiesProbe.kt
  • android-shared/src/androidMain/kotlin/com/continuum/app/common/player/PlaybackCapabilityDetector.kt
  • android-shared/src/androidMain/kotlin/com/continuum/app/common/player/PlaybackRecoveryPlanner.kt
  • android-shared/src/androidMain/kotlin/com/continuum/app/common/player/mpv/MpvPlayer.kt
  • android-shared/src/androidMain/kotlin/com/continuum/app/common/player/video/ImmediateServerFallbackPolicy.kt
  • android-shared/src/androidMain/kotlin/com/continuum/app/common/player/video/VideoPlaybackStartResult.kt
  • android-shared/src/androidMain/kotlin/com/continuum/app/common/ui/components/ThumbhashImage.kt
  • android-shared/src/androidUnitTest/kotlin/com/continuum/app/common/player/PlaybackRecoveryPlannerTest.kt
  • androidApp/src/androidMain/kotlin/com/continuum/app/android/ui/navigation/AppNavigation.kt
  • androidApp/src/androidMain/kotlin/com/continuum/app/android/ui/screens/player/MobileVideoPlaybackStarter.kt
  • androidApp/src/androidMain/kotlin/com/continuum/app/android/ui/screens/player/PlayerViewModel.kt
  • androidTvApp/src/androidMain/kotlin/com/continuum/app/tv/ui/components/TvSkylineSectionFeed.kt
  • androidTvApp/src/androidMain/kotlin/com/continuum/app/tv/ui/screens/player/TvPlayerViewModel.kt
  • androidTvApp/src/androidMain/kotlin/com/continuum/app/tv/ui/screens/player/TvVideoPlaybackStarter.kt
  • shared/src/commonMain/kotlin/com/continuum/app/model/playback/PlaybackModels.kt
  • shared/src/commonMain/kotlin/com/continuum/app/repository/PlaybackRepository.kt
  • shared/src/commonMain/kotlin/com/continuum/app/viewmodel/HomeViewModel.kt
  • shared/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

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

📥 Commits

Reviewing files that changed from the base of the PR and between aff96c0 and 060dd1d.

📒 Files selected for processing (18)
  • android-shared/src/androidMain/kotlin/com/continuum/app/common/pairing/TlsPskPairingTransport.kt
  • android-shared/src/androidMain/kotlin/com/continuum/app/common/pairing/TvPairingAdvertiser.kt
  • android-shared/src/androidMain/kotlin/com/continuum/app/common/player/PlaybackCapabilityDetector.kt
  • android-shared/src/androidMain/kotlin/com/continuum/app/common/player/PlaybackSessionManager.kt
  • android-shared/src/androidMain/kotlin/com/continuum/app/common/player/video/ImmediateServerFallbackPolicy.kt
  • android-shared/src/androidMain/kotlin/com/continuum/app/common/ui/components/ThumbHash.kt
  • androidApp/build.gradle.kts
  • androidApp/src/androidMain/kotlin/com/continuum/app/android/ui/screens/MainScreen.kt
  • androidApp/src/androidMain/kotlin/com/continuum/app/android/ui/screens/player/MobileVideoPlaybackStarter.kt
  • androidApp/src/androidMain/kotlin/com/continuum/app/android/ui/screens/player/PlayerScreen.kt
  • androidApp/src/androidMain/kotlin/com/continuum/app/android/ui/screens/player/PlayerViewModel.kt
  • androidTvApp/build.gradle.kts
  • 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
  • androidTvApp/src/androidMain/kotlin/com/continuum/app/tv/ui/screens/player/TvVideoPlaybackStarter.kt
  • shared/src/commonMain/kotlin/com/continuum/app/model/playback/PlaybackModels.kt
  • shared/src/commonMain/kotlin/com/continuum/app/viewmodel/HomeViewModel.kt
  • shared/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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant