Skip to content

fix: phone QA sweep — home, detail, player, and page-level parity fixes (2026-07-09) - #49

Closed
RXWatcher wants to merge 29 commits into
Silo-Server:mainfrom
RXWatcher:fix/phone-qa-sweep-2
Closed

RXWatcher wants to merge 29 commits into
Silo-Server:mainfrom
RXWatcher:fix/phone-qa-sweep-2

Conversation

@RXWatcher

@RXWatcher RXWatcher commented Jul 9, 2026 •

Copy link
Copy Markdown
Contributor

Scope

The full 2026-07-09 phone QA pass: ~37 items across onboarding, Home, item detail, the player, People, Library browse, For You, Calendar, and downloads. 16 commits, one concern each. Product decisions baked in: See All removed from Home (iOS parity; Libraries/Reading hub keep theirs), Continue Watching's play glyph direct-resumes, hide-spoilers removed pending a cross-platform design, Media Info hidden from end clients, player HUD = chapters + tracks + quality with a slimmer gear.

Root causes worth review attention

  • Home poster flicker / header logo vanishing: the same item visible in two rows registered duplicate shared-element keys, and the transition machinery morphed between the two live cards inside the overlay (above all chrome). A per-screen HeroClaimRegistry lets one visible card own a hero key; duplicates render plain and still navigate. (SharedElementTransition.kt)
  • Subtitle overrides never persisted: writes fingerprinted the mounted PlayerSubtitleInfo list while restore resolved against the catalog SubtitleTrack list — disjoint index spaces that never matched. Restore now resolves against the mounted list; detail-page picks translate catalog→mounted ordinals into the session. Shared-code fixes with tests.
  • Player sheets dismissing on scroll-up: M3 forwards leftover post-fling velocity into the sheet settle, so a downward fling hitting content-top hurled the sheet to Hidden. A nested-scroll fling guard (PlayerSheetSupport.kt) eats post-fling velocity; real drags still dismiss.
  • HDR black screen on the compatibility engine: the Media3 path has no HDR handling and every failure detector misses the symptom (audio progress defeats the stall detector). HDR files now route to MPV under Auto; a proper tone-mapping story remains open and is documented in the commit.
  • Portrait player top bar: an unconstrained title starved the trailing buttons — the gear vanished exactly when a second file version added the quality button. The title now owns a weighted shrink-first slot.

Also

Landscape auto-lock with a persisted player.orientation_mode (rotation-glyph toggle, not a padlock), double-tap ±10s zones with visual feedback (iOS 35% fractions), safe-inset HUD padding (camera cutouts), pinch fit/fill/stretch, gear submenu back navigation, box-style tri-track selectors with "Auto – [resolved]" labels, episode-page season/episode selector, similar-rail gating on empty results, single-line detail headers, downloaded indicator + cancel-download confirmation, People page cleanup + pull-to-refresh, For You inline watchlist/favorites fallback (iOS parity), calendar inset/label fixes, browse date captions + density controls relocated into the filter sheet, and row touch-slop bias so vertical feeds stop snagging on horizontal rows.

Testing

:androidApp:assembleDebug, :androidTvApp:assembleDebug, and the full unit-test suite pass (verified by exit code). New focused tests: engine-selector HDR routing, track-selection fingerprint, subtitle ordinal translation; source-pin tests updated where features were removed. Hands-on device pass in progress — this PR is up for bot review in parallel with it.

AI-use disclosure

Implemented with Claude Code (Claude Fable 5), two delegated subagents for detail/player batches; reviewed, merged, and build-verified locally.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • New Features

    • Added HDR/Dolby Vision–aware playback routing plus more reliable subtitle/audio/version “Auto” selection.
    • Improved media picker UX with Auto options, and enhanced card/home overlay play actions.
    • Added track/subtitle selection mapping for correct restoration across detail → playback.
  • Bug Fixes

    • Fixed subtitle restoration by mapping saved selections to the mounted subtitle list.
    • Prevented duplicate shared-element transitions for home rows.
  • UI/UX Improvements

    • Updated player HUD, gestures (pinch/seek), sheet layout behavior (safer height + fling handling), and better focus on login.
    • Refined details screens (episodes “Now Viewing” highlight, safer download-cancel confirmation, and hiding “More Like This” until loaded).

RXWatcher and others added 25 commits July 9, 2026 07:15
…rect-resume CW

From the 2026-07-09 phone QA pass:

Onboarding:
- Profile selection respects the status bar inset instead of bleeding
  into the phone's camera/menu chrome.
- Login focuses the username field on entry so the keyboard carries
  over from server setup.

Home:
- Poster flicker: the same item in two rows registered duplicate
  shared-element keys, and the transition machinery morphed between the
  two live cards, drawing into the overlay above everything (also
  hiding the header logo). A per-screen HeroClaimRegistry now lets only
  one visible card own a hero key; duplicates render plain and still
  navigate.
- "See All" removed from home rows (iOS has none; the landing screen
  shipped broken): screen, route, DI, and row affordance deleted.
- Continue Watching's center play glyph is now a direct-resume action
  (navigates to the player at position_seconds); poster tap still opens
  the item page. Book items keep the decorative glyph.
- Backdrop cards reserve a constant info-block height so mixed
  episode/movie rows no longer change height mid-scroll and bounce the
  rows below.
- Touch slop is inflated 1.75x inside horizontal rows only, so a
  mostly-vertical drag with sideways wobble no longer locks to the row.

Co-Authored-By: Claude Fable 5 <[email protected]>
- Person page: provider ids (TMDB/IMDb/TVDB/Plex) are internal
  bookkeeping no other client surfaces — removed; homepage stays.
  Added pull-to-refresh.
- For You: when the server has no recommendation sections, the
  Watchlist/Favorites pills become an inline selector (Watchlist by
  default) over the saved-list grid — the iOS savedListsFallback —
  instead of an empty promise that navigates away.

Co-Authored-By: Claude Fable 5 <[email protected]>
End clients don't get the Media Info dump on any other platform; drop
the overflow entry and the phone-only sheet behind it.

Co-Authored-By: Claude Fable 5 <[email protected]>
No other platform shows Tags/Genres as a detail section (genres stay in
the hero facts line), and iOS renders Cast & Crew / Details as plain
single-line headers. Make the eyebrow label optional and ellipsize
headers to one line.

Co-Authored-By: Claude Fable 5 <[email protected]>
Servers without media embeddings return an empty similar list; the
section header now lives inside SimilarRail and only renders once the
request resolves with items, matching the TV client's gating.

Co-Authored-By: Claude Fable 5 <[email protected]>
Calendar:
- Embedded in the tab shell, Scaffold no longer stacks its own
  status-bar inset on top of the shared header runway (the doubled top
  padding in portrait).
- The month label can no longer wrap into a one-character-per-line
  vertical stack when the Today pill squeezes the week strip.

Library browse:
- Sorting by Date Added / Release Date shows that date under each card
  (replaces the year caption).
- Comfortable/Normal/Compact view-density chips moved out of the
  control bar (where they read as sort options) into the filter sheet
  under a "View" heading.
- Genre filtering already exists as a facet in the filter sheet.

Co-Authored-By: Claude Fable 5 <[email protected]>
Product decision: pulled pending a cross-platform design. Drops the
episode-still blur/veil, the header eye toggle, and the source test
that pinned the feature.

Co-Authored-By: Claude Fable 5 <[email protected]>
Entering the phone player now locks to SENSOR_LANDSCAPE by default (iOS
PlayerOrientationCoordinator parity: landscapeLocked is the default on
new clients) and releases the lock on exit via the existing
originalOrientation restore. The HUD lock toggle now persists through
the orientation-mode player setting (raw values landscapeLocked /
rotateFreely, matching iOS) instead of flipping a transient local bool,
so an existing stored preference is respected on the next entry;
rotateFreely falls back to SCREEN_ORIENTATION_USER so the system
rotation preference stays in charge.

Co-Authored-By: Claude Fable 5 <[email protected]>
Replace the version pill + overflow-buried audio/subtitle entries with
a box-style list of all three track groups under the hero actions,
matching the TV/Apple detail treatment. Auto rows in every picker, and
selector values preview what Auto resolves to ("Auto - 1080p · HEVC"),
mirroring TvPlaybackFormatting.

Co-Authored-By: Claude Fable 5 <[email protected]>
Double-tap now uses iOS MobilePlayerGestureLayer's 35% side zones (the
middle band keeps the controls toggle) and shows clear visual feedback:
a 74dp circular badge with the Forward10/Replay10 glyph and a
"+10s"/"−10s" caption, vertically centered in the tapped half, held
700ms then faded out over 200ms — matching the iOS skipFlash timing.
Rapid re-taps restart the hold timer so repeated skips keep the badge
alive.

Co-Authored-By: Claude Fable 5 <[email protected]>
The pinch gesture previously cycled Fit -> Fill -> Stretch -> Fit
regardless of direction, evaluated mid-gesture. It now matches iOS
MobilePlayerGestureLayer: the scale accumulates over the whole gesture
and is evaluated once on release — pinch-out (>1.08) steps toward
fill/stretch, pinch-in (<1/1.08) steps back toward fit, clamped at
both ends with a dead zone in between. Two-finger events are consumed
for the whole pinch so they no longer leak into the seek/brightness
drag detectors. Clamped (no-op) steps skip the toast.

Co-Authored-By: Claude Fable 5 <[email protected]>
Episode pages now load the parent series' seasons and this season's
siblings (iOS episode-detail parity): season chips + the episode list
render as the first below-fold section with the open episode marked
Now Viewing; tapping a sibling opens its detail. Sibling downloads
group under the parent series.

Co-Authored-By: Claude Fable 5 <[email protected]>
All HUD chrome — the transport controls column and the overlay's
transient chips (notice, remote message, Watch Together badge, 2x pill,
sleep-timer chip, intro-skip / Up Next slot) — now applies
WindowInsets.safeDrawing before its edge padding. In portrait this
pushes the top-right cluster (gear included) below the camera cutout
instead of under it, and in landscape it clears cutout ears; the
existing 16dp edge padding rides on top of the insets as the extra
touch margin (iOS safe-area + 16pt parity).

Co-Authored-By: Claude Fable 5 <[email protected]>
Pair the hero download button's filled state with an explicit green
Downloaded row (iOS parity), and require a Discard/Keep confirmation
before a tap cancels an in-progress download.

Co-Authored-By: Claude Fable 5 <[email protected]>
Product decision: the HUD owns chapters + audio/subtitles + quality.
Adds a HighQuality HUD button (shown only when the item has multiple
file versions) that opens the existing QualitySelector sheet, and
removes the Quality row and the Navigation/Chapters row (and their
plumbing) from the gear settings sheet.

Co-Authored-By: Claude Fable 5 <[email protected]>
The detail perf source test asserted content types for the Tags/Genres
section and the similar-rail skeleton, both intentionally removed in
this QA sweep.

Co-Authored-By: Claude Fable 5 <[email protected]>
Track selectors in box style with Auto labels, Media Info hidden,
single-line headers, Tags/Genres sections dropped, similar rail gated
on results, episode-page season/episode selector, hide-spoilers
removed, downloaded indicator + cancel confirmation.

Co-Authored-By: Claude Fable 5 <[email protected]>
… back

Three related bottom-sheet QA issues, fixed via a shared
PlayerSheetSupport:

- Handle too close to the top edge: the player runs immersive, so tall
  sheets grew flush with the display edge and dragging the handle down
  opened the system notification shade. Sheet content is now capped at
  80% of the screen height (playerSheetMaxHeight) so the handle always
  sits well below the edge.
- Scrolling up inside sheets often dismissed them: Material 3 forwards
  the fling velocity left over after content scrolling into the sheet's
  settle, so a downward fling that ran into the top of the content
  hurled the sheet to Hidden. PlayerSheetFlingGuard (a nested-scroll
  connection between the content and the sheet) consumes post-fling
  velocity; drags pass through untouched, so the sheet still dismisses
  from the handle or when the content is already at the top. Applied to
  the settings, tracks, chapters, subtitle-style, stats, subtitle-search
  and quality sheets.
- Gear submenus had no way back to the parent menu: Subtitle Style,
  Sleep Timer and Playback Stats now take an optional onBack and render
  a leading back chevron in their headers that reopens the settings
  sheet.

Co-Authored-By: Claude Fable 5 <[email protected]>
QA: HDR content on the compatibility (Media3/ExoPlayer) pipeline played
audio+subtitles with a permanently black video surface.

Investigation findings:
- The phone track-selection path (buildPhoneParameters) has no HDR
  video-MIME handling at all (unlike the TV path), and Media3 has no
  phone-side tone-mapping fallback wired up (no setVideoEffects /
  TONEMAP anywhere in the pipeline).
- Nothing catches the failure: preflight only inspects Dolby Vision
  codec strings (HDR10/HLG never trigger onUnsupportedPlayback), the
  startup-stall detector marks the session started as soon as AUDIO
  progresses (isPlaying short-circuits it), and a video renderer that
  silently produces no frames raises no fatal PlaybackException — so
  the black screen persisted with no recovery.

A real Media3 HDR fix (tone-mapped decoder config / first-frame
watchdog) is deep; per the QA decision, HDR sources now prefer the
primary engine instead: VideoPlaybackBackendRequest gains hasHdrVideo
(from the active FileVersion.hdr) and the Auto selector routes it to
MPV, whose gpu-next renderer tone-maps HDR correctly. Route intent
(Cast/DRM/HLS/transcode) and the MPV device floor still win first, and
the engine decision log now reports hasHdrVideo (plus the previously
missing hasSoftwareOnlyVideoCodec) as the selection reason.

Co-Authored-By: Claude Fable 5 <[email protected]>
Subtitle overrides chosen in the phone player were persisted (commit
63b0e7a's mechanism fired correctly on write) but never restored:
selections are recorded as fingerprints of the MOUNTED subtitle list
(PlayerSubtitleInfo — uiState.subtitleTracks), while restore resolved
them against the catalog FileVersion.subtitleTracks (SubtitleTrack),
whose index space is the demux stream index. The two fingerprint
overloads therefore never matched and the saved choice was silently
dropped (audio persisted fine because it uses the catalog type on both
sides).

Adds resolveMountedSubtitleOrdinal (a PlayerSubtitleInfo resolver — a
List overload would erase to the same JVM signature) and restores the
saved fingerprint against playbackState.subtitleUrls, the same list the
write path fingerprints.

Co-Authored-By: Claude Fable 5 <[email protected]>
Selecting subtitles on the item page before playback never enabled
them: the detail screen's pick is an ordinal into the catalog
FileVersion.subtitleTracks list, but the phone player validated it
directly against the mounted playbackState.subtitleUrls list (a
different index space and ordering) — so it either fell out of range
and dropped to auto/-1, or selected the wrong track.

Adds resolveInitialMobileSubtitleOrdinal (TV
resolveInitialSubtitleTrackIndex parity): the catalog pick is matched
onto the mounted list by label first, then language + forced flag +
codec; unmatched picks fall back to the raw ordinal when mountable
(previous behavior), else defer to persisted/auto selection.

Co-Authored-By: Claude Fable 5 <[email protected]>
The Box background style previously used CaptionStyleCompat's
backgroundColor, which Media3 renders as a per-line BackgroundColorSpan
hugging the glyphs with no breathing room. Box now paints through
windowColor instead: SubtitlePainter draws the window as a single block
behind the whole cue with INNER_PADDING_RATIO (12.5% of the text size)
of padding, giving the box visible margin around the text. Shadow /
Outline / None keep a fully transparent window as before. The MPV
route already pads its box via MpvSubtitleStyle's sub-border-size
floor (same QA sweep).

Co-Authored-By: Claude Fable 5 <[email protected]>
- MediaRow read LocalViewConfiguration inside remember's calculation
  lambda (non-composable context); capture it first.
- Restore HomeSectionRow's optional onSeeAllClick pass-through:
  Libraries and the Reading hub legitimately route it to their browse
  surfaces — only Home drops the affordance (iOS parity).
- PersonDetailScreen needed the ExperimentalMaterial3Api opt-in for
  PullToRefreshBox.

Earlier "compile checks" during the sweep invoked a nonexistent Gradle
task and filtered for a string Kotlin errors don't emit — worthless on
both counts. Real verification below.

Co-Authored-By: Claude Fable 5 <[email protected]>
Landscape lock with persisted preference, double-tap ±10s zones,
safe-inset HUD padding, quality HUD button (chapters/quality out of the
gear), sheet fling guard + submenu back navigation, pinch
fit/fill/stretch, HDR-to-MPV routing, subtitle persistence fingerprint
fix, pre-playback subtitle carry-over, boxed-subtitle padding.

Co-Authored-By: Claude Fable 5 <[email protected]>
…stly

Follow-ups from the first hands-on pass of the QA build:

- The top-bar title had no width constraint, so in portrait with every
  button visible (rotate, chapters, tracks, quality, gear) the trailing
  buttons were pushed off-screen — the gear "disappeared" exactly when
  a second file version made the quality button appear, and the
  remaining buttons crowded oddly. The title now owns a weighted,
  shrink-first middle slot and ellipsizes; the cluster always fits.
- Orientation toggle uses screen-rotation glyphs instead of a padlock —
  it changes rotation behavior, it doesn't lock anything.
- Tracks button swaps "CC" for the speech-bubble glyph (iOS
  captions.bubble): the sheet selects audio as well as subtitles.
- Control glyphs normalized to a uniform 22dp.

Co-Authored-By: Claude Fable 5 <[email protected]>
@coderabbitai

coderabbitai Bot commented Jul 9, 2026 •

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

This PR adds Dolby Vision routing and subtitle ordinal mapping in playback, reworks player gestures/sheets, updates detail screens for Auto track selection and episode navigation, removes the standalone Home Section Items route, and applies smaller UI polish across browse and supporting screens.

Changes

Player playback, gestures, and sheets

Layer / File(s) Summary
Dolby Vision routing and subtitle mapping
android-shared/.../VideoPlaybackBackendRequest.kt, PlaybackEngineDecision.kt, VideoPlaybackBackendSelector.kt, TrackSelectionFingerprint.kt, MobileSubtitleAutoSelection.kt, PlayerViewModel.kt, tests
Adds a Dolby Vision request flag, routes Dolby Vision direct-play requests to MPV, updates backend decision logging, and translates persisted or initial subtitle selections into mounted subtitle ordinals.
Orientation lock and version-switch messaging
PlayerScreen.kt, PlayerViewModel.kt
Moves orientation lock into the ViewModel, persists the setting, and adds a dismissible version-switch message with failure recovery state and handlers.
Pinch and skip gesture updates
PlayerGestureHandler.kt, PlayerOverlay.kt, tests
Replaces cycle-based pinch gravity with directional stepping, changes double-tap skip zones, and adds the skip-flash badge and related test updates.
Controls and sheet behavior
PlayerControls.kt, PlayerOverlay.kt, PlayerSheetSupport.kt, ChaptersSheet.kt, PlaybackStatsSheet.kt, QualitySelector.kt, SleepTimerSheet.kt, SubtitleSearchSheet.kt, SubtitleStyleSheet.kt, TracksSheet.kt, PlayerSettingsSheet.kt
Adds the quality control, safe-area padding, and new player sheet support helpers, then applies max-height, nested-scroll, and back-navigation behavior across the player sheets.

Detail screens and media selection

Layer / File(s) Summary
Episode and auto-selection ViewModel logic
ItemDetailViewModel.kt
Adjusts episode downloads and season loading for series and episode pages, reloads parent-series episodes for episode details, and adds auto-selection reset methods.
Track selector rows and Auto pickers
MediaSelectors.kt
Replaces the old selector button with a full-width track selector row, converts version/audio/subtitle pickers to nullable Auto selection, and adds displayed-value helpers.
Movie detail selector and section rework
MovieDetailContent.kt
Updates movie detail selection props and callbacks, adds a downloaded row and dedicated track selector rows, removes media-info overflow content, and rewires details, cast, and similar sections.
Detail screen download confirmation and wiring
ItemDetailScreen.kt
Adds a partial-download discard confirmation dialog and wires the updated movie detail selection and episode callbacks through the screen.
Current-episode highlight and spoiler removal
SeriesDetailContent.kt, EpisodeList.kt
Removes the spoiler-blur toggle from series detail and episode rows, and replaces it with current-episode highlighting and a NOW VIEWING label.
SectionHeader and genre pill cleanup
DetailSharedComponents.kt
Makes the section header label optional, truncates long titles, and removes the genre pill row while moving the details facts list under an internal header.
SimilarRail conditional rendering
SimilarRail.kt, test
Removes the loading placeholder and keeps the similar rail hidden until items are loaded.

Home, navigation, and shared-element ownership

Layer / File(s) Summary
HomeSectionItems removal
HomeSectionItemsScreen.kt, AndroidModule.kt, AppNavigation.kt, Routes.kt, MainScreen.kt
Deletes the HomeSectionItems screen, view model, route, navigation entry, DI binding, and the Home screen callback that opened it.
Backdrop overlay, MediaCard subtitle, and MediaRow play wiring
BackdropCard.kt, MediaCard.kt, MediaRow.kt
Adds a clickable overlay action on backdrop cards, lets media cards show a subtitle caption, and routes play taps through MediaRow with horizontal touch bias.
HeroClaimRegistry shared-element ownership
SharedElementTransition.kt
Introduces a composition-local registry that claims and releases hero keys so duplicate shared-element nodes do not render sharedBounds simultaneously.
Home screen hero-claim and play wiring
HomeScreen.kt, HomeSectionRow.kt
Provides the hero-claim registry through HomeScreen and forwards backdrop play actions through HomeSectionRow only when the row uses the backdrop layout.

Browse and supporting UI polish

Layer / File(s) Summary
Browse density and date subtitles
BrowseScreen.kt, FilterSheet.kt, CatalogGrid.kt
Moves view-density selection into the filter sheet, adds per-card subtitles from the current sort field, and formats catalog dates for card captions.
Login, calendar, profile, person, and recommendations polish
LoginScreen.kt, CalendarScreen.kt, ProfileSelectionScreen.kt, PersonDetailScreen.kt, RecommendationsScreen.kt
Adds username autofocus, adjusts calendar insets and month labels, adds status-bar padding, wraps person detail in pull-to-refresh, and replaces the recommendations empty state with saved-list shortcuts.

Estimated code review effort: 4 (Complex) | ~75 minutes

Sequence Diagram(s)

sequenceDiagram
  participant PlayerScreen
  participant VideoPlaybackBackendRequest
  participant VideoPlaybackBackendSelector
  participant PlayerViewModel
  participant TrackSelectionFingerprint
  participant MobileSubtitleAutoSelection
  PlayerScreen->>VideoPlaybackBackendRequest: build request with hasDolbyVisionVideo
  VideoPlaybackBackendRequest->>VideoPlaybackBackendSelector: select(request)
  VideoPlaybackBackendSelector-->>PlayerScreen: choose MPV or Media3
  PlayerViewModel->>TrackSelectionFingerprint: resolveMountedSubtitleOrdinal(fingerprint)
  PlayerViewModel->>MobileSubtitleAutoSelection: resolveInitialMobileSubtitleOrdinal(catalogOrdinal)
  MobileSubtitleAutoSelection-->>PlayerViewModel: mounted subtitle ordinal
Loading
sequenceDiagram
  participant HomeScreen
  participant HeroClaimRegistry
  participant HomeSectionRow
  participant MediaRow
  HomeScreen->>HeroClaimRegistry: provide registry via LocalHeroClaimRegistry
  HomeSectionRow->>MediaRow: render backdrop row with onItemPlay
  MediaRow->>HeroClaimRegistry: heroSharedBounds(contentId) claims key
  MediaRow-->>HomeSectionRow: skip duplicate sharedBounds when key is owned
Loading

Possibly related issues

Possibly related PRs

  • Silo-Server/silo-android#11: Both PRs touch the Dolby-Vision/video backend decision logic in android-shared/.../VideoPlaybackBackendSelector.select(...).
  • Silo-Server/silo-android#38: Both PRs modify the same backend-selection code (VideoPlaybackBackendRequest + VideoPlaybackBackendSelector) to route direct-play requests to MPV based on new request flags.
  • Silo-Server/silo-android#43: Both PRs adjust subtitle background rendering behavior by changing how box-style caption rendering is mapped in Android.
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 32.46% 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 accurately reflects the broad QA sweep covering home, detail, player, and page-level parity fixes.
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.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

@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: 4f2d365ae1

ℹ️ About Codex in GitHub

Codex has been enabled to automatically 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 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

// handling or tone-mapping fallback and can end up decoding
// audio+subtitles with a permanently black video surface —
// route HDR sources to MPV, which tone-maps via gpu-next.
request.hasHdrVideo -> VideoPlaybackBackendKind.Mpv

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 Route HDR before planned Media3 direct

When an HDR file also comes with a v2 plan whose engine is MEDIA3_DIRECT, this new HDR clause is never reached because the selector returns Media3 at the planned-engine check above. That is exactly the direct-play HDR case this change is trying to move to MPV; Cast/DRM/HLS/transcode can still win first, but hasHdrVideo needs to override MEDIA3_DIRECT or those files will continue to open on the black-screen Media3 path.

Useful? React with 👍 / 👎.

Comment on lines +106 to +109
if (targetLabel != null && mountedLabel != null &&
mountedLabel.equals(targetLabel, ignoreCase = true)
) {
return true

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 Match duplicate subtitle labels by more than title

For files that have multiple subtitle tracks with the same title, such as English plus English forced/SDH, this early return maps the detail-page selection to the first mounted label match and skips the forced/language/codec checks below. If the mounted order differs from the catalog order, selecting the full English track can start playback with the forced track (or vice versa); the label match should still verify the distinguishing fields before returning.

Useful? React with 👍 / 👎.

…forced flag

Codex review findings on PR #49, both verified:

- The HDR-to-MPV clause sat below the planned-engine checks, so a v2
  plan naming MEDIA3_DIRECT — the normal direct-play case — kept HDR on
  the black-screen Media3 path. HDR now outranks planned Media3 engines
  (transcoded output exempt: the server already resolved HDR), with a
  regression test pinning the planned-MEDIA3_DIRECT case.
- Catalog-to-mounted subtitle matching returned on a bare label match;
  duplicate titles ("English" full + forced) could map to the wrong
  variant when mounted order differs. A label match now also requires
  the forced flag to agree.

Co-Authored-By: Claude Fable 5 <[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: 4

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
androidApp/src/androidMain/kotlin/org/siloserver/silo/android/ui/components/BackdropCard.kt (1)

120-133: 🩺 Stability & Availability | 🟡 Minor | ⚡ Quick win

Interactive play overlay needs a larger touch target.

When onOverlayClick is set, the center circle becomes a separate action from the card tap, but the clickable area is still only 40.dp. Expand the hit area to at least 48.dp without changing the visual glyph size, e.g. with minimumInteractiveComponentSize() or a larger transparent touch target.

🤖 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
`@androidApp/src/androidMain/kotlin/org/siloserver/silo/android/ui/components/BackdropCard.kt`
around lines 120 - 133, The play overlay in BackdropCard is clickable but its
hit area is only the 40.dp circle, so enlarge the touch target to at least 48.dp
while keeping the visible glyph unchanged. Update the Box that applies the
onOverlayClick clickable modifier to use a larger interactive area such as
minimumInteractiveComponentSize() or an expanded transparent target, and keep
the existing CircleShape/visual sizing intact.
🧹 Nitpick comments (4)
androidApp/src/androidMain/kotlin/org/siloserver/silo/android/ui/screens/recommendations/RecommendationsScreen.kt (1)

201-235: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Consider using MaterialTheme.colorScheme instead of hardcoded Color.White for the pill border.

SavedShortcutPill sets contentColor to MaterialTheme.colorScheme.onSurface but the border uses Color.White.copy(alpha = ...). In a light theme the border would be nearly invisible while the text remains dark. Aligning the border color with onSurface (or onSurfaceVariant) would keep both visuals consistent across themes.

♻️ Optional refactor
-        border = BorderStroke(1.5.dp, Color.White.copy(alpha = if (selected) 0.9f else 0.3f)),
+        border = BorderStroke(
+            1.5.dp,
+            MaterialTheme.colorScheme.onSurface.copy(alpha = if (selected) 0.9f else 0.3f),
+        ),
🤖 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
`@androidApp/src/androidMain/kotlin/org/siloserver/silo/android/ui/screens/recommendations/RecommendationsScreen.kt`
around lines 201 - 235, The pill border in SavedShortcutPill is using a
hardcoded Color.White value, which makes it inconsistent with the theme-aware
content color and can disappear in light mode. Update the border color to use
MaterialTheme.colorScheme (for example onSurface or onSurfaceVariant with alpha)
so the OutlinedButton border matches the existing themed text/icon styling and
works across themes.
androidApp/src/androidMain/kotlin/org/siloserver/silo/android/ui/screens/player/PlayerScreen.kt (1)

470-484: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Consider extracting a shared engine-request builder.

The VideoPlaybackBackendRequest construction at lines 470–484 (initial media setup) and lines 545–559 (subtitle refresh) are identical. A divergence here would cause inconsistent backend selection between initial mount and subtitle-refresh re-switch. Extracting a helper on PlayerUiState (alongside activeVersionHasHdrVideo) would centralize the field mapping and prevent drift.

♻️ Optional refactor: shared engine-request builder
+private fun PlayerViewModel.PlayerUiState.buildEngineSwitchRequest(
+    contentId: String,
+    fileId: Int?,
+    playMethod: PlayMethod,
+    delivery: PlaybackDelivery?,
+    plan: PlaybackPlan?,
+    effectiveStreamUrl: String,
+): VideoPlaybackBackendRequest = VideoPlaybackBackendRequest(
+    contentId = contentId,
+    fileId = fileId,
+    playMethod = playMethod,
+    delivery = delivery,
+    plannedEngine = plan?.engine,
+    routeFamily = plan?.routeFamily,
+    formFactor = VideoPlaybackFormFactor.Mobile,
+    hasHardContainer = playMethod == PlayMethod.DIRECT &&
+        isHardPlaybackContainer(container),
+    hasStyledSubtitles = subtitleTracks.any { it.isStyledSubtitle() },
+    hasSoftwareOnlyVideoCodec = softwareOnlyVideoCodec,
+    hasHdrVideo = activeVersionHasHdrVideo(),
+    isAdaptiveHlsStream = isLikelyAdaptiveHlsStreamUrl(effectiveStreamUrl),
+)

Then both call sites become:

-            val engineRequest = VideoPlaybackBackendRequest(
-                contentId = contentId,
-                fileId = activeFileId ?: initialFileId,
-                playMethod = mediaSpec.playMethod,
-                delivery = delivery,
-                plannedEngine = plan?.engine,
-                routeFamily = plan?.routeFamily,
-                formFactor = VideoPlaybackFormFactor.Mobile,
-                hasHardContainer = mediaSpec.playMethod == PlayMethod.DIRECT &&
-                    isHardPlaybackContainer(uiState.container),
-                hasStyledSubtitles = uiState.subtitleTracks.any { it.isStyledSubtitle() },
-                hasSoftwareOnlyVideoCodec = uiState.softwareOnlyVideoCodec,
-                hasHdrVideo = uiState.activeVersionHasHdrVideo(),
-                isAdaptiveHlsStream = isLikelyAdaptiveHlsStreamUrl(effectiveStreamUrl),
-            )
+            val engineRequest = uiState.buildEngineSwitchRequest(
+                contentId = contentId,
+                fileId = activeFileId ?: initialFileId,
+                playMethod = mediaSpec.playMethod,
+                delivery = delivery,
+                plan = plan,
+                effectiveStreamUrl = effectiveStreamUrl,
+            )

Also applies to: 545-559

🤖 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
`@androidApp/src/androidMain/kotlin/org/siloserver/silo/android/ui/screens/player/PlayerScreen.kt`
around lines 470 - 484, The VideoPlaybackBackendRequest construction is
duplicated in the initial media setup and subtitle-refresh paths, so centralize
the field mapping to avoid drift. Extract a shared builder helper on
PlayerUiState alongside activeVersionHasHdrVideo that assembles the request from
contentId, fileId, mediaSpec, delivery, plan, and uiState, then replace both
call sites with that helper so backend selection stays consistent.
androidApp/src/androidMain/kotlin/org/siloserver/silo/android/ui/screens/player/PlayerSheetSupport.kt (1)

40-82: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Consider bundling the repeated modifier chain into a single helper.

heightIn(max = playerSheetMaxHeight()).nestedScroll(PlayerSheetFlingGuard) is copy-pasted across five sheet files. A combined Modifier.playerSheetContentConstraints() extension here would enforce consistent application and reduce the chance of a sheet silently diverging (as happened with PlaybackStatsSheet's header not reusing PlayerSheetHeader).

♻️ Proposed helper
+@Composable
+internal fun Modifier.playerSheetContentConstraints(): Modifier =
+    this.heightIn(max = playerSheetMaxHeight()).nestedScroll(PlayerSheetFlingGuard)
🤖 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
`@androidApp/src/androidMain/kotlin/org/siloserver/silo/android/ui/screens/player/PlayerSheetSupport.kt`
around lines 40 - 82, The repeated sheet constraint modifier chain is duplicated
across multiple player sheet composables, so add a shared Modifier extension in
PlayerSheetSupport (for example, a helper that applies playerSheetMaxHeight and
PlayerSheetFlingGuard together) and replace each inline use with it. Update the
affected sheet composables to use the new helper consistently so height and
nested scroll behavior stay aligned across all sheets and future changes only
need to be made in one place.
androidApp/src/androidMain/kotlin/org/siloserver/silo/android/ui/screens/detail/ItemDetailViewModel.kt (1)

188-228: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Consider unit tests for the new episode/series branching logic.

onEpisodeDownloadTapped's series/episode branching, loadEpisodeSiblings, and the updated selectSeason are all new decision points with type-dependent fallbacks, but no corresponding ViewModel test file is included in this cohort. Given the sibling test suites added elsewhere in this PR (e.g. VideoPlaybackBackendSelectorTest, MobileSubtitleAutoSelectionTest), similar fake-repository-based tests here would catch regressions in the series/episode grouping logic.

Also applies to: 474-501, 496-499

🤖 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
`@androidApp/src/androidMain/kotlin/org/siloserver/silo/android/ui/screens/detail/ItemDetailViewModel.kt`
around lines 188 - 228, Add unit tests for the new type-dependent branching in
ItemDetailViewModel, especially onEpisodeDownloadTapped, loadEpisodeSiblings,
and selectSeason. Cover both series and non-series detail cases plus the
existing-download path so the fallback behavior, grouping fields, and
cancel/start decisions are verified with fake repositories and enqueuer
collaborators.
🤖 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/org/siloserver/silo/android/ui/screens/detail/MediaSelectors.kt`:
- Around line 388-397: The explicit subtitle selection fallback in
formatSubtitleValueLabel is mislabeled as "Auto - None" when selectedIndex is
out of range. Update the logic to treat a non-null explicit index as an explicit
selection: resolve it against tracks, and if it is stale/out of bounds, fall
back to a sensible explicit label instead of Auto; use formatAudioValueLabel as
the behavioral reference and keep the null and -1 cases unchanged.

In
`@androidApp/src/androidMain/kotlin/org/siloserver/silo/android/ui/screens/detail/SeriesDetailContent.kt`:
- Around line 266-271: The Details section is rendering a header even when there
are no facts, because `DetailFactsList()` exits early but `item(contentType =
"detail-facts")` still creates the section shell. Guard the entire Details item
in `SeriesDetailContent` the same way the cast section is gated by checking
`buildDetailFacts(detail).isNotEmpty()` before emitting `SectionHeader(title =
"Details")` and `DetailFactsList(detail = detail)`. Apply the same change in
`MovieDetailContent` so both detail screens only render the Details section when
facts actually exist.

In
`@androidApp/src/androidMain/kotlin/org/siloserver/silo/android/ui/screens/player/MobileSubtitleAutoSelection.kt`:
- Around line 103-117: The label-matching branch in matchesCatalogSubtitle
ignores the forced flag, so it can return the wrong subtitle when forced and
non-forced tracks share the same label. Update
PlayerSubtitleInfo.matchesCatalogSubtitle to apply the same forced check used in
the language fallback path before returning true on a label match, and keep the
codec comparison behavior consistent with the existing fallback logic.

In
`@androidApp/src/androidMain/kotlin/org/siloserver/silo/android/ui/screens/player/PlaybackStatsSheet.kt`:
- Around line 88-110: The PlaybackStatsSheet header is hand-rolled and should be
replaced with the shared PlayerSheetHeader to match the other sheets’
back-navigation and styling. Update the header area in PlaybackStatsSheet to
reuse PlayerSheetHeader(title, onBack) instead of a custom Row/IconButton/Text
block, so it inherits the standardized font, spacing, and chevron behavior. Keep
the existing back action wired through onBack and remove the duplicate
title/back button markup from this sheet.

---

Outside diff comments:
In
`@androidApp/src/androidMain/kotlin/org/siloserver/silo/android/ui/components/BackdropCard.kt`:
- Around line 120-133: The play overlay in BackdropCard is clickable but its hit
area is only the 40.dp circle, so enlarge the touch target to at least 48.dp
while keeping the visible glyph unchanged. Update the Box that applies the
onOverlayClick clickable modifier to use a larger interactive area such as
minimumInteractiveComponentSize() or an expanded transparent target, and keep
the existing CircleShape/visual sizing intact.

---

Nitpick comments:
In
`@androidApp/src/androidMain/kotlin/org/siloserver/silo/android/ui/screens/detail/ItemDetailViewModel.kt`:
- Around line 188-228: Add unit tests for the new type-dependent branching in
ItemDetailViewModel, especially onEpisodeDownloadTapped, loadEpisodeSiblings,
and selectSeason. Cover both series and non-series detail cases plus the
existing-download path so the fallback behavior, grouping fields, and
cancel/start decisions are verified with fake repositories and enqueuer
collaborators.

In
`@androidApp/src/androidMain/kotlin/org/siloserver/silo/android/ui/screens/player/PlayerScreen.kt`:
- Around line 470-484: The VideoPlaybackBackendRequest construction is
duplicated in the initial media setup and subtitle-refresh paths, so centralize
the field mapping to avoid drift. Extract a shared builder helper on
PlayerUiState alongside activeVersionHasHdrVideo that assembles the request from
contentId, fileId, mediaSpec, delivery, plan, and uiState, then replace both
call sites with that helper so backend selection stays consistent.

In
`@androidApp/src/androidMain/kotlin/org/siloserver/silo/android/ui/screens/player/PlayerSheetSupport.kt`:
- Around line 40-82: The repeated sheet constraint modifier chain is duplicated
across multiple player sheet composables, so add a shared Modifier extension in
PlayerSheetSupport (for example, a helper that applies playerSheetMaxHeight and
PlayerSheetFlingGuard together) and replace each inline use with it. Update the
affected sheet composables to use the new helper consistently so height and
nested scroll behavior stay aligned across all sheets and future changes only
need to be made in one place.

In
`@androidApp/src/androidMain/kotlin/org/siloserver/silo/android/ui/screens/recommendations/RecommendationsScreen.kt`:
- Around line 201-235: The pill border in SavedShortcutPill is using a hardcoded
Color.White value, which makes it inconsistent with the theme-aware content
color and can disappear in light mode. Update the border color to use
MaterialTheme.colorScheme (for example onSurface or onSurfaceVariant with alpha)
so the OutlinedButton border matches the existing themed text/icon styling and
works across themes.
🪄 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: dbb9ff2a-a012-4f97-8784-7ebe3d47fcc4

📥 Commits

Reviewing files that changed from the base of the PR and between 3fecf74 and 4f2d365.

📒 Files selected for processing (55)
  • android-shared/src/androidMain/kotlin/org/siloserver/silo/common/player/SubtitleManager.kt
  • android-shared/src/androidMain/kotlin/org/siloserver/silo/common/player/backend/PlaybackEngineDecision.kt
  • android-shared/src/androidMain/kotlin/org/siloserver/silo/common/player/backend/VideoPlaybackBackendRequest.kt
  • android-shared/src/androidMain/kotlin/org/siloserver/silo/common/player/backend/VideoPlaybackBackendSelector.kt
  • android-shared/src/androidUnitTest/kotlin/org/siloserver/silo/common/player/SubtitleManagerAppearanceTest.kt
  • android-shared/src/androidUnitTest/kotlin/org/siloserver/silo/common/player/backend/VideoPlaybackBackendSelectorTest.kt
  • androidApp/src/androidMain/kotlin/org/siloserver/silo/android/di/AndroidModule.kt
  • androidApp/src/androidMain/kotlin/org/siloserver/silo/android/ui/components/BackdropCard.kt
  • androidApp/src/androidMain/kotlin/org/siloserver/silo/android/ui/components/MediaCard.kt
  • androidApp/src/androidMain/kotlin/org/siloserver/silo/android/ui/components/MediaRow.kt
  • androidApp/src/androidMain/kotlin/org/siloserver/silo/android/ui/navigation/AppNavigation.kt
  • androidApp/src/androidMain/kotlin/org/siloserver/silo/android/ui/navigation/Routes.kt
  • androidApp/src/androidMain/kotlin/org/siloserver/silo/android/ui/navigation/SharedElementTransition.kt
  • androidApp/src/androidMain/kotlin/org/siloserver/silo/android/ui/screens/MainScreen.kt
  • androidApp/src/androidMain/kotlin/org/siloserver/silo/android/ui/screens/auth/LoginScreen.kt
  • androidApp/src/androidMain/kotlin/org/siloserver/silo/android/ui/screens/browse/BrowseScreen.kt
  • androidApp/src/androidMain/kotlin/org/siloserver/silo/android/ui/screens/browse/CatalogGrid.kt
  • androidApp/src/androidMain/kotlin/org/siloserver/silo/android/ui/screens/browse/FilterSheet.kt
  • androidApp/src/androidMain/kotlin/org/siloserver/silo/android/ui/screens/calendar/CalendarScreen.kt
  • androidApp/src/androidMain/kotlin/org/siloserver/silo/android/ui/screens/detail/DetailSharedComponents.kt
  • androidApp/src/androidMain/kotlin/org/siloserver/silo/android/ui/screens/detail/EpisodeList.kt
  • androidApp/src/androidMain/kotlin/org/siloserver/silo/android/ui/screens/detail/ItemDetailScreen.kt
  • androidApp/src/androidMain/kotlin/org/siloserver/silo/android/ui/screens/detail/ItemDetailViewModel.kt
  • androidApp/src/androidMain/kotlin/org/siloserver/silo/android/ui/screens/detail/MediaInfoSheet.kt
  • androidApp/src/androidMain/kotlin/org/siloserver/silo/android/ui/screens/detail/MediaSelectors.kt
  • androidApp/src/androidMain/kotlin/org/siloserver/silo/android/ui/screens/detail/MovieDetailContent.kt
  • androidApp/src/androidMain/kotlin/org/siloserver/silo/android/ui/screens/detail/SeriesDetailContent.kt
  • androidApp/src/androidMain/kotlin/org/siloserver/silo/android/ui/screens/detail/SimilarRail.kt
  • androidApp/src/androidMain/kotlin/org/siloserver/silo/android/ui/screens/home/HomeScreen.kt
  • androidApp/src/androidMain/kotlin/org/siloserver/silo/android/ui/screens/home/HomeSectionItemsScreen.kt
  • androidApp/src/androidMain/kotlin/org/siloserver/silo/android/ui/screens/home/HomeSectionRow.kt
  • androidApp/src/androidMain/kotlin/org/siloserver/silo/android/ui/screens/people/PersonDetailScreen.kt
  • androidApp/src/androidMain/kotlin/org/siloserver/silo/android/ui/screens/player/ChaptersSheet.kt
  • androidApp/src/androidMain/kotlin/org/siloserver/silo/android/ui/screens/player/MobileSubtitleAutoSelection.kt
  • androidApp/src/androidMain/kotlin/org/siloserver/silo/android/ui/screens/player/PlaybackStatsSheet.kt
  • androidApp/src/androidMain/kotlin/org/siloserver/silo/android/ui/screens/player/PlayerControls.kt
  • androidApp/src/androidMain/kotlin/org/siloserver/silo/android/ui/screens/player/PlayerGestureHandler.kt
  • androidApp/src/androidMain/kotlin/org/siloserver/silo/android/ui/screens/player/PlayerOverlay.kt
  • androidApp/src/androidMain/kotlin/org/siloserver/silo/android/ui/screens/player/PlayerScreen.kt
  • androidApp/src/androidMain/kotlin/org/siloserver/silo/android/ui/screens/player/PlayerSettingsSheet.kt
  • androidApp/src/androidMain/kotlin/org/siloserver/silo/android/ui/screens/player/PlayerSheetSupport.kt
  • androidApp/src/androidMain/kotlin/org/siloserver/silo/android/ui/screens/player/PlayerViewModel.kt
  • androidApp/src/androidMain/kotlin/org/siloserver/silo/android/ui/screens/player/QualitySelector.kt
  • androidApp/src/androidMain/kotlin/org/siloserver/silo/android/ui/screens/player/SleepTimerSheet.kt
  • androidApp/src/androidMain/kotlin/org/siloserver/silo/android/ui/screens/player/SubtitleSearchSheet.kt
  • androidApp/src/androidMain/kotlin/org/siloserver/silo/android/ui/screens/player/SubtitleStyleSheet.kt
  • androidApp/src/androidMain/kotlin/org/siloserver/silo/android/ui/screens/player/TracksSheet.kt
  • androidApp/src/androidMain/kotlin/org/siloserver/silo/android/ui/screens/profiles/ProfileSelectionScreen.kt
  • androidApp/src/androidMain/kotlin/org/siloserver/silo/android/ui/screens/recommendations/RecommendationsScreen.kt
  • androidApp/src/androidUnitTest/kotlin/org/siloserver/silo/android/ui/performance/MobileDetailOpenPerformanceSourceTest.kt
  • androidApp/src/androidUnitTest/kotlin/org/siloserver/silo/android/ui/screens/detail/EpisodeSpoilerBlurSourceTest.kt
  • androidApp/src/androidUnitTest/kotlin/org/siloserver/silo/android/ui/screens/player/MobileSubtitleAutoSelectionTest.kt
  • androidApp/src/androidUnitTest/kotlin/org/siloserver/silo/android/ui/screens/player/PlayerPinchGravitySourceTest.kt
  • shared/src/commonMain/kotlin/org/siloserver/silo/playback/TrackSelectionFingerprint.kt
  • shared/src/commonTest/kotlin/org/siloserver/silo/playback/TrackSelectionFingerprintTest.kt
💤 Files with no reviewable changes (7)
  • androidApp/src/androidMain/kotlin/org/siloserver/silo/android/ui/screens/home/HomeSectionItemsScreen.kt
  • androidApp/src/androidMain/kotlin/org/siloserver/silo/android/ui/navigation/Routes.kt
  • androidApp/src/androidUnitTest/kotlin/org/siloserver/silo/android/ui/screens/detail/EpisodeSpoilerBlurSourceTest.kt
  • androidApp/src/androidMain/kotlin/org/siloserver/silo/android/ui/navigation/AppNavigation.kt
  • androidApp/src/androidMain/kotlin/org/siloserver/silo/android/di/AndroidModule.kt
  • androidApp/src/androidMain/kotlin/org/siloserver/silo/android/ui/screens/detail/MediaInfoSheet.kt
  • androidApp/src/androidMain/kotlin/org/siloserver/silo/android/ui/screens/MainScreen.kt

- A stale explicit subtitle index no longer displays as "Auto - None":
  the formatter falls back to the default track's label, mirroring the
  audio formatter's honest handling.
- The "Details" header renders inside DetailFactsList, gated on having
  facts — sparse items no longer show a lone header (movie + series).
- PlaybackStatsSheet adopts the shared PlayerSheetHeader like the other
  sheets instead of hand-rolling a diverging header.

Co-Authored-By: Claude Fable 5 <[email protected]>
@RXWatcher

Copy link
Copy Markdown
Contributor Author

All six findings addressed across two pushes: Codex's HDR-ordering P1 (HDR now outranks planned Media3 engines, regression test added) and duplicate-label subtitle P2 (label match requires the forced flag to agree — CodeRabbit's duplicate finding covered by the same fix) in 2550304; CodeRabbit's stale-index "Auto - None" mislabel, lone Details header, and PlaybackStatsSheet header divergence in f9033a6.

RXWatcher and others added 2 commits July 9, 2026 08:56
Device A/B on a Pixel 10 Pro (2026-07-09): the same HDR10+ 4K HEVC file
plays perfectly on Media3 (official v0.3.4) but hiccups on the QA
build, which routed it to MPV under the new blanket hasHdrVideo clause.
MPV's slurp-then-idle streaming pattern leaves the connection idle long
enough to be reset mid-file (observed: "Stream ends prematurely" +
reconnect at 1.2GB of 5.2GB), each reset a visible stutter.

The Media3 black-screen class is Dolby Vision, not HDR at large. The
routing clause and request field become hasDolbyVisionVideo, detected
from the playback plan's source metadata (dolby_vision_profile /
hdr_format); HDR10/HDR10+/HLG stays on Media3. Plan-less legacy
sessions fall back to Media3 with the failure detectors as backstop.

Co-Authored-By: Claude Fable 5 <[email protected]>
… pill

Selecting a version/quality that the server can't honor (e.g. "No lower
resolution version available for transcoding") dropped the viewer to a
bare black full-screen error, because onSelectVersion stops the current
session before attempting the new one — so any failure left nothing
playing.

Failures are now non-fatal: a dismissable, auto-expiring pill surfaces
a humanized message ("That quality isn't available for this title.")
over the still-playing video, and the previously-working version is
restarted. A recursion guard covers the unlikely case where the
restore itself fails.

Co-Authored-By: Claude Fable 5 <[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.

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
android-shared/src/androidMain/kotlin/org/siloserver/silo/common/player/backend/PlaybackEngineDecision.kt (1)

53-62: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

reasonFor precedence no longer mirrors the selector — DV routing gets a misleading reason.

The selector evaluates hasDolbyVisionVideo && playMethod != TRANSCODE before the plannedEngine branches, so a DV source with plannedEngine = MEDIA3_DIRECT selects Mpv. Here hasDolbyVisionVideo is checked last (Line 62), after the plannedEngine branches (Lines 53-56), so the same request logs reason=plannedEngine=media3_direct while the actual selection is Mpv. That defeats the diagnostic value of toLogLine() for exactly the new DV path.

Move the DV branch above the plannedEngine branches and mirror the selector's transcode guard so DV+TRANSCODE still reports transcode:

🐛 Align reason precedence with the selector
                     request.delivery == PlaybackDelivery.SERVER_TRANSCODE_HLS -> "delivery=server_transcode_hls"
+                    request.hasDolbyVisionVideo && request.playMethod != PlayMethod.TRANSCODE -> "hasDolbyVisionVideo"
                     request.plannedEngine == PlaybackEngineKind.MEDIA3_DIRECT -> "plannedEngine=media3_direct"
                     request.plannedEngine == PlaybackEngineKind.MEDIA3_PROGRESSIVE_REMUX -> "plannedEngine=media3_progressive_remux"
                     request.plannedEngine == PlaybackEngineKind.MEDIA3_HLS -> "plannedEngine=media3_hls"
                     request.plannedEngine == PlaybackEngineKind.MPV_DIRECT -> "plannedEngine=mpv_direct"
                     request.delivery == PlaybackDelivery.SERVER_REMUX_PROGRESSIVE -> "delivery=server_remux_progressive"
                     request.playMethod == PlayMethod.TRANSCODE -> "transcode"
                     request.hasHardContainer -> "hasHardContainer"
                     request.hasStyledSubtitles -> "hasStyledSubtitles"
                     request.hasSoftwareOnlyVideoCodec -> "hasSoftwareOnlyVideoCodec"
-                    request.hasDolbyVisionVideo -> "hasDolbyVisionVideo"
                     else -> "default"
🤖 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/org/siloserver/silo/common/player/backend/PlaybackEngineDecision.kt`
around lines 53 - 62, The reasonFor mapping in PlaybackEngineDecision no longer
matches the selector order, so Dolby Vision requests can log the wrong reason.
Update the when logic in reasonFor to mirror selectEngine(): place the
hasDolbyVisionVideo check before the plannedEngine branches and apply the same
playMethod != PlayMethod.TRANSCODE guard so DV+TRANSCODE still resolves to
transcode. Use the existing symbols reasonFor, selectEngine,
hasDolbyVisionVideo, plannedEngine, and PlayMethod.TRANSCODE to keep the
decision and log output aligned.
🧹 Nitpick comments (1)
androidApp/src/androidMain/kotlin/org/siloserver/silo/android/ui/screens/player/PlayerViewModel.kt (1)

2164-2196: 🩺 Stability & Availability | 🔵 Trivial | ⚡ Quick win

Keep the recovery guard active until the retry finishes

versionSwitchRecovering is cleared immediately after onSelectVersion(previousIndex), but that call only starts a coroutine. The retry is currently safe only because selectedVersionIndex = -1 makes the second failure skip the recovery branch; if that assumption changes, the loop protection disappears. Keep the flag set until the retry coroutine completes, or move the recovery path so it doesn’t re-enter failVersionSwitch.

🤖 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
`@androidApp/src/androidMain/kotlin/org/siloserver/silo/android/ui/screens/player/PlayerViewModel.kt`
around lines 2164 - 2196, The recovery guard in failVersionSwitch is being
cleared too early because onSelectVersion(previousIndex) starts async work and
may re-enter the failure path later. Keep versionSwitchRecovering set until the
retry flow has actually completed, or restructure the recovery so the retry
cannot call failVersionSwitch again while the guard is active. Use the
failVersionSwitch and onSelectVersion symbols to locate the recovery branch and
move the reset to after the retry finishes.
🤖 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.

Outside diff comments:
In
`@android-shared/src/androidMain/kotlin/org/siloserver/silo/common/player/backend/PlaybackEngineDecision.kt`:
- Around line 53-62: The reasonFor mapping in PlaybackEngineDecision no longer
matches the selector order, so Dolby Vision requests can log the wrong reason.
Update the when logic in reasonFor to mirror selectEngine(): place the
hasDolbyVisionVideo check before the plannedEngine branches and apply the same
playMethod != PlayMethod.TRANSCODE guard so DV+TRANSCODE still resolves to
transcode. Use the existing symbols reasonFor, selectEngine,
hasDolbyVisionVideo, plannedEngine, and PlayMethod.TRANSCODE to keep the
decision and log output aligned.

---

Nitpick comments:
In
`@androidApp/src/androidMain/kotlin/org/siloserver/silo/android/ui/screens/player/PlayerViewModel.kt`:
- Around line 2164-2196: The recovery guard in failVersionSwitch is being
cleared too early because onSelectVersion(previousIndex) starts async work and
may re-enter the failure path later. Keep versionSwitchRecovering set until the
retry flow has actually completed, or restructure the recovery so the retry
cannot call failVersionSwitch again while the guard is active. Use the
failVersionSwitch and onSelectVersion symbols to locate the recovery branch and
move the reset to after the retry finishes.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 5cc6f6ba-4d19-4682-a5eb-61ba1af25fbf

📥 Commits

Reviewing files that changed from the base of the PR and between 4f2d365 and 5e8a53c.

📒 Files selected for processing (12)
  • android-shared/src/androidMain/kotlin/org/siloserver/silo/common/player/backend/PlaybackEngineDecision.kt
  • android-shared/src/androidMain/kotlin/org/siloserver/silo/common/player/backend/VideoPlaybackBackendRequest.kt
  • android-shared/src/androidMain/kotlin/org/siloserver/silo/common/player/backend/VideoPlaybackBackendSelector.kt
  • android-shared/src/androidUnitTest/kotlin/org/siloserver/silo/common/player/backend/VideoPlaybackBackendSelectorTest.kt
  • androidApp/src/androidMain/kotlin/org/siloserver/silo/android/ui/screens/detail/DetailSharedComponents.kt
  • androidApp/src/androidMain/kotlin/org/siloserver/silo/android/ui/screens/detail/MediaSelectors.kt
  • androidApp/src/androidMain/kotlin/org/siloserver/silo/android/ui/screens/detail/MovieDetailContent.kt
  • androidApp/src/androidMain/kotlin/org/siloserver/silo/android/ui/screens/detail/SeriesDetailContent.kt
  • androidApp/src/androidMain/kotlin/org/siloserver/silo/android/ui/screens/player/MobileSubtitleAutoSelection.kt
  • androidApp/src/androidMain/kotlin/org/siloserver/silo/android/ui/screens/player/PlaybackStatsSheet.kt
  • androidApp/src/androidMain/kotlin/org/siloserver/silo/android/ui/screens/player/PlayerScreen.kt
  • androidApp/src/androidMain/kotlin/org/siloserver/silo/android/ui/screens/player/PlayerViewModel.kt
🚧 Files skipped from review as they are similar to previous changes (5)
  • androidApp/src/androidMain/kotlin/org/siloserver/silo/android/ui/screens/player/PlaybackStatsSheet.kt
  • androidApp/src/androidMain/kotlin/org/siloserver/silo/android/ui/screens/detail/SeriesDetailContent.kt
  • androidApp/src/androidMain/kotlin/org/siloserver/silo/android/ui/screens/player/MobileSubtitleAutoSelection.kt
  • androidApp/src/androidMain/kotlin/org/siloserver/silo/android/ui/screens/detail/MovieDetailContent.kt
  • androidApp/src/androidMain/kotlin/org/siloserver/silo/android/ui/screens/detail/MediaSelectors.kt

@RXWatcher

Copy link
Copy Markdown
Contributor Author

Superseded by a new combined PR (phone QA sweep + full Android review + multi-part audiobooks). Closing in favor of that.

@RXWatcher RXWatcher closed this Jul 9, 2026
RXWatcher added a commit that referenced this pull request Jul 9, 2026
…anding playback

Three verified fixes from the PR #49 review:

- Subtitle silent-Off: the initial-selection chain suppressed the persisted
  and auto fallbacks (and armed persistence) on the mere presence of an
  explicit detail-page pick. An unmatchable pick then resolved to -1 (Off)
  AND persisted that Off for every future playback of the file. Resolve the
  pick first and gate suppression/persistence on it actually resolving, so a
  failed pick falls through to persisted -> auto and never persists Off. A
  deliberate -1 (Off) from the detail page still resolves and persists.

- Version-switch failure: removed the dead versionSwitchRecovering guard and
  the selectedVersionIndex=-1 sentinel. Extracted startVersionPlayback(index,
  isRecovery) that bypasses the dedupe on recovery without writing an invalid
  index; a recovery restart that also fails now raises a persistent error
  screen instead of leaving a session-less black player behind a 4s pill. The
  auto-dismiss timer is a single cancellable job, so repeated identical
  failures no longer dismiss the fresh pill early.

- Orientation snap: orientationLocked's eager 'true' meant the factory-scoped
  VM's first frame always reported locked, snapping rotateFreely users to
  landscape then back on every entry. Added orientationLockedResolved (nullable,
  null until the persisted value arrives); PlayerScreen applies orientation only
  once resolved. The non-null display flow is unchanged for the HUD toggle.

Co-Authored-By: Claude Fable 5 <[email protected]>
RXWatcher added a commit that referenced this pull request Jul 9, 2026
…wnloads tab

Embedded in the tab shell (showTopBar=false) the Scaffold added its own
status-bar inset on top of the shell-provided contentTopPadding, so content sat
one status-bar height too low in every branch — the same defect PR #49 fixed on
Calendar. Apply Calendar's conditional contentWindowInsets; standalone
(showTopBar=true) is unchanged.

Co-Authored-By: Claude Fable 5 <[email protected]>
@RXWatcher
RXWatcher deleted the fix/phone-qa-sweep-2 branch July 13, 2026 19:37
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