Skip to content

Phone + TV QA sweep (2026-07-09/10): profile edit, playback, HDR, TV parity - #52

Merged
RXWatcher merged 15 commits into
Silo-Server:mainfrom
RXWatcher:fix/phone-qa-punchlist-2026-07-09
Jul 9, 2026
Merged

RXWatcher merged 15 commits into
Silo-Server:mainfrom
RXWatcher:fix/phone-qa-punchlist-2026-07-09

Conversation

@RXWatcher

@RXWatcher RXWatcher commented Jul 9, 2026 •

Copy link
Copy Markdown
Contributor

Consolidated QA sweep across the phone (androidApp) and TV (androidTvApp) clients from Jim's on-device passes on 2026-07-09/10, mirroring silo-apple (iOS↔phone, tvOS↔TV). Supersedes #51 (its profile fix is included here as 06cb58f1).

Phone

  • Profile edit — can now clear a PIN and set subtitles to Off (06cb58f1); duplicate-name pre-check + real server errors in forms.
  • Detail — correct audio/subtitle track labels, subtitle-row gating, genre dedupe; persist per-item audio/subtitle overrides (I7); scroll-slop fix.
  • Libraries — full filter sheet on the browse tab (L2/L3); removed "See All" from Libraries + Reading rows (H3); date subtitles + density/sort separation.
  • Calendar / For You — month header + top padding; For You toggle applies in-place.
  • Posters — per-placement hero keys eliminate poster flicker on shared-element transitions.

Playback (shared)

  • HDR black screen — force the hardware HEVC decoder via MediaCodecSelector so Media3 can't fall back to the software path that rendered black on Pixel Tensor. (58d3ef7b)
  • Stall watchdog — now covers all playback routes (not just DIRECT) and catches mid-stream freezes, feeding the recovery planner. (TP7)

TV

  • Sign-in — server address field takes initial focus (TS4).
  • Detail — durable audio/subtitle track persistence, ported from phone I7 (TM4).
  • Player — in-player video quality selector backed by the server transcode ladder (TP3).
  • For You — added the tvOS "Recommendations" dropdown row (TT2).
  • Aurora backdrop — dither grain overlay to kill 8-bit gradient banding on the Shield (TS3).

Verification

  • ./gradlew :androidApp:assembleDebug :androidTvApp:assembleDebug test — BUILD SUCCESSFUL, tests pass.
  • Not yet installed on the Shield; device-retest items (TS1, TS5, TSet1, TP1, TCal1) are fixed in code and awaiting a fresh build on-device.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • New Features

    • Added advanced Browse filters, filter chips, active-filter counts, and filter preservation in Libraries.
    • Added in-place Watchlist and Favorites switching within Recommendations.
    • Added TV playback quality selection with server-based quality options.
    • Saved audio and subtitle selections now persist per media file.
    • Improved poster-to-detail transitions, calendar headers, and TV backdrop appearance.
  • Bug Fixes

    • Improved playback startup-stall detection across playback methods.
    • Prevented subtitle controls from appearing when no subtitles are available.
    • Improved video surface handling and HEVC hardware decoder selection.
    • Fixed profile PIN and subtitle-off settings updates.
    • Improved TV setup focus and quality-control availability.

RXWatcher and others added 13 commits July 9, 2026 21:49
…, scroll slop

QA sweep 2026-07-09 (Jim), Android phone:
- I2: apply tvOS-style "Auto - <track>" prefix consistently across the Video,
  Audio, and Subtitle detail rows (audio resolves the effective track; subtitle
  shows it only for the lone-track case it can resolve without the player's
  prefs-dependent resolver, else bare "Auto").
- I1: hide the Subtitles track row when the file has no subtitle tracks
  (matches iOS shouldShowSubtitleValue gating).
- I5: drop the duplicated "Genres" row from the detail facts list — genres are
  already shown in the hero facts line (iOS omits them from the facts list).
- H4: raise horizontal-scroll touch slop 1.75x -> 2.25x so incidental sideways
  wobble stops hijacking vertical scroll on the Pixel (needs on-device feel).

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

QA sweep 2026-07-09 (Jim), Android phone:
- C2: move the Month/Year label out of the week-strip Row (where portrait
  squeezed it to ~0 width and stacked the letters vertically) into a
  left-aligned header line above the strip, matching iOS CalendarView.
- C1: drop the calendar PinnedHeader's top padding (bottom-only) so it stops
  stacking whitespace above the Following/Trending/All capsule in portrait.
- FY2: Watchlist/Favorites now toggle the saved list IN PLACE over the
  recommendations feed (pinned pill row, re-tap to return) instead of
  navigating to a separate page. Deliberate divergence from iOS per Jim.
  Removed the now-unused nav callbacks from RecommendationsScreen/MainScreen
  and updated MobileAppleParitySourceTest to assert the in-place intent.

Co-Authored-By: Claude Fable 5 <[email protected]>
QA sweep 2026-07-09 (Jim), Android phone Libraries "Library" tab:
- L1: show the sorted-by date under each card when sorting by Recently Added
  or Release Date (mirrors the standalone BrowseScreen's cardSubtitle).
- L4: move the Comfortable/Normal/Compact density control onto its own
  labelled "View" row so it stops reading as another sort option beside the
  sort chips.

L2 (full filter sheet on the Libraries tab) and L3 (fold genre into filters)
are a larger consolidation onto the shared CatalogFilterState/FilterSheet and
are tracked as a follow-up in docs/reviews/2026-07-09-phone-qa-punchlist.md.

Co-Authored-By: Claude Fable 5 <[email protected]>
QA sweep 2026-07-09 (Jim), Android phone Home — the top-priority flicker.

Root cause: the hero shared-element transition keyed every poster on its raw
content id ("hero-<contentId>"). When the same item appeared in two visible
rows (Continue Watching + a genre row) both cards registered sharedBounds under
one key, so the transition layer treated them as a live match and drew the
poster into the overlay above everything while scrolling. The HeroClaimRegistry
band-aid arbitrated a single owner at runtime, but its claim churned on every
LazyRow recycle (release + re-claim -> one-frame plain render), which is the
flicker itself.

Fix (mirrors iOS per-card zoomInstanceID + pendingZoomSourceID):
- Each poster PLACEMENT derives a unique hero key (content-id prefix + a
  per-instance UUID) in MediaCard, so duplicate content ids in different rows
  can never collide. Collision is now impossible by construction.
- On tap the card publishes its own key to a HeroSourceHandoff provided at the
  AppNavigation root; the detail backdrop (heroTarget) reads that key so the
  morph animates from the exact card tapped, not some duplicate.
- Removed HeroClaimRegistry / LocalHeroClaimRegistry and the Home-level provider
  entirely. Replaced heroSharedBounds with heroSource(key)/heroTarget().
- Degrades gracefully: a navigation with no recorded source (deep link, search)
  or missing scope just renders the backdrop with no morph — never a crash.
- Updated MobileSharedElementSourceTest to guard the new wiring.

NOTE: this rewires the app-wide card->detail morph; it compiles and unit-tests
pass but the ANIMATION needs on-device validation (cannot be unit-tested).

Co-Authored-By: Claude Fable 5 <[email protected]>
QA sweep 2026-07-09 (Jim), Android phone item detail — subtitle/audio picks
made on the detail page were in-memory only, so leaving and re-opening the page
(or the app) lost them.

This turned out NOT to need a server change: the detail VM already has the same
UserItemStatePort the player uses, and shared TrackSelectionFingerprint helpers
already fingerprint catalog AudioTrack/SubtitleTrack (and resolve them back).

- persistTrackSelection(): on every audio/subtitle pick, record the selected
  version's file override via recordAudio/SubtitleTrackSelection keyed on
  (contentId, fileId). Auto writes null (clears); explicit Off writes the shared
  SUBTITLE_OFF_FINGERPRINT sentinel; a concrete pick writes the catalog track's
  fingerprint — the same scheme the player restores against.
- seedPersistedTrackSelection(): on load and on version switch, map any saved
  fingerprint back to the catalog list (Off -> -1) and seed the selectors,
  without clobbering a pick the user already made this session.

Co-Authored-By: Claude Fable 5 <[email protected]>
…ware (black)

Some HDR HEVC encodes (observed: an odd-resolution 3840x1920 Main10 L5.0 4K HDR10+
title) are rejected by the phone hardware decoder's profile/level capability check
even though the decoder can actually decode the stream — an NVIDIA Shield plays it,
and so does the Pixel's Tensor decoder (c2.google.hevc.decoder, hardware-backed)
once it's handed the stream. Without intervention Media3 avoids the hardware decoder
and falls to Android's software HEVC path, whose 10-bit HDR output is undisplayable
(audio + subtitles play over a black surface).

Install a MediaCodecSelector that hands the video renderer only the
hardware-accelerated HEVC decoders (falling back to the full list if none exist),
so it uses the hardware decoder despite the conservative "NoSupport" flag. Decoder
fallback stays enabled. Device-confirmed on a Pixel 10 Pro XL: the title now plays
in hardware with full HDR.

Also gate mpv's `vo` on the surface (mpv-android BaseMPVView pattern): start with
vo="null" and enable the real vo only once a surface is attached, nulling it on
detach — so mpv never opens its GPU context surface-less ("Missing surface pointer")
and can recover video if a surface arrives late.

Co-Authored-By: Claude Fable 5 <[email protected]>
The Libraries "Library" subtab had only an inline genre chip rail + a 3-way sort,
while iOS (and the app's own standalone Browse screen) offer a full filter sheet.
Back the subtab with the shared CatalogFilterState/FilterSheet stack:

- L2: add a Filter button (with an active-facet badge) beside the sort chips that
  opens the existing FilterSheet — Watch Status, Dynamic Range, and Categories
  (Genres/Decade/Rating/Studio/Language/Series...), Match All/Any, and a
  Preserve-filters toggle, media-type aware (audiobook libraries get
  author/narrator/series). Active selections render as removable chips.
- L3: genre is now a Categories facet inside the sheet — the inline genre rail is
  gone. View-density also moved into the sheet's "View" section (the L4 inline row
  is removed), matching iOS which has no standalone density control.

LibrariesUiState/ViewModel now carry filterState/availableFilters/browseMediaType/
preserveFilters and browse via CatalogFilterQueryBuilder (queryGroups + match),
with per-library persistence through BrowsePrefsStore — mirroring BrowseViewModel.
Sort chips + date-subtitle behaviour (L1) are unchanged.

Build + test green.

Co-Authored-By: Claude Fable 5 <[email protected]>
iOS has no "See All" affordance on its recommendation rows, and Home already
dropped it for parity. Remove it from the remaining two surfaces — the Libraries
"Recommended" subtab and the Reading hub — so the rows omit it (HomeSectionRow
renders it only when onSeeAllClick is non-null). Drops the now-unused
onSeeAllClick/onShowBrowse plumbing. (Jim 2026-07-10.)

Co-Authored-By: Claude Fable 5 <[email protected]>
…nce (TM4)

Android TV QA sweep 2026-07-10 (Jim), vs tvOS gold standard.

- TS4: first sign-in now anchors initial focus on the server-address field
  (matching tvOS `.defaultFocus(.host)`) instead of auto-focusing the "Set up
  with phone" card — the user chooses that path by navigating to it.
- TM4: subtitle/audio picks on the TV detail page were only kept in an
  in-memory session map (lost across process death, not cross-device). Port the
  phone I7 fix: persist the selected version's override via the shared
  UserItemStatePort (recordSubtitle/AudioTrackSelection keyed on contentId+
  fileId, Auto clears, Off writes the sentinel) and re-seed on load + version
  switch via the shared TrackSelectionFingerprint resolvers. Mirrors tvOS
  TrackSelectionPersistence. (Next-up-card selectors, which target a different
  item, are left in-session for now.)

Both build; TV test suite green.

Co-Authored-By: Claude Fable 5 <[email protected]>
TV QA 2026-07-10 (Jim): certain remuxes on the compatibility player buffer
forever (e.g. The Office US S8E15). The startup-stall watchdog only fired for
PlayMethod.DIRECT and only before playback started — so a wedged
remux/transcode/HLS session, or one that froze mid-stream after starting, had no
watchdog and buffered indefinitely.

Rework PlaybackStartupStallDetector to measure "time since last forward
progress" from a single anchor: it now (1) triggers on ANY route at startup (not
just DIRECT) and (2) adds a mid-stream freeze watchdog once playback has started.
Forward progress (actively playing or position advancing >=1.5s) re-anchors the
clock; a paused session (playWhenReady=false) never triggers. Separate startup
vs mid-stream grace windows (both 20s). The existing sampling loop feeds it, so a
wedge now fails over via PlaybackRecoveryPlanner instead of hanging. Shared by
phone + TV.

Both apps build; detector unit tests updated (non-direct triggers, paused
doesn't, mid-stream freeze fires after grace).

Co-Authored-By: Claude Fable 5 <[email protected]>
…e ladder (TP3)

TV QA 2026-07-10 (Jim): no way to select video quality while playing. The HUD
Quality row only surfaced adaptive-stream variants (gated to >2), so single-file
direct-play movies showed it disabled.

Replace it with a server-transcode quality ladder mirroring tvOS
ApplePlaybackQuality: the VM builds Auto + Original + each downscale rung below
the source resolution (from PlaybackQuality's wire vocab) at session load, and
selecting a rung pins a session-level qualityOverride and re-requests the session
at the current position (preferredQualityOverride = qualityOverride ?: profile
pref), so the server transcodes to that rung — or returns to Auto/Original. The
row is now enabled whenever there's more than one option (always ≥2). Adaptive
variant track-override is dropped for the Quality row (tvOS doesn't do it).

Both apps build; TV test suite green (quality-ladder + switchQuality source
tests updated).

Co-Authored-By: Claude Fable 5 <[email protected]>
TT2 — For You dropdown now has a third "Recommendations" row (sparkles),
mirroring tvOS `.recommendations`; it returns to the For You feed via the
same navigateToSecondary + moveFocusToContent path the For You tab uses.

TS3 — the auth Aurora backdrop's plum-night gradients quantized into visible
8-bit bands on the Shield (Android 11, no RenderEffect blur). Add a tiled
per-pixel ±luminance noise grain (~4% alpha) over the final composite —
ordered dithering that crosses the band steps with no visible texture.

Co-Authored-By: Claude Fable 5 <[email protected]>
The phone EditProfileViewModel had the same explicitNulls=false trap we
fixed on TV this session. Disabling a PIN sent pin=null, which SiloJson
omits, so the server kept the old PIN; selecting subtitles "Off" mapped
to null, likewise omitted, so the prior mode stuck. Port the TV fix:
track loadedHasPin and send an explicit "" to clear a PIN, and send the
literal "off" for subtitle mode. Matches TvEditProfileViewModel.

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

coderabbitai Bot commented Jul 9, 2026 •

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@RXWatcher, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 43 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 08cde26e-4424-4cb1-af7b-6af5dc306d37

📥 Commits

Reviewing files that changed from the base of the PR and between 06cb58f and a461687.

📒 Files selected for processing (5)
  • androidApp/src/androidMain/kotlin/org/siloserver/silo/android/ui/navigation/SharedElementTransition.kt
  • androidApp/src/androidMain/kotlin/org/siloserver/silo/android/ui/screens/detail/ItemDetailViewModel.kt
  • androidApp/src/androidMain/kotlin/org/siloserver/silo/android/ui/screens/libraries/LibrariesScreen.kt
  • androidTvApp/src/androidMain/kotlin/org/siloserver/silo/tv/ui/screens/detail/TvItemDetailViewModel.kt
  • androidTvApp/src/androidMain/kotlin/org/siloserver/silo/tv/ui/screens/player/TvPlayerViewModel.kt
📝 Walkthrough

Walkthrough

The PR updates Android and TV playback behavior, shared-element navigation, library filtering, persisted track selections, profile request mapping, recommendation flows, calendar layout, and TV quality selection.

Changes

Playback pipeline

Layer / File(s) Summary
Decoder and surface lifecycle
android-shared/src/androidMain/kotlin/org/siloserver/silo/common/player/...
HEVC hardware decoders are preferred when available, and mpv video output is enabled only while a surface is attached.
Progress-based startup stall detection
android-shared/src/androidMain/kotlin/org/siloserver/silo/common/player/video/...
Stall detection follows forward progress, adds a mid-stream grace period, and covers non-direct routes with pause guards and expanded tests.

Mobile hero navigation

Layer / File(s) Summary
Hero source and target handoff
androidApp/src/androidMain/kotlin/org/siloserver/silo/android/ui/navigation/SharedElementTransition.kt, androidApp/src/androidMain/kotlin/org/siloserver/silo/android/ui/navigation/AppNavigation.kt
Shared-element transitions use placement-specific source keys passed through HeroSourceHandoff.
Poster and detail wiring
androidApp/src/androidMain/kotlin/org/siloserver/silo/android/ui/components/MediaCard.kt, androidApp/src/androidMain/kotlin/org/siloserver/silo/android/ui/screens/detail/DetailSharedComponents.kt
Media cards publish unique tapped keys, while detail backdrops consume them as hero targets.
Transition validation
androidApp/src/androidUnitTest/kotlin/org/siloserver/silo/android/ui/navigation/MobileSharedElementSourceTest.kt
Source, target, host provider, and per-placement key expectations are updated.

Mobile content and preferences

Layer / File(s) Summary
Recommendations and layout flows
androidApp/src/androidMain/kotlin/org/siloserver/silo/android/ui/screens/recommendations/..., .../reading/..., .../calendar/..., .../components/MediaRow.kt
Recommendations switch saved lists in place; See All callbacks are removed, and calendar and horizontal touch layouts are adjusted.
Library facet browsing
androidApp/src/androidMain/kotlin/org/siloserver/silo/android/ui/screens/libraries/LibrariesScreen.kt, androidApp/src/androidMain/kotlin/org/siloserver/silo/android/di/AndroidModule.kt
Genre browsing becomes persisted facet filtering with server metadata, active chips, filter sheets, and date card subtitles.
Detail and profile preferences
androidApp/src/androidMain/kotlin/org/siloserver/silo/android/ui/screens/detail/..., .../profiles/EditProfileViewModel.kt
Track overrides persist by file fingerprint; auto labels, subtitle visibility, PIN clearing, and subtitle-off wire values are updated.

TV playback and navigation

Layer / File(s) Summary
TV detail, focus, and backdrop behavior
androidTvApp/src/androidMain/kotlin/org/siloserver/silo/tv/ui/screens/detail/..., .../auth/..., .../components/TvAuroraBackdrop.kt
TV track selections persist by file, setup focus targets the server field, and the aurora backdrop renders tiled dither grain.
Server-transcode quality selection
androidTvApp/src/androidMain/kotlin/org/siloserver/silo/tv/ui/screens/player/...
Quality choices are generated from a server ladder, and selecting a rung restarts playback with a session override.
TV For You navigation
androidTvApp/src/androidMain/kotlin/org/siloserver/silo/tv/ui/shell/TvMainShell.kt
The For You dropdown gains a Recommendations action with navigation and focus restoration.

Estimated code review effort: 5 (Critical) | ~120 minutes

Possibly related issues

Possibly related PRs

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 33.33% 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 is related to the main change set and mentions the major phone, playback, HDR, and TV 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: 06cb58f18d

ℹ️ 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".

it.copy(selectedFileId = fileId, selectedAudioIndex = null, selectedSubtitleIndex = null)
}
TvDetailTrackSelectionSession.remember(contentId, fileId, audio = null, subtitle = null)
persistTrackSelection()

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 clearing saved track selections on version switch

When a TV user switches to a file version that already has a durable audio/subtitle override, this call runs immediately after the state has been reset to selectedAudioIndex = null and selectedSubtitleIndex = null, so persistTrackSelection() writes null fingerprints for the newly selected file before seedPersistedTrackSelection() can read them. In the Room-backed port, null fingerprints clear the saved row, so version switching silently erases the very override this code is trying to restore.

Useful? React with 👍 / 👎.

Comment on lines +288 to +290
filterState = browsePrefs?.savedState(libraryId) ?: CatalogFilterState(),
availableFilters = null,
preserveFilters = browsePrefs?.preserveEnabled(libraryId) ?: 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 Restore browse prefs for the initially selected library

This restores saved filter state only when the user changes libraries via selectLibrary; the initial library chosen by refresh() never runs this branch and keeps the default CatalogFilterState() / preserveFilters = true. For a profile with saved Libraries/Browse filters (or preserve disabled) on the first/default library, opening Libraries and then Browse shows an unfiltered grid and the wrong preserve setting until the user switches libraries and back.

Useful? React with 👍 / 👎.

…browse prefs on default library

Two P2s from the PR #52 Codex review, both real:

- TvItemDetailViewModel.onVersionSelected reset the audio/subtitle indexes to
  null and then called persistTrackSelection(), which writes null fingerprints
  = clears the durable row for the newly selected file, wiping its saved
  override before seedPersistedTrackSelection could restore it. A version
  switch is a UI reset, not an explicit Auto pick, so it must not persist.
  Drop the persist call; only explicit track picks persist.

- LibrariesScreen.refresh() set the initial selectedLibraryId but never
  restored that library's saved filterState/preserveFilters (only
  selectLibrary did), so the default library opened Browse unfiltered until
  the user switched away and back. Restore the browse prefs whenever refresh
  resolves to a new library, mirroring selectLibrary.

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: 3

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/org/siloserver/silo/tv/ui/screens/detail/TvItemDetailViewModel.kt (1)

424-434: 🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick win

Version switches should not clear the stored track override.

onVersionSelected zeros the track indices and then calls persistTrackSelection(), which writes null/Auto for the newly selected file and clears any saved audio/subtitle choice before seedPersistedTrackSelection() can restore it. Remove that persist call here and let the seed step repopulate the selection.

🤖 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/org/siloserver/silo/tv/ui/screens/detail/TvItemDetailViewModel.kt`
around lines 424 - 434, Remove the persistTrackSelection() call from
onVersionSelected after resetting the selected track indices, so switching
versions does not overwrite the newly selected file’s stored audio/subtitle
override; let seedPersistedTrackSelection() restore the durable selection
instead.
🧹 Nitpick comments (2)
androidApp/src/androidMain/kotlin/org/siloserver/silo/android/ui/screens/detail/DetailSharedComponents.kt (1)

152-172: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Backdrop's contentId parameter is now dead.

Switching from heroSharedBounds(contentId) to heroTarget() (which reads the key from the hand-off, not contentId) leaves contentId unused inside Backdrop. DetailHero still threads contentId = detail.contentId (Line 118) purely to satisfy a parameter that no longer does anything.

Note this is coupled to MobileSharedElementSourceTest.detailBackdropIsTheHeroTarget, which asserts contentId = detail.contentId; that assertion must be dropped alongside the parameter or CI will fail.

♻️ Drop the unused parameter
         Backdrop(
             backdropUrl = detail.backdropUrl,
             backdropThumbhash = detail.backdropThumbhash,
             contentDescription = detail.title,
-            contentId = detail.contentId,
         )
 private fun Backdrop(
     backdropUrl: String?,
     backdropThumbhash: String?,
     contentDescription: String,
-    contentId: String?,
 ) {
🤖 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/DetailSharedComponents.kt`
around lines 152 - 172, Remove the unused contentId parameter from Backdrop and
update its call site in DetailHero so it no longer passes detail.contentId.
Update MobileSharedElementSourceTest.detailBackdropIsTheHeroTarget to remove the
corresponding contentId assertion.
androidTvApp/src/androidMain/kotlin/org/siloserver/silo/tv/ui/screens/player/TvPlayerHud.kt (1)

821-828: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Update stale comment describing the old Media3-override quality model.

The comment block at lines 821–828 still describes the previous implementation ("genuine Media3 track override", "synthetic Auto entry", "a genuine choice means size > 2"), which directly contradicts the new server-transcode ladder code at line 864 (videoQualities.size > 1). This stale comment will mislead future maintainers.

♻️ Proposed fix
 // Quality — derived from the server-transcode quality ladder
 // (Auto + Original + downscale rungs below the source). Selecting a
 // rung re-requests the session at that quality. When there is only
 // one option (Auto + Original for a single-file movie with no
 // downscale rungs) the row is shown disabled with an "Auto" value.
 // Version — the server's file versions (4K / 1080p encodes).
 // Switching restarts the session on that file at the current
 // position (QA 2026-07-08 / tvOS parity).
🤖 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/org/siloserver/silo/tv/ui/screens/player/TvPlayerHud.kt`
around lines 821 - 828, Update the quality-selection comment near the video
quality row to describe the current server-transcode ladder behavior, matching
the condition in the surrounding logic (`videoQualities.size > 1`). Remove
references to Media3 track overrides, synthetic “Auto” entries, and the old size
threshold; state that the row is disabled when no alternate server-provided
quality exists.
🤖 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/navigation/SharedElementTransition.kt`:
- Around line 61-63: HeroSourceHandoff.pendingKey remains set after consumption,
allowing retained source screens to reuse stale hero keys. Clear pendingKey
immediately after the hero target reads and applies it, while preserving the
existing handoff behavior for the current transition.

In
`@androidApp/src/androidMain/kotlin/org/siloserver/silo/android/ui/screens/detail/ItemDetailViewModel.kt`:
- Around line 748-774: Guard the asynchronous update in
seedPersistedTrackSelection() against version changes: before applying the
resolved audio and subtitle ordinals inside _uiState.update, verify that the
currently selected version still has the captured version.fileId. If it differs,
leave the state unchanged and avoid applying the stale persisted selection.

In
`@androidTvApp/src/androidMain/kotlin/org/siloserver/silo/tv/ui/screens/player/TvPlayerViewModel.kt`:
- Around line 2015-2023: Update switchQuality to restart playback through the
existing single-flight restart mechanism rather than calling loadContent
directly. Preserve the quality/UI-state updates and position override, but use
the same restart helper/path used by retry or version switching so the active
server session is stopped and concurrent restarts are serialized.

---

Outside diff comments:
In
`@androidTvApp/src/androidMain/kotlin/org/siloserver/silo/tv/ui/screens/detail/TvItemDetailViewModel.kt`:
- Around line 424-434: Remove the persistTrackSelection() call from
onVersionSelected after resetting the selected track indices, so switching
versions does not overwrite the newly selected file’s stored audio/subtitle
override; let seedPersistedTrackSelection() restore the durable selection
instead.

---

Nitpick comments:
In
`@androidApp/src/androidMain/kotlin/org/siloserver/silo/android/ui/screens/detail/DetailSharedComponents.kt`:
- Around line 152-172: Remove the unused contentId parameter from Backdrop and
update its call site in DetailHero so it no longer passes detail.contentId.
Update MobileSharedElementSourceTest.detailBackdropIsTheHeroTarget to remove the
corresponding contentId assertion.

In
`@androidTvApp/src/androidMain/kotlin/org/siloserver/silo/tv/ui/screens/player/TvPlayerHud.kt`:
- Around line 821-828: Update the quality-selection comment near the video
quality row to describe the current server-transcode ladder behavior, matching
the condition in the surrounding logic (`videoQualities.size > 1`). Remove
references to Media3 track overrides, synthetic “Auto” entries, and the old size
threshold; state that the row is disabled when no alternate server-provided
quality exists.
🪄 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: 8e1b871f-b5f3-4a5e-96f3-e596da195b66

📥 Commits

Reviewing files that changed from the base of the PR and between 5706de9 and 06cb58f.

📒 Files selected for processing (32)
  • android-shared/src/androidMain/kotlin/org/siloserver/silo/common/player/SiloPlayerFactory.kt
  • android-shared/src/androidMain/kotlin/org/siloserver/silo/common/player/mpv/MpvPlayer.kt
  • android-shared/src/androidMain/kotlin/org/siloserver/silo/common/player/video/PlaybackStartupStallDetector.kt
  • android-shared/src/androidUnitTest/kotlin/org/siloserver/silo/common/player/mpv/MpvPlayerSourceTest.kt
  • android-shared/src/androidUnitTest/kotlin/org/siloserver/silo/common/player/video/PlaybackStartupStallDetectorTest.kt
  • androidApp/src/androidMain/kotlin/org/siloserver/silo/android/di/AndroidModule.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/SharedElementTransition.kt
  • androidApp/src/androidMain/kotlin/org/siloserver/silo/android/ui/screens/MainScreen.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/ItemDetailViewModel.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/home/HomeScreen.kt
  • androidApp/src/androidMain/kotlin/org/siloserver/silo/android/ui/screens/libraries/LibrariesScreen.kt
  • androidApp/src/androidMain/kotlin/org/siloserver/silo/android/ui/screens/profiles/EditProfileViewModel.kt
  • androidApp/src/androidMain/kotlin/org/siloserver/silo/android/ui/screens/reading/ReadingHubScreen.kt
  • androidApp/src/androidMain/kotlin/org/siloserver/silo/android/ui/screens/recommendations/RecommendationsScreen.kt
  • androidApp/src/androidUnitTest/kotlin/org/siloserver/silo/android/ui/navigation/MobileAppleParitySourceTest.kt
  • androidApp/src/androidUnitTest/kotlin/org/siloserver/silo/android/ui/navigation/MobileSharedElementSourceTest.kt
  • androidTvApp/src/androidMain/kotlin/org/siloserver/silo/tv/ui/components/TvAuroraBackdrop.kt
  • androidTvApp/src/androidMain/kotlin/org/siloserver/silo/tv/ui/screens/auth/TvServerSetupScreen.kt
  • androidTvApp/src/androidMain/kotlin/org/siloserver/silo/tv/ui/screens/detail/TvItemDetailViewModel.kt
  • androidTvApp/src/androidMain/kotlin/org/siloserver/silo/tv/ui/screens/player/TvPlayerHud.kt
  • androidTvApp/src/androidMain/kotlin/org/siloserver/silo/tv/ui/screens/player/TvPlayerScreen.kt
  • androidTvApp/src/androidMain/kotlin/org/siloserver/silo/tv/ui/screens/player/TvPlayerViewModel.kt
  • androidTvApp/src/androidMain/kotlin/org/siloserver/silo/tv/ui/shell/TvMainShell.kt
  • androidTvApp/src/androidUnitTest/kotlin/org/siloserver/silo/tv/ui/screens/auth/TvAuthFocusSourceTest.kt
  • androidTvApp/src/androidUnitTest/kotlin/org/siloserver/silo/tv/ui/screens/player/TvPlayerControlsUsabilityTest.kt
💤 Files with no reviewable changes (1)
  • androidApp/src/androidMain/kotlin/org/siloserver/silo/android/ui/screens/MainScreen.kt

… async seeds; clear hero hand-off

Three CodeRabbit findings on PR #52, all verified real:

- [Major] TvPlayerViewModel.switchQuality called loadContent() directly,
  bypassing the versionSwitchJob single-flight that onSelectFileVersion/retry
  use — so a quality change didn't stop the old server session first
  (adoptActiveSession only swaps local reporter state) and could race a
  concurrent retry/version-switch, orphaning the previous session until
  timeout. Route it through the same cancel + stopSession + ensureActive path.

- [Minor] seedPersistedTrackSelection (phone ItemDetailViewModel and TV
  TvItemDetailViewModel) resolved track ordinals against the version captured
  before the suspend, then applied them to whatever version was selected when
  the coroutine resumed. A fast version switch wrote the old version's indexes
  into the new one. Re-check the selected fileId inside _uiState.update and
  leave the new version untouched on mismatch.

- [Minor] HeroSourceHandoff.pendingKey was never cleared after heroTarget read
  it, so a later navigation that doesn't set a fresh key (back -> search ->
  open another item, source screen still composed) could morph the new hero
  from the stale card. Consume the key once via remember and clear the
  hand-off, leaving the current morph intact.

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