Repository navigation
TV QA sweep + Apple parity: navigation model, calendar, player, sign-in, DV & frame-rate toggles - #44
Conversation
The subtitle pane's No background quick control unconditionally set backgroundStyle=None, so once enabled it could never be turned off from that row. Activating it while already On now restores the default Box background (Apple parity default). Co-Authored-By: Claude Fable 5 <[email protected]>
…ck + Back exits paused player Apple parity (silo-apple e9bd775 + f12a928): - New per-device "Dolby Vision" setting (wire key player.dolby_vision_enabled, default ON). Off stops advertising DV profiles in the capability payload (server plans base-layer/HDR10 delivery) and drops the DV MIME preference from TV track selection. Profile 5 always plays as DV (no watchable base layer); DV-off supersedes the Profile 7 HDR10 Fallback toggle. - Shared DolbyVisionPolicy (commonMain port of Apple's, with tests) is the single decision source for capability payload and track selection. - Toggle surfaced in the TV HUD Video pane (next to HDR passthrough) and the phone player settings sheet (next to HDR). - TV: Back while paused exits the player instead of hiding controls over a frozen frame; playing-state stepping unchanged. Co-Authored-By: Claude Fable 5 <[email protected]>
…nsent step QA feedback (2026-07-08), sign-in cluster: - 401-refresh racing sign-out could re-persist a fresh session after clearTokens (logout revokes the access token server-side, so requests 401 exactly during sign-out): both interceptors now drop a refresh response when the refresh token was cleared mid-flight. Pinned by a new SiloAuthPlugin test. - Pairing advertiser always advertises st=setup: Apple's companion card filters to state==setup and its own advertiser hardcodes it, so our registry-based 'login' state (always true after sign-out — the registry keeps entries) made the TV invisible to phones exactly when set-up-with-phone was needed again. - tvOS-parity consent step: the first pushed server of a pairing session now waits for Allow/Don't-allow on the TV before device-login (and the pairing code) starts; consent is per-session, deny sends Cancel(consent_denied). Receiver tests updated + 2 new. - First sign-in focuses the SETUP WITH PHONE card instead of dropping into the URL field; returning users (URL pre-filled) keep field focus. Co-Authored-By: Claude Fable 5 <[email protected]>
QA: Android's splash video had a purple gradient that bands on most TV panels and its own logo animation; tvOS ships a different cut on pure black. Use silo-apple's startup_splash.mp4 verbatim (identical pixels = identical logo scale) and switch the TV splash from Crop to Fit to match StartupSplashView's .resizeAspect. Co-Authored-By: Claude Fable 5 <[email protected]>
…t resets to top-left - Back from tab-root content focuses the top nav on the current section (was: popped tab history). - Back while the nav is focused: Home exits the app; any other section navigates Home with the bar still focused. - Selecting a tab from the nav focuses the top-left content item and scrolls to top (revives the contentFocusRequest nudge for Home and bumps the section nonce for library-type tabs), instead of restoring the last-focused card. - Secondary screens (Settings, Search, admin, …) keep their pop-first Back behavior. Shell focus-state unit tests and source pins updated to the new model. Co-Authored-By: Claude Fable 5 <[email protected]>
…mmendations, cast clip, focusable Details
- Version/Audio selector values read "Auto - <resolved>" while Auto is
selected and just the name after a manual pick; Subtitles previews the
auto resolution ("Auto - <default track>" / "Auto - None").
- Section headers match tvOS TVSectionHeader: single-line titles
("Cast & Crew", "Details", "More Like This"); the eyebrow survives
only where it adds context ("Season N" over "Episodes").
- "More Like This" now uses /recommendations/similar (Apple parity) and
disappears when the server has recommendations disabled or empty —
replacing the genre browse that produced alphabetical non-suggestions.
Episodes never show the shelf (Apple showsSimilarRail).
- Cast rail safe-area inset moved into the LazyRow contentPadding so the
leftmost card's focus ring isn't clipped by the viewport edge.
- Details facts section is a focusable stop (subtle highlight) so the
D-pad no longer drives from Cast & Crew straight past it.
Co-Authored-By: Claude Fable 5 <[email protected]>
…, label clearance - Name scales down to the detail-hero title size (was 38sp — larger than anywhere else in the UI); grid goes 7 → 6 columns to match every other catalog grid's card size. - Audiobooks/Music filmography filters only show when the profile actually has such libraries (graceful full set on lookup failure). - Grid gains label clearance so a single row's year isn't clipped. Co-Authored-By: Claude Fable 5 <[email protected]>
Manual audio/subtitle pre-selections lived only in the nav-entry-scoped ViewModel, so a season switch or detail re-entry silently reset them to Auto (QA 2026-07-08). A session-scoped store keyed by contentId restores them when the page rebuilds; durable per-playback preferences remain the player's job. Co-Authored-By: Claude Fable 5 <[email protected]>
…ow anchoring - Switching seasons from a season detail page replaces the nav entry instead of pushing, so paging through seasons never stacks pages — one Back returns to the originating screen (QA 2026-07-08). Series pages already swapped episodes in place via the season chips. - Focus entering the episodes section (season chips OR episode cards) anchors the body scroll to one canonical offset, so focusing "Season N" sits where an episode focus sits and returning up from Cast & Crew restores the same window position. Co-Authored-By: Claude Fable 5 <[email protected]>
…rity) QA 2026-07-08: For You was missing from the TV top menu. Root order now matches tvOS TVMainTabView (Home, library types, For You, Calendar); the tab selects the For You screen, and d-pad-down / dwell opens a dropdown (tvOS TVForYouDropdown) with Watchlist and Favorites, riding the existing persistent-panel machinery. Co-Authored-By: Claude Fable 5 <[email protected]>
The calendar's scroll-fade could leave the menu invisible while focused (QA 2026-07-08): visibility only snapped back on explicit menu-focus requests, not on geometric D-pad focus entry. Any focus on the bar now restores it (the new Back-to-menu model also routes through here). Co-Authored-By: Claude Fable 5 <[email protected]>
… pane - Long server URLs wrap to up to 3 lines in the Active Server group instead of truncating into unreadability. - Up at the top of a category's detail pane no longer escapes to the top menu; Left still exits to the category rail. - (The 'Server box smaller than the rest' report needs a screenshot — all rows share RowHeight/RowMaxWidth in code.) Co-Authored-By: Claude Fable 5 <[email protected]>
…enu, Back fix, box padding - New "Version" row in the HUD Video pane lists the server's file versions (4K/1080p encodes) and restarts the session on the chosen file at the current position — the in-player quality selection QA asked for (tvOS parity). Versions are plumbed through the playback start result. - D-pad-down while playing with nothing on screen opens the hover menu (HUD), matching tvOS; with an overlay up it still routes focus into the transport. - Back while playing with the transport overlay up is handled at the key-dispatch bridge, so Compose can no longer eat it as a button focus-deselection — it now reliably dismisses the overlay. - MPV box-style subtitles keep a minimum border size: in ASS border-style 4 the border inflates the box (no ring), giving the requested padding around SRT box subtitles. (Media3's SubtitleView has no public box-padding control — noted as a known limitation.) Co-Authored-By: Claude Fable 5 <[email protected]>
…fall back to another engine QA 2026-07-08: a 4K DV Profile 7 TrueHD remux (Framestor) played audio over a black screen on the Shield. The device CLAIMS P7 via its DV decoder, so the Media3 route is chosen — but the decoder renders nothing and raises no error, so the error-driven recovery ladder never fires. If playback is rolling and no first video frame arrives within 8s, treat it as an engine failure: the existing ladder prefers an alternate direct engine (MPV plays the P7/P8 HDR10 base layer) before conceding a server transcode. MPV dispatches onRenderedFirstFrame too, which cancels the watchdog on healthy playback. Co-Authored-By: Claude Fable 5 <[email protected]>
…ions QA 2026-07-08: certain remuxes never start on the compatibility route (e.g. The Office US S8E15) — the server-side remux wedges and the client buffers forever with no error. After 30s of buffering with no position progress, escalate into the existing recovery ladder (alternate direct engine first, then a fresh server route). The server-side wedge itself still needs the file for diagnosis — this ends the infinite spinner. Co-Authored-By: Claude Fable 5 <[email protected]>
… top bar QA (jake-, 2026-07-08): the personal grids used the adaptive cell size (~5 oversized columns vs the 6-column standard everywhere else), and their header rendered under the floating top bar, overlapping the Silo wordmark. Fixed columns to 6 and top-inset the header like every other page. Co-Authored-By: Claude Fable 5 <[email protected]>
The HDMI display-mode matching (resolution/refresh via HdrDisplayController) was always-on. Apple TV ships this as the user-facing "Match Content" system setting, default OFF, because the mode switch black-screens for 1-2s on player entry/exit. Parity: new device-scoped player.match_frame_rate setting (synced wire key, default off) gates applyForMedia; toggle lives in TV Settings > Playback. Co-Authored-By: Claude Fable 5 <[email protected]>
… the list QA 2026-07-08 (screenshot): default bring-into-view only revealed the focused CARD, leaving the previous day's caption strip stranded under the week picker and clipping the focused row at the bottom fold. When focus enters a day's shelf, the list now snaps that day to the top — full row visible, no orphaned fragments. Co-Authored-By: Claude Fable 5 <[email protected]>
…estamps QA 2026-07-08 (screenshots): the portrait poster with caption below was too tall for the day shelves (captions clipped at the fold, previous day bleeding under the week strip even with day snapping). Cells are now a single landscape row — small poster left, badges/title/episode/time beside it — so a full day shelf fits comfortably. Air time only shows when it is a real broadcast time; date-only entries rendered a meaningless "00:00" on every card. Co-Authored-By: Claude Fable 5 <[email protected]>
…reduced scale The landscape poster+text cell was a deviation; tvOS CalendarEventCard is a portrait poster (badges top-left, watched check top-right, air-time capsule bottom-right ON the poster) with a 2-line-reserved caption below. Restored that structure at 120x180dp so a full day shelf fits between the week strip and the fold; midnight-only air dates stay hidden. Co-Authored-By: Claude Fable 5 <[email protected]>
The focused card's default bring-into-view fought the day-snap — it re-scrolled the column to give itself a gutter, dragging the previous day's caption tail back under the week strip and pushing captions past the fold. The day list now suppresses focus-driven vertical scrolling (no-op BringIntoViewSpec) and relies on the shelf snap alone; the horizontal rows re-enable the smooth spec inside each shelf. Verified on-device (0.3.3-qa5). Co-Authored-By: Claude Fable 5 <[email protected]>
…ver) A Fire TV user reported the screensaver engaging 15-30 min into playback. The activity window already holds FLAG_KEEP_SCREEN_ON for the player screen's lifetime, but Fire OS has known cases where the window flag alone doesn't inhibit its screensaver — android:keepScreenOn on the visible PlayerView (the standard TV-player belt-and-braces) covers both the Media3 and MPV routes. Co-Authored-By: Claude Fable 5 <[email protected]>
Matching the tvOS asset wasn't enough — StartupSplashView renders the video in a small centered layer (tvOS: min(25% width, 440pt); iOS: min(60% width, 320pt)), while Android stretched it across the whole panel, making the logo ~4x too large (QA 2026-07-08). Both apps now use Apple's box sizing at Android scale (TV: 25%/220dp, phone: 60%/320dp) centered on black. Co-Authored-By: Claude Fable 5 <[email protected]>
The splash video encodes true #000000 black; the surrounding surfaces used 0xFF070509 / 0xFF050505, so the small centered video layer showed as a faint box (QA 2026-07-08). All splash backgrounds are now pure black on TV and phone. Co-Authored-By: Claude Fable 5 <[email protected]>
After a cascade pill commit, focus can transiently fall back to the bar while the new content composes; it landed on the adjacent For You tab, the dwell timer opened the dropdown, and its focus trap swallowed the user into Watchlist/Favorites with the bar dimmed (QA 2026-07-08: Movies→Browse/Genres all 'landed' there). The dropdown now opens only on a deliberate d-pad-down/OK, and its panel is visible/focusable only once actually entered. Co-Authored-By: Claude Fable 5 <[email protected]>
… Collections pill QA 2026-07-08 (Genres screen): - The top bar no longer scroll-hides: tvOS's TVTopMenuBar always floats and dims to 70% when content owns focus; our scroll-away fade let content slide under the wordmark and stranded users with an invisible bar. - Genre chips are one scrollable line instead of a 3-row FlowRow wall that consumed half the viewport. - The cascade's Collections pill only shows for libraries that actually have collections (shell probes /collections per library once), so an empty library no longer offers a dead-end black page. Co-Authored-By: Claude Fable 5 <[email protected]>
- With the bar permanently visible, scrolled content passed beneath it and the bar's focus dim weakened its own gradient exactly then — the wordmark/tabs floated unreadably over posters (QA 2026-07-08). The SHELL now draws a fixed top gradient scrim behind the bar; the bar keeps no band of its own so dimming only affects labels. - The cascade cached its pill list before the per-library collections probe finished, so empty libraries kept offering Collections; the filter is now evaluated outside remember and recomputes when the probe lands. Co-Authored-By: Claude Fable 5 <[email protected]>
… the locked menu Co-Authored-By: Claude Fable 5 <[email protected]>
|
Warning Review limit reached
Next review available in: 18 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the 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 configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (19)
📝 WalkthroughWalkthroughThis PR adds tvOS-parity pairing consent gating, a shared Dolby Vision policy applied across capability detection and settings, an auth-refresh sign-out race fix, in-player file-version switching, splash video sizing changes, a new TV "For You" shell tab with reworked back-navigation, and various TV detail/calendar/personal/player UI and settings adjustments. ChangesPairing Consent Flow
Dolby Vision Policy and Settings Integration
Auth Refresh Sign-out Race Fix
In-Player File Version Switching
Startup Splash Video Sizing
TV Shell For You Tab and Back Navigation
TV Collections Gating and Detail/Calendar/Personal Screen Polish
TV Player Controls, Watchdogs, and Settings
Estimated code review effort: 4 (Complex) | ~75 minutes Possibly related issues
Possibly related PRs
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 458e19cdda
ℹ️ 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".
| .filter { type -> libraries.any { type.matches(it) } } | ||
| .forEach { type -> add(TvRootDestination.LibraryType(type)) } | ||
| // tvOS root order: libraries, then For You, then Calendar. | ||
| add(TvRootDestination.ForYou) |
There was a problem hiding this comment.
Keep For You out of the TV top navigation
The repository instructions for /workspace/silo-android say Android TV navigation is limited to Home, available media-type tabs, Calendar, search, and profile actions; For You should be reached from Home rather than exposed as a tab. Adding TvRootDestination.ForYou here makes it a top-level TV tab for every profile, which violates that product exposure rule and changes Back/menu behavior around the For You route.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Deliberate product change, not an oversight — the doc was stale. For You as a root tab (with the Watchlist/Favorites dropdown) was explicitly requested in the 2026-07-08 QA feedback and mirrors tvOS, where TVMainTabView.visibleRoots ships .recommendations between the library tabs and Calendar. Updated CLAUDE.md/AGENTS.md in the follow-up commit to reflect the new exposure.
| bufferingWatchdogJob = if (isBuffering) { | ||
| viewModelScope.launch { | ||
| val positionAtStart = _uiState.value.position | ||
| delay(BUFFERING_WATCHDOG_MS) |
There was a problem hiding this comment.
Cancel stale buffering watchdogs before reloading playback
This watchdog is scoped only to the ViewModel, but loadContent(), retry, and in-player version switching do not cancel it or clear isBuffering. If playback enters buffering and the user retries/switches versions or a fallback starts before the 30s delay expires, the old delayed job will read the new _uiState and can call onEngineSwitchFailed after only the remaining time, causing a premature second fallback or stale-session recovery during the next load.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Good catch — fixed in the follow-up commit: loadContent() (which retry, version switching, and fallbacks all route through) now cancels the buffering watchdog and clears isBuffering alongside the first-frame watchdog reset, so a stale timer can't fire into the next session.
…n TV nav - Codex PR#44 P2: loadContent/retry/version-switch now cancel the buffering watchdog and clear isBuffering, so a stale 30s timer can't fire a premature fallback into the new session. - Codex PR#44 P1: the product-exposure doc predated the QA request — For You is a deliberate root tab now (tvOS .recommendations parity, requested by the Apple lead in the 2026-07-08 QA); docs updated to match. Co-Authored-By: Claude Fable 5 <[email protected]>
Apple's TVSettingsView rail is exactly General/Playback/Subtitles/ Server; the Library section (Watchlist/Favorites/History/Collections links) is iOS-only, compiled out on tvOS. On TV those destinations already live in the For You dropdown, the profile menu, Home, and the library cascades. Dead nav plumbing stripped through the chain. Co-Authored-By: Claude Fable 5 <[email protected]>
There was a problem hiding this comment.
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)
shared/src/commonMain/kotlin/org/siloserver/silo/network/AuthInterceptorImpl.kt (1)
141-184: 🔒 Security & Privacy | 🟠 Major | ⚡ Quick winAdd the same sign-out guard here.
clearTokens()/signOutCurrentServer()clears the active server slot, so a pinned refresh started before logout can still complete andsaveTokensForScope()the old credentials back to disk. Re-check the pinned scope’s refresh token after the network call and drop the response if sign-out cleared it.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@shared/src/commonMain/kotlin/org/siloserver/silo/network/AuthInterceptorImpl.kt` around lines 141 - 184, The refresh flow in AuthInterceptorImpl’s pinned-scope retry path can write stale credentials back after sign-out because `refreshMutex.withLock` only checks the refresh token before the network call. In the `refreshToken`/`refreshResponse` flow, add the same sign-out guard by re-reading the pinned scope’s refresh token from `tokenManager` immediately after the refresh request succeeds and before `saveTokensForScope()`, and discard the response if `clearTokens()` or `signOutCurrentServer()` has cleared that scope.
🧹 Nitpick comments (4)
androidTvApp/src/androidMain/kotlin/org/siloserver/silo/tv/ui/screens/people/TvPersonDetailViewModel.kt (1)
63-64: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winReplace fully qualified names with imports.
The
initblock uses three fully qualified names inline (org.siloserver.silo.repository.PersonalDataRepository,org.siloserver.silo.network.ApiResult.Success,org.siloserver.silo.model.navigation.isAudiobookLikeLibraryType) which hurts readability. Add imports at the top of the file (or use import aliases if there are naming conflicts).♻️ Proposed refactor: use imports instead of FQNs
// At the top of the file, add: +import org.siloserver.silo.model.navigation.isAudiobookLikeLibraryType +import org.siloserver.silo.network.ApiResult +import org.siloserver.silo.repository.PersonalDataRepository // In the class body: class TvPersonDetailViewModel( private val catalogRepository: CatalogRepository, private val personId: Long, - private val personalDataRepository: org.siloserver.silo.repository.PersonalDataRepository? = null, + private val personalDataRepository: PersonalDataRepository? = null, ) : ViewModel() { init { viewModelScope.launch { val repo = personalDataRepository ?: return@launch val result = repo.listUserLibraries() - if (result !is org.siloserver.silo.network.ApiResult.Success) return@launch + if (result !is ApiResult.Success) return@launch val types = result.data.map { it.type.lowercase() }.toSet() val gated = TvPersonMediaFilters.filter { filter -> when (filter) { TvPersonMediaFilter.Audiobooks -> - types.any { org.siloserver.silo.model.navigation.isAudiobookLikeLibraryType(it) } + types.any { isAudiobookLikeLibraryType(it) } TvPersonMediaFilter.Music -> types.any { it == "music" || it == "audio" } else -> true } } _uiState.update { it.copy(availableFilters = gated) } } }Also applies to: 69-91
🤖 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/people/TvPersonDetailViewModel.kt` around lines 63 - 64, The init block in TvPersonDetailViewModel uses fully qualified names inline, which hurts readability and makes the code harder to scan. Add imports for PersonalDataRepository, ApiResult.Success, and isAudiobookLikeLibraryType at the top of the file (or use aliases if needed), then update the constructor parameter and the init logic to use the imported symbols instead of FQNs. Refer to TvPersonDetailViewModel and its init block when making the cleanup.androidTvApp/src/androidUnitTest/kotlin/org/siloserver/silo/tv/ui/screens/detail/TvPlaybackFormattingTest.kt (1)
60-67: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winAdd test coverage for
versionValueLabeland subtitle Auto-with-default-track.The updated audio and subtitle expectations are correct, but the new
versionValueLabelfunction (4 branches: null/non-null version × null/non-nullselectedVersionFileId) has no tests in this file. Additionally, thesubtitleValueLabelAuto path is only tested with no default track — the case where a default-flagged track exists (producing "Auto - ") is untested.🧪 Suggested test additions
// --- versionValueLabel --- + `@Test` fun versionValueLabel_autoWithNullVersion() { + assertEquals("Auto", TvPlaybackFormatting.versionValueLabel(null, selectedVersionFileId = null)) + } + + `@Test` fun versionValueLabel_autoWithResolvedVersion() { + val v = fileVersion(resolution = "2160p", hdr = true) + assertEquals("Auto - 4K · HDR", TvPlaybackFormatting.versionValueLabel(v, selectedVersionFileId = null)) + } + + `@Test` fun versionValueLabel_manualSelection() { + val v = fileVersion(resolution = "1080p", hdr = false) + assertEquals("1080P", TvPlaybackFormatting.versionValueLabel(v, selectedVersionFileId = 1)) + } + // --- subtitleValueLabel / subtitleOptions --- + `@Test` fun subtitleValueLabel_autoWithDefaultTrack() { + val v = fileVersion(subtitles = listOf(subtitleTrack(index = 0, lang = "eng", default = true))) + assertEquals("Auto - English", TvPlaybackFormatting.subtitleValueLabel(v, selectedSubtitleTrackIndex = null)) + } + `@Test` fun subtitleValueLabel_offForMinusOne() {🤖 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/androidUnitTest/kotlin/org/siloserver/silo/tv/ui/screens/detail/TvPlaybackFormattingTest.kt` around lines 60 - 67, Add missing coverage in TvPlaybackFormattingTest for the new versionValueLabel branches by adding tests for null and non-null version with null and non-null selectedVersionFileId, using the TvPlaybackFormatting.versionValueLabel entry point. Also extend subtitleValueLabel coverage to include the Auto path when a default-flagged subtitle track exists, asserting the resolved “Auto - <title>” behavior via subtitleValueLabel. Keep the new cases alongside the existing audioValueLabel tests so the formatting matrix stays easy to find.androidTvApp/src/androidMain/kotlin/org/siloserver/silo/tv/ui/screens/player/TvPlayerScreen.kt (1)
572-576: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winDuplicated "hide controls on Back while playing" predicate across two handlers.
The same condition (
showControls && !isPaused, plus the modal-state exclusions) is implemented independently in theBackHandler(line 576) and the raw key-dispatch bridge (lines 658-667). Since the bridge consumesKEYCODE_BACKfirst and returnstrue, theBackHandlerbranch is likely dead for TV remote presses under this state, leaving two copies of the same rule that must be kept in sync by hand.Consider extracting the shared predicate into a single
val/function used by both paths to prevent future drift.Also applies to: 652-673
🤖 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/TvPlayerScreen.kt` around lines 572 - 576, The “hide controls on Back while playing” rule is duplicated between the BackHandler branch and the key-dispatch bridge in TvPlayerScreen, which can drift out of sync. Extract the shared `showControls && !isPaused` logic with the modal-state exclusions into one reusable `val` or helper function in `TvPlayerScreen`, then have both the BackHandler and the `KEYCODE_BACK` handling path call that same predicate before deciding whether to hide controls or fall through to exit/leave-room behavior.androidTvApp/src/androidMain/kotlin/org/siloserver/silo/tv/ui/shell/TvShellFocusState.kt (1)
243-254: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winStale KDoc references non-existent
MoveFocusToContentand misdescribes which actions are caller-handled.The KDoc above
onBack(Lines 237–241) says[TvShellBackAction.MoveFocusToContent]and[TvShellBackAction.DelegateToNav]are "left to the composable." ButMoveFocusToContentno longer exists (replaced byMoveFocusToMenu), andMoveFocusToMenuis now handled internally viarequestMenuFocus(). The actions actually left to the composable areMenuBackandDelegateToNav.📝 Proposed KDoc fix
/** * Apply the state half of a shell Back press and report what the caller - * should do for the side-effecting cases ([TvShellBackAction.MoveFocusToContent] - * and [TvShellBackAction.DelegateToNav] are left to the composable, which owns - * the focus manager and nav controller). + * should do for the side-effecting cases ([TvShellBackAction.MenuBack] + * and [TvShellBackAction.DelegateToNav] are left to the composable, which owns + * the focus manager and nav controller). */🤖 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/shell/TvShellFocusState.kt` around lines 243 - 254, Update the KDoc for onBack in TvShellFocusState so it matches the current TvShellBackAction names and behavior: replace the stale MoveFocusToContent reference with MoveFocusToMenu, and revise the description of which actions are left to the composable. The comment should reflect that onBack handles ClosePanel, CloseProfileMenu, and MoveFocusToMenu internally via requestMenuFocus(), while MenuBack and DelegateToNav are the caller-handled actions.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In
`@android-shared/src/androidMain/kotlin/org/siloserver/silo/common/pairing/PairingReceiver.kt`:
- Around line 156-167: `denyPendingServer()` can briefly revert `_status` back
to `ConsentRequested` because it closes `activeTransport` asynchronously,
allowing `handlePushServer` to process a buffered `PairingMessage.PushServer`
first. Add a denial guard on `PairingReceiver` (for example a `denied` flag)
that is set in `denyPendingServer()` before launching the cancel/close work, and
have `handlePushServer` ignore or drop incoming pushes while that flag is set.
Clear the guard when the session fully resets, and keep the existing synchronous
`cancelActiveSession()` behavior as the reference for preventing this race.
In
`@androidApp/src/androidMain/kotlin/org/siloserver/silo/android/ui/screens/player/PlayerViewModel.kt`:
- Around line 1863-1867: Compute the Dolby Vision policy snapshot once in the
PlayerViewModel playback setup flow and reuse that same value for both
capabilityDetector.detect and capabilityDetector.detectPlaybackContext. In the
section that builds capabilities and playbackContext, store
playerSettingsStore.dolbyVisionPolicySnapshot() in a local variable first, then
pass that variable to both calls so they stay consistent; follow the same
single-snapshot pattern already used by MobileVideoPlaybackStarter.start().
In
`@androidTvApp/src/androidMain/kotlin/org/siloserver/silo/tv/ui/screens/library/TvLibraryDetailScreen.kt`:
- Line 695: The genre chips in TvLibraryDetailScreen are keyed directly by the
raw genres list, so duplicate genre strings can produce repeated LazyRow item
keys and crash. Update the rendering path around the items(genres, key = { it })
block to either deduplicate the genres before composing or switch to a stable
per-item key that stays unique even when the same genre appears multiple times.
Keep the fix localized to TvLibraryDetailScreen and the genre list handling used
by the TV view models.
In
`@shared/src/commonTest/kotlin/org/siloserver/silo/network/SiloAuthPluginRefreshFailureTest.kt`:
- Around line 55-90: Add a MediaAuthInterceptor test that mirrors the existing
sign-out-during-refresh race covered in SiloAuthPluginRefreshFailureTest. In
MediaAuthInterceptorTest, create a scenario where the refresh request is in
flight, call tokenManager.clearTokens() before the refresh response returns, and
verify the successful refresh response does not repersist access or refresh
tokens. Use the existing MediaAuthInterceptor.attemptRefresh path and the same
token manager/session assertions already used by the other refresh tests.
---
Outside diff comments:
In
`@shared/src/commonMain/kotlin/org/siloserver/silo/network/AuthInterceptorImpl.kt`:
- Around line 141-184: The refresh flow in AuthInterceptorImpl’s pinned-scope
retry path can write stale credentials back after sign-out because
`refreshMutex.withLock` only checks the refresh token before the network call.
In the `refreshToken`/`refreshResponse` flow, add the same sign-out guard by
re-reading the pinned scope’s refresh token from `tokenManager` immediately
after the refresh request succeeds and before `saveTokensForScope()`, and
discard the response if `clearTokens()` or `signOutCurrentServer()` has cleared
that scope.
---
Nitpick comments:
In
`@androidTvApp/src/androidMain/kotlin/org/siloserver/silo/tv/ui/screens/people/TvPersonDetailViewModel.kt`:
- Around line 63-64: The init block in TvPersonDetailViewModel uses fully
qualified names inline, which hurts readability and makes the code harder to
scan. Add imports for PersonalDataRepository, ApiResult.Success, and
isAudiobookLikeLibraryType at the top of the file (or use aliases if needed),
then update the constructor parameter and the init logic to use the imported
symbols instead of FQNs. Refer to TvPersonDetailViewModel and its init block
when making the cleanup.
In
`@androidTvApp/src/androidMain/kotlin/org/siloserver/silo/tv/ui/screens/player/TvPlayerScreen.kt`:
- Around line 572-576: The “hide controls on Back while playing” rule is
duplicated between the BackHandler branch and the key-dispatch bridge in
TvPlayerScreen, which can drift out of sync. Extract the shared `showControls &&
!isPaused` logic with the modal-state exclusions into one reusable `val` or
helper function in `TvPlayerScreen`, then have both the BackHandler and the
`KEYCODE_BACK` handling path call that same predicate before deciding whether to
hide controls or fall through to exit/leave-room behavior.
In
`@androidTvApp/src/androidMain/kotlin/org/siloserver/silo/tv/ui/shell/TvShellFocusState.kt`:
- Around line 243-254: Update the KDoc for onBack in TvShellFocusState so it
matches the current TvShellBackAction names and behavior: replace the stale
MoveFocusToContent reference with MoveFocusToMenu, and revise the description of
which actions are left to the composable. The comment should reflect that onBack
handles ClosePanel, CloseProfileMenu, and MoveFocusToMenu internally via
requestMenuFocus(), while MenuBack and DelegateToNav are the caller-handled
actions.
In
`@androidTvApp/src/androidUnitTest/kotlin/org/siloserver/silo/tv/ui/screens/detail/TvPlaybackFormattingTest.kt`:
- Around line 60-67: Add missing coverage in TvPlaybackFormattingTest for the
new versionValueLabel branches by adding tests for null and non-null version
with null and non-null selectedVersionFileId, using the
TvPlaybackFormatting.versionValueLabel entry point. Also extend
subtitleValueLabel coverage to include the Auto path when a default-flagged
subtitle track exists, asserting the resolved “Auto - <title>” behavior via
subtitleValueLabel. Keep the new cases alongside the existing audioValueLabel
tests so the formatting matrix stays easy to find.
🪄 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: 0dd8ab6c-ddf0-4b54-9188-7c4ebe0d696b
⛔ Files ignored due to path filters (1)
android-shared/src/androidMain/res/raw/startup_splash.mp4is excluded by!**/*.mp4
📒 Files selected for processing (63)
android-shared/src/androidMain/kotlin/org/siloserver/silo/common/pairing/PairingReceiver.ktandroid-shared/src/androidMain/kotlin/org/siloserver/silo/common/player/MediaAuthInterceptor.ktandroid-shared/src/androidMain/kotlin/org/siloserver/silo/common/player/PlaybackCapabilityDetector.ktandroid-shared/src/androidMain/kotlin/org/siloserver/silo/common/player/mpv/MpvSubtitleStyle.ktandroid-shared/src/androidMain/kotlin/org/siloserver/silo/common/player/video/VideoPlaybackSessionCoordinator.ktandroid-shared/src/androidMain/kotlin/org/siloserver/silo/common/player/video/VideoPlaybackStartResult.ktandroid-shared/src/androidMain/kotlin/org/siloserver/silo/common/player/video/VideoPlayerUiState.ktandroid-shared/src/androidMain/kotlin/org/siloserver/silo/common/settings/AndroidPlayerSettingsStore.ktandroid-shared/src/androidMain/kotlin/org/siloserver/silo/common/settings/PlayerSettingsStore.ktandroid-shared/src/androidMain/kotlin/org/siloserver/silo/common/ui/components/StartupSplashVideo.ktandroid-shared/src/androidUnitTest/kotlin/org/siloserver/silo/common/pairing/PairingReceiverTest.ktandroid-shared/src/androidUnitTest/kotlin/org/siloserver/silo/common/player/mpv/MpvSubtitleStyleTest.ktandroid-shared/src/androidUnitTest/kotlin/org/siloserver/silo/common/settings/ServerDrivenConfigRefresherTest.ktandroidApp/src/androidMain/kotlin/org/siloserver/silo/android/MainActivity.ktandroidApp/src/androidMain/kotlin/org/siloserver/silo/android/ui/screens/player/MobileVideoPlaybackStarter.ktandroidApp/src/androidMain/kotlin/org/siloserver/silo/android/ui/screens/player/PlayerOverlay.ktandroidApp/src/androidMain/kotlin/org/siloserver/silo/android/ui/screens/player/PlayerSettingsSheet.ktandroidApp/src/androidMain/kotlin/org/siloserver/silo/android/ui/screens/player/PlayerViewModel.ktandroidTvApp/src/androidMain/kotlin/org/siloserver/silo/tv/MainTvActivity.ktandroidTvApp/src/androidMain/kotlin/org/siloserver/silo/tv/di/AndroidTvModule.ktandroidTvApp/src/androidMain/kotlin/org/siloserver/silo/tv/ui/components/TvCascadeSelector.ktandroidTvApp/src/androidMain/kotlin/org/siloserver/silo/tv/ui/navigation/TvAppNavigation.ktandroidTvApp/src/androidMain/kotlin/org/siloserver/silo/tv/ui/screens/auth/TvServerSetupScreen.ktandroidTvApp/src/androidMain/kotlin/org/siloserver/silo/tv/ui/screens/calendar/TvCalendarScreen.ktandroidTvApp/src/androidMain/kotlin/org/siloserver/silo/tv/ui/screens/detail/TvCastCrewSection.ktandroidTvApp/src/androidMain/kotlin/org/siloserver/silo/tv/ui/screens/detail/TvDetailSectionHeader.ktandroidTvApp/src/androidMain/kotlin/org/siloserver/silo/tv/ui/screens/detail/TvItemDetailScreen.ktandroidTvApp/src/androidMain/kotlin/org/siloserver/silo/tv/ui/screens/detail/TvItemDetailViewModel.ktandroidTvApp/src/androidMain/kotlin/org/siloserver/silo/tv/ui/screens/detail/TvPlaybackFormatting.ktandroidTvApp/src/androidMain/kotlin/org/siloserver/silo/tv/ui/screens/detail/TvPlaybackSelectorRow.ktandroidTvApp/src/androidMain/kotlin/org/siloserver/silo/tv/ui/screens/library/TvLibraryDetailScreen.ktandroidTvApp/src/androidMain/kotlin/org/siloserver/silo/tv/ui/screens/people/TvPersonDetailScreen.ktandroidTvApp/src/androidMain/kotlin/org/siloserver/silo/tv/ui/screens/people/TvPersonDetailViewModel.ktandroidTvApp/src/androidMain/kotlin/org/siloserver/silo/tv/ui/screens/personal/TvPersonalScreens.ktandroidTvApp/src/androidMain/kotlin/org/siloserver/silo/tv/ui/screens/player/TvPlayerHud.ktandroidTvApp/src/androidMain/kotlin/org/siloserver/silo/tv/ui/screens/player/TvPlayerRemoteKeyAction.ktandroidTvApp/src/androidMain/kotlin/org/siloserver/silo/tv/ui/screens/player/TvPlayerScreen.ktandroidTvApp/src/androidMain/kotlin/org/siloserver/silo/tv/ui/screens/player/TvPlayerViewModel.ktandroidTvApp/src/androidMain/kotlin/org/siloserver/silo/tv/ui/screens/player/TvVideoPlaybackStarter.ktandroidTvApp/src/androidMain/kotlin/org/siloserver/silo/tv/ui/screens/settings/TvSettingsScreen.ktandroidTvApp/src/androidMain/kotlin/org/siloserver/silo/tv/ui/screens/settings/TvSettingsViewModel.ktandroidTvApp/src/androidMain/kotlin/org/siloserver/silo/tv/ui/shell/TvMainShell.ktandroidTvApp/src/androidMain/kotlin/org/siloserver/silo/tv/ui/shell/TvMediaDestinations.ktandroidTvApp/src/androidMain/kotlin/org/siloserver/silo/tv/ui/shell/TvRootDestination.ktandroidTvApp/src/androidMain/kotlin/org/siloserver/silo/tv/ui/shell/TvShellFocusState.ktandroidTvApp/src/androidMain/kotlin/org/siloserver/silo/tv/ui/shell/TvTopMenuBar.ktandroidTvApp/src/androidMain/res/layout/tv_player_view.xmlandroidTvApp/src/androidUnitTest/kotlin/org/siloserver/silo/tv/data/preferences/LegacyTvPrefsMigrationTest.ktandroidTvApp/src/androidUnitTest/kotlin/org/siloserver/silo/tv/ui/TvUsabilityGuardTest.ktandroidTvApp/src/androidUnitTest/kotlin/org/siloserver/silo/tv/ui/screens/auth/TvAuthFocusSourceTest.ktandroidTvApp/src/androidUnitTest/kotlin/org/siloserver/silo/tv/ui/screens/calendar/TvCalendarSizingSourceTest.ktandroidTvApp/src/androidUnitTest/kotlin/org/siloserver/silo/tv/ui/screens/detail/TvPlaybackFormattingTest.ktandroidTvApp/src/androidUnitTest/kotlin/org/siloserver/silo/tv/ui/screens/people/TvPersonDetailSourceTest.ktandroidTvApp/src/androidUnitTest/kotlin/org/siloserver/silo/tv/ui/screens/player/TvPlayerControlsUsabilityTest.ktandroidTvApp/src/androidUnitTest/kotlin/org/siloserver/silo/tv/ui/screens/player/TvPlayerRemoteKeyActionTest.ktandroidTvApp/src/androidUnitTest/kotlin/org/siloserver/silo/tv/ui/shell/TvMediaDestinationsTest.ktandroidTvApp/src/androidUnitTest/kotlin/org/siloserver/silo/tv/ui/shell/TvShellFocusSourceTest.ktandroidTvApp/src/androidUnitTest/kotlin/org/siloserver/silo/tv/ui/shell/TvShellFocusStateTest.ktshared/src/commonMain/kotlin/org/siloserver/silo/model/settings/PlaybackSettingsKeys.ktshared/src/commonMain/kotlin/org/siloserver/silo/network/AuthInterceptorImpl.ktshared/src/commonMain/kotlin/org/siloserver/silo/player/DolbyVisionPolicy.ktshared/src/commonTest/kotlin/org/siloserver/silo/network/SiloAuthPluginRefreshFailureTest.ktshared/src/commonTest/kotlin/org/siloserver/silo/player/DolbyVisionPolicyTest.kt
Settings parity (tvOS is authoritative): - Playback > Streaming gains the Dolby Vision toggle (was HUD-only) and the Profile 7 HDR10 Fallback toggle (store existed since PR#38 with no UI anywhere); P7 nests under DV and only shows while DV is on, as on Apple TV. - General > Top Menu gains Show Audiobooks (tvOS navPrefs parity): the Audiobooks tab is now OPT-IN, hidden by default, stored device+profile locally in TvLibraryScopeStore. - Subtitles > Appearance gains Match Device Settings: playback styling follows the OS captioning preferences (CaptioningManager mapped onto SubtitleAppearance) via a new effectiveSubtitleAppearanceFlow; the stored custom appearance stays untouched underneath. Local-only flag. (Apple's Seek Cache toggle is N/A — loopback-engine specific.) CodeRabbit PR#44 (4/4): - Pairing deny no longer lets a buffered PushServer re-open the consent prompt mid-teardown. - Phone selectVersion computes the DolbyVision snapshot once. - Genre chips dedupe before keying (duplicate server genres crashed the LazyRow). - MediaAuthInterceptor gains the sign-out-during-refresh race test mirroring the SiloAuthPlugin one. Co-Authored-By: Claude Fable 5 <[email protected]>
Clears the full 2026-07-08 QA feedback from on-device testing (Shield, Streamer, Fire TV) plus follow-up parity work. Apple (silo-apple) treated as authoritative throughout. 28 commits, grouped below.
Sign-in / pairing
clearTokens(logout revokes the access token server-side, so concurrent requests 401 exactly then). Both interceptors now drop refresh responses when the refresh token was cleared mid-flight; pinned by a newSiloAuthPlugintest.st=setup— Apple's companion card filters tostate == .setupand its own advertiser hardcodes it; our registry-derivedloginstate made the TV invisible exactly when setup was needed.Cancel(consent_denied).min(25% width, 440pt)→ 220dp; phone 60%/320dp) on pure black — full-bleed rendering had the logo ~4× oversized, and off-black surfaces boxed the video.Shell / navigation (QA back-stack model)
.recommendationsorder) with Watchlist/Favorites dropdown; opens only on explicit d-pad-down/OK — dwell-preview let a focus transient during cascade commits trap users in the dropdown.CalendarEventCardportrait cells at reduced scale, day-snap owns vertical scrolling exclusively (no orphaned caption strips / fold clipping), meaningless midnight air-times hidden.Detail / series / person pages
TVSectionHeader(single-line titles; eyebrow only where it adds context)./recommendations/similarand hides when the server has recommendations disabled (the old genre browse produced alphabetical non-suggestions); never shown on episodes.Player
player.dolby_vision_enabled, default ON): off advertises no DV profiles (except 5, which has no watchable base layer) and drops the DV MIME preference — plays base-layer HDR10. SharedDolbyVisionPolicyport with tests; precedence over the P7 fallback toggle matches Apple.keepScreenOnon the player view (Fire OS screensaver engaged mid-playback despite the window flag).Testing
./gradlew testgreen across all modules (new tests: DolbyVisionPolicy, pairing consent, sign-out race; updated source-guard pins).🤖 Generated with Claude Code
Summary by CodeRabbit
New Features
Bug Fixes