Repository navigation
fix(tv): keep the skyline rail animations after entering detail - #260
Conversation
returnRestoreRequest is bumped when a restore ladder starts and never reset for the feed's lifetime, while detailReturnPending is re-armed by every focus move. After the first detail round trip, every later focus move therefore re-fired TvMediaRow's restore effect and its instant scrollToItem, which cancels the rail pin's animated glide — the carousel snapped instead of scrolling until the feed was disposed again. Pass the restore request only while a ladder is actually in flight (restorationsInFlight > 0): the instant row scroll exists solely to compose a ladder's destination into the horizontal window. Also log restore scrolls through TvFocusLog so a regression is visible in logcat instead of only on screen.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review. 📝 WalkthroughWalkthroughThe TV focus restoration flow now gates row restore requests while restoration is active. ChangesTV focus restoration
Estimated code review effort: 2 (Simple) | ~10 minutes Merge Risk: ⚪ Minimal · up to The change limits row restoration to active return flows so focus animations continue after visiting detail pages; no actionable merge-blocking risk remains after normal checks and review. Suggested reviewers: 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
|
@CodeRabbit review |
|
|
@CodeRabbit review |
✅ Action performedReview finished.
|
#257) * feat(android): server-driven card presentation presets on phone and TV Adds the "Cards & Posters" preference to both Android clients, porting the iOS/tvOS feature built on the canonical `ui.card_presentation` setting. The value is the contract's whole two-field object -- `poster_size` (compact/standard/large) and `caption` (title_metadata/title/artwork) -- surfaced as the same four presets Apple and the web UI offer (Balanced, Compact, Cinema, Artwork Only) plus per-axis pickers, with a synthetic "Custom" entry when the pair matches no preset. Per-device preferences: writes land at `profile_client` by default so a choice roams between like devices (Android TV joins the `tv` family, phone `mobile`, tablet `tablet` via a new X-Silo-Client-Family header), and an "Only this device" toggle writes at `profile_device` instead, which the server resolves ahead of the family and profile layers. Turning it off deletes that row so resolution falls back. Rendering follows Apple's semantics: rails and standalone cards scale 0.86/1.0/1.2, fixed grids shift a column either way, adaptive grids scale their min cell width, and the caption axis gates the title and metadata lines. The TV Skyline row band height is now derived from the scaled card height and caption rows rather than a fixed 0.50 fraction, so large cards have room without clipping the marquee -- reproducing today's band exactly at the standard preset. State lives in a new CardPresentationStore (android-shared), capability- gated on the settings contract, cached per server/profile/family/device for a jump-free cold start, with optimistic writes, latest-wins coalescing, and rollback on failure. It refreshes on foreground and reconnect alongside the existing overlay prefs, and clears on sign-out and on profile/server switch. Closes #163. Co-Authored-By: Claude Fable 5 <[email protected]> * feat(diagnostics): expand Android client evidence (#261) * fix(playback): advertise native Media3 HLS (#262) * fix(tv): prefer native mounted transport for quick skips instead of re-anchoring + map seek input + fix second press for seek (#259) * fix(tv): prefer the mounted transport for quick skips instead of re-anchoring Server plans for growing-HLS transcodes and copy-remux transports publish an open-ended seek window with can_seek_anywhere=false, so every quick skip went through a protocol-V3 seek_reanchor: buffering UI, an API round trip, and a full restream, even when the target sat inside content the player already had mounted. decideSeek now accepts an optional mountedSeekableSourceRange: the source-time extent the currently mounted transport provably covers. The TV screen reports the Media3 window's seekability and extent alongside its existing position poll, and a target inside that range is a plain Player.seekTo. Targets the mounted transport cannot serve (before the stream origin, past the produced manifest head, or a growing progressive copy remux with no known length) still reanchor, and the existing same-route reanchor recovery remains the fallback for native seeks that fail with 404/410/416. * fix(tv): route media rewind and fast-forward keys through the player bridge The remote's rewind/fast-forward keys (plus SKIP_BACKWARD/SKIP_FORWARD) were unmapped, so the player bridge's null-action branch only revealed the transport controls and swallowed the first press - users had to press twice to seek - and the second press fell through to Media3's session-level seekBack/seekForward, bypassing the app's route-aware seek path and the Watch Together room transport gate. Map them to SkipBack/SkipForward like D-pad left/right. They ignore dpadHorizontalSeek because they are never focus navigation, and UP halves and auto-repeats are consumed so the system media-key fallback cannot seek a second time. * fix(tv): invalidate mounted-window seek facts when the transport is replaced The mounted-window facts feeding decideSeek's mountedSeekableSourceRange hint describe one Media3 item, but they were neither suppressed during a transport handoff nor cleared when a mount won. After a reanchor/replan/content switch, the previous transport's window end mapped through the new plan's timelineOffsetSeconds overstates the new transport's extent, and a quick skip inside that window could take a native path that clamps to the new item's short window - a silent, wrong-position seek with no error and no self-heal. The sharpest instance: onTransportMountApplied re-evaluates pendingNativeSeekAfterMount at exactly that moment of maximal staleness. Drop onPlayerWindowChanged reports while transportMountGate is suppressing (the same guard onPositionChanged applies), and clear both facts at the top of the applied(nonce) branch before the queued-seek re-evaluation. The next poll tick (<=500ms) repopulates from the mounted item; until then the hint is absent, which at worst costs an unnecessary reanchor. * docs(tv): document the seek-hint and media-key contracts KDoc for tvPlayerRemoteKeyAction (the full key-to-action mapping incl. why unmapped keys only reveal controls) and executeSeekTarget (the seek-commit routing ladder), plus one-line contracts on the new test functions. Addresses CodeRabbit's docstring-coverage pre-merge check on PR #259. --------- Co-authored-by: Quick <[email protected]> * fix(tv): keep the skyline rail gliding after a detail round trip (#260) returnRestoreRequest is bumped when a restore ladder starts and never reset for the feed's lifetime, while detailReturnPending is re-armed by every focus move. After the first detail round trip, every later focus move therefore re-fired TvMediaRow's restore effect and its instant scrollToItem, which cancels the rail pin's animated glide — the carousel snapped instead of scrolling until the feed was disposed again. Pass the restore request only while a ladder is actually in flight (restorationsInFlight > 0): the instant row scroll exists solely to compose a ladder's destination into the horizontal window. Also log restore scrolls through TvFocusLog so a regression is visible in logcat instead of only on screen. --------- Co-authored-by: Claude Fable 5 <[email protected]> Co-authored-by: blurbery <[email protected]> Co-authored-by: evulhotdog <[email protected]>
* feat: improve SiloCast remote controls * refactor(android): unify image loading on shared OkHttp and defer artwork presentation during scroll (#256) - Replace coil-network-ktor3 with coil-network-okhttp and register the fetcher explicitly: new SiloOkHttp foundation shares one ConnectionPool between the Ktor API clients and Coil, with per-client tuned dispatchers so image bursts and API fan-outs never queue behind each other. Loader config is unified in buildSiloImageLoader so phone and TV cannot drift. - Extend Home's existing artwork-presentation deferral to all artwork scroll surfaces via DeferImagePresentationWhileScrolling: freshly decoded images hold their thumbhash until the scroll settles (memory-cache hits still present instantly), now covering horizontal rows, grids, detail feeds, and vertical-scroll columns. - Fix stale-capture load-more triggers in CatalogGrid and SearchResults: keyless remember { derivedStateOf } froze first-composition hasMore/isLoading values, breaking pagination in some entry states. - Declare ktor-client-core explicitly in android-shared/androidApp (it was only reaching the compile classpath transitively via the old Coil artifact); regenerate dependency locks and verification metadata and drop stale TV lock pins. Co-authored-by: Claude Fable 5 <[email protected]> * feat(diagnostics): expand Android client evidence (#261) * fix(playback): advertise native Media3 HLS (#262) * fix(tv): prefer native mounted transport for quick skips instead of re-anchoring + map seek input + fix second press for seek (#259) * fix(tv): prefer the mounted transport for quick skips instead of re-anchoring Server plans for growing-HLS transcodes and copy-remux transports publish an open-ended seek window with can_seek_anywhere=false, so every quick skip went through a protocol-V3 seek_reanchor: buffering UI, an API round trip, and a full restream, even when the target sat inside content the player already had mounted. decideSeek now accepts an optional mountedSeekableSourceRange: the source-time extent the currently mounted transport provably covers. The TV screen reports the Media3 window's seekability and extent alongside its existing position poll, and a target inside that range is a plain Player.seekTo. Targets the mounted transport cannot serve (before the stream origin, past the produced manifest head, or a growing progressive copy remux with no known length) still reanchor, and the existing same-route reanchor recovery remains the fallback for native seeks that fail with 404/410/416. * fix(tv): route media rewind and fast-forward keys through the player bridge The remote's rewind/fast-forward keys (plus SKIP_BACKWARD/SKIP_FORWARD) were unmapped, so the player bridge's null-action branch only revealed the transport controls and swallowed the first press - users had to press twice to seek - and the second press fell through to Media3's session-level seekBack/seekForward, bypassing the app's route-aware seek path and the Watch Together room transport gate. Map them to SkipBack/SkipForward like D-pad left/right. They ignore dpadHorizontalSeek because they are never focus navigation, and UP halves and auto-repeats are consumed so the system media-key fallback cannot seek a second time. * fix(tv): invalidate mounted-window seek facts when the transport is replaced The mounted-window facts feeding decideSeek's mountedSeekableSourceRange hint describe one Media3 item, but they were neither suppressed during a transport handoff nor cleared when a mount won. After a reanchor/replan/content switch, the previous transport's window end mapped through the new plan's timelineOffsetSeconds overstates the new transport's extent, and a quick skip inside that window could take a native path that clamps to the new item's short window - a silent, wrong-position seek with no error and no self-heal. The sharpest instance: onTransportMountApplied re-evaluates pendingNativeSeekAfterMount at exactly that moment of maximal staleness. Drop onPlayerWindowChanged reports while transportMountGate is suppressing (the same guard onPositionChanged applies), and clear both facts at the top of the applied(nonce) branch before the queued-seek re-evaluation. The next poll tick (<=500ms) repopulates from the mounted item; until then the hint is absent, which at worst costs an unnecessary reanchor. * docs(tv): document the seek-hint and media-key contracts KDoc for tvPlayerRemoteKeyAction (the full key-to-action mapping incl. why unmapped keys only reveal controls) and executeSeekTarget (the seek-commit routing ladder), plus one-line contracts on the new test functions. Addresses CodeRabbit's docstring-coverage pre-merge check on PR #259. --------- Co-authored-by: Quick <[email protected]> * fix(tv): keep the skyline rail gliding after a detail round trip (#260) returnRestoreRequest is bumped when a restore ladder starts and never reset for the feed's lifetime, while detailReturnPending is re-armed by every focus move. After the first detail round trip, every later focus move therefore re-fired TvMediaRow's restore effect and its instant scrollToItem, which cancels the rail pin's animated glide — the carousel snapped instead of scrolling until the feed was disposed again. Pass the restore request only while a ladder is actually in flight (restorationsInFlight > 0): the instant row scroll exists solely to compose a ladder's destination into the horizontal window. Also log restore scrolls through TvFocusLog so a regression is visible in logcat instead of only on screen. * feat(android): server-driven card presentation presets on phone and TV (#257) * feat(android): server-driven card presentation presets on phone and TV Adds the "Cards & Posters" preference to both Android clients, porting the iOS/tvOS feature built on the canonical `ui.card_presentation` setting. The value is the contract's whole two-field object -- `poster_size` (compact/standard/large) and `caption` (title_metadata/title/artwork) -- surfaced as the same four presets Apple and the web UI offer (Balanced, Compact, Cinema, Artwork Only) plus per-axis pickers, with a synthetic "Custom" entry when the pair matches no preset. Per-device preferences: writes land at `profile_client` by default so a choice roams between like devices (Android TV joins the `tv` family, phone `mobile`, tablet `tablet` via a new X-Silo-Client-Family header), and an "Only this device" toggle writes at `profile_device` instead, which the server resolves ahead of the family and profile layers. Turning it off deletes that row so resolution falls back. Rendering follows Apple's semantics: rails and standalone cards scale 0.86/1.0/1.2, fixed grids shift a column either way, adaptive grids scale their min cell width, and the caption axis gates the title and metadata lines. The TV Skyline row band height is now derived from the scaled card height and caption rows rather than a fixed 0.50 fraction, so large cards have room without clipping the marquee -- reproducing today's band exactly at the standard preset. State lives in a new CardPresentationStore (android-shared), capability- gated on the settings contract, cached per server/profile/family/device for a jump-free cold start, with optimistic writes, latest-wins coalescing, and rollback on failure. It refreshes on foreground and reconnect alongside the existing overlay prefs, and clears on sign-out and on profile/server switch. Closes #163. Co-Authored-By: Claude Fable 5 <[email protected]> * feat(diagnostics): expand Android client evidence (#261) * fix(playback): advertise native Media3 HLS (#262) * fix(tv): prefer native mounted transport for quick skips instead of re-anchoring + map seek input + fix second press for seek (#259) * fix(tv): prefer the mounted transport for quick skips instead of re-anchoring Server plans for growing-HLS transcodes and copy-remux transports publish an open-ended seek window with can_seek_anywhere=false, so every quick skip went through a protocol-V3 seek_reanchor: buffering UI, an API round trip, and a full restream, even when the target sat inside content the player already had mounted. decideSeek now accepts an optional mountedSeekableSourceRange: the source-time extent the currently mounted transport provably covers. The TV screen reports the Media3 window's seekability and extent alongside its existing position poll, and a target inside that range is a plain Player.seekTo. Targets the mounted transport cannot serve (before the stream origin, past the produced manifest head, or a growing progressive copy remux with no known length) still reanchor, and the existing same-route reanchor recovery remains the fallback for native seeks that fail with 404/410/416. * fix(tv): route media rewind and fast-forward keys through the player bridge The remote's rewind/fast-forward keys (plus SKIP_BACKWARD/SKIP_FORWARD) were unmapped, so the player bridge's null-action branch only revealed the transport controls and swallowed the first press - users had to press twice to seek - and the second press fell through to Media3's session-level seekBack/seekForward, bypassing the app's route-aware seek path and the Watch Together room transport gate. Map them to SkipBack/SkipForward like D-pad left/right. They ignore dpadHorizontalSeek because they are never focus navigation, and UP halves and auto-repeats are consumed so the system media-key fallback cannot seek a second time. * fix(tv): invalidate mounted-window seek facts when the transport is replaced The mounted-window facts feeding decideSeek's mountedSeekableSourceRange hint describe one Media3 item, but they were neither suppressed during a transport handoff nor cleared when a mount won. After a reanchor/replan/content switch, the previous transport's window end mapped through the new plan's timelineOffsetSeconds overstates the new transport's extent, and a quick skip inside that window could take a native path that clamps to the new item's short window - a silent, wrong-position seek with no error and no self-heal. The sharpest instance: onTransportMountApplied re-evaluates pendingNativeSeekAfterMount at exactly that moment of maximal staleness. Drop onPlayerWindowChanged reports while transportMountGate is suppressing (the same guard onPositionChanged applies), and clear both facts at the top of the applied(nonce) branch before the queued-seek re-evaluation. The next poll tick (<=500ms) repopulates from the mounted item; until then the hint is absent, which at worst costs an unnecessary reanchor. * docs(tv): document the seek-hint and media-key contracts KDoc for tvPlayerRemoteKeyAction (the full key-to-action mapping incl. why unmapped keys only reveal controls) and executeSeekTarget (the seek-commit routing ladder), plus one-line contracts on the new test functions. Addresses CodeRabbit's docstring-coverage pre-merge check on PR #259. --------- Co-authored-by: Quick <[email protected]> * fix(tv): keep the skyline rail gliding after a detail round trip (#260) returnRestoreRequest is bumped when a restore ladder starts and never reset for the feed's lifetime, while detailReturnPending is re-armed by every focus move. After the first detail round trip, every later focus move therefore re-fired TvMediaRow's restore effect and its instant scrollToItem, which cancels the rail pin's animated glide — the carousel snapped instead of scrolling until the feed was disposed again. Pass the restore request only while a ladder is actually in flight (restorationsInFlight > 0): the instant row scroll exists solely to compose a ladder's destination into the horizontal window. Also log restore scrolls through TvFocusLog so a regression is visible in logcat instead of only on screen. --------- Co-authored-by: Claude Fable 5 <[email protected]> Co-authored-by: blurbery <[email protected]> Co-authored-by: evulhotdog <[email protected]> * fix: address SiloCast review findings * fix: reconcile mute state for volume changes --------- Co-authored-by: Claude Fable 5 <[email protected]> Co-authored-by: blurbery <[email protected]> Co-authored-by: evulhotdog <[email protected]>
Problem
HomeandFor Yourender their card rows throughTvSkylineSectionFeed→TvMediaRow. A focused card pins itself with a 480 ms animated glide (tvRailPinOnFocus→tvRailPinItem) — the only horizontal scroll a focus change triggers; the row's automatic bring-into-view is deliberately zeroed byTvRailScrollBehaviorto keep one motion per press.On first launch, moving between cards in Continue Watching glides as designed. After opening any item from a row into the detail page and backing out, every later left/right press in any row snaps instantly — the glide is gone for the rest of the Home session. It returns only after the feed is disposed again (e.g. a tab switch) and dies on the next detail round trip. For You is affected identically (same component).
Approach
Three facts combined:
TvSkylineSectionFeed.returnRestoreRequestis a plain-remembercounter bumped when a return-restore ladder starts, never reset for the feed's lifetime.≥ 1.onItemFocuseddeliberately re-armsdetailReturnPending = trueon every focus move (the browse-re-arm contract), so the focused row keeps qualifying as the return row.With the request passed ungated, every post-return focus move re-fired
TvMediaRow's restoreLaunchedEffect(keyed on the resolved index/contentId, which change per move) and ran an instantrowState.scrollToItem(...). A default-priority jump wins theLazyListStatemutator mutex and cancels the runninganimateScrollBy, so the pin never animates.The fix narrows one argument: pass
returnRestoreRequestonly while a ladder is actually in flight (restorationsInFlight > 0) — the only situation the instant row scroll exists for, composing a ladder's destination card into the horizontal window before focus is requested on it. After the ladder ends, ordinary rendering never moves the row, which is the contractTvMediaRowalready documents on that parameter.Alternatives considered: resetting the counter at ladder end reads the same from the row but adds a second mutation point while the parameter would still mean "pending" and behave "idle"; the in-flight gate keeps the counter's single-writer semantics.
restoreFocusRequesterattachment deliberately stays pending-gated — the shell's content restorer uses that nodeas its enter fallback through the whole round trip.
Also added a
TvFocusLogline inTvMediaRowwhen a restore scroll fires. This failure class is invisible on screen (it reads as "animations gone"); the log makes the signaturerequest > 0outside a ladder, per-move lines after a round trip — observable viaadb logcat -s SiloTvFocus.Validation
./gradlew :androidTvApp:assembleDebug(JDK 21 + Android SDK via the repo nix env) → exit 0, APKs emitted../gradlew :androidTvApp:testDebugUnitTest --tests "org.siloserver.silo.tv.ui.components.TvMediaRowFocusRestoreTest"→ exit 0. The scroll executorprepareTvMediaRowFocusRestoreis unchanged; its existing tests still pass.change; on the fixed build the glide survives the round trip (confirmed on hardware).
adb logcat -s SiloTvFocuson the fixed build across several detail round trips plus ordinary browsing — restore scrolls only at return moments, none during focus moves:Summary by CodeRabbit