Skip to content

fix(tv): prefer native mounted transport for quick skips instead of re-anchoring + map seek input + fix second press for seek - #259

Merged
Quick104 merged 5 commits into
Silo-Server:mainfrom
evulhotdog:fix/tv-seek-native-first
Aug 30, 2026
Merged

Quick104 merged 5 commits into
Silo-Server:mainfrom
evulhotdog:fix/tv-seek-native-first

Conversation

@evulhotdog

@evulhotdog evulhotdog commented Aug 29, 2026 •

Copy link
Copy Markdown
Contributor

Problem

Android TV: pressing D-pad left/right during playback shows the
buffering spinner and forces a server round trip that restreams the content,
while the remote's rewind/fast-forward buttons jump instantly using locally
mounted content.

TL;DR and what you'll notice as a user:

  • D-pad left/right skips are instant. Within the content the player already has, skips no longer show the buffer screen or hit the server — they're plain local seeks (usually measured @ ~0.1–0.5 s).
    Previously every skip re-requested the stream from the server.
  • The rewind/fast-forward buttons work on the first press. Previously the first press just pulled up the controls and you had to press again.
  • Those buttons now skip the same amounts as the on-screen buttons (−10 s / +30 s) instead of Media3's ±5/±15 s defaults.
  • In Watch Together rooms, the rewind/FF buttons no longer desync the room and they now respect the same gating as everything else.

Two cooperating causes:

  1. For growing-HLS transcodes and copy-remux transports, the server publishes
    an open-ended seek window with can_seek_anywhere=false (it cannot keep the
    produced head current, and web clients would 404 past it — see the growing-
    manifest branch and configureCopyRemuxTimelineV3 in playback_v3.go).
    The client's decideSeek therefore returned ServerReanchor for every
    seek on those transports: buffering UI, a protocol-V3 seek_reanchor round
    trip, and a remount — even when the target sat inside content the player
    already had mounted.
  2. KEYCODE_MEDIA_REWIND / KEYCODE_MEDIA_FAST_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 route-aware seek path and the Watch Together
    room transport gate.

Approach

Three commits; the second and third are separable if you prefer them
standalone.

  1. 33feccdf — decideSeek gains an optional mountedSeekableSourceRange:
    the source-time extent the currently mounted transport provably covers.
    The TV screen reports the Media3 window's seekability and length alongside
    its existing 500 ms position poll; a target inside that range is a plain
    Player.seekTo. The hint is only claimed when the window is seekable with
    a known length, which covers append-only HLS manifests (window end =
    produced head), completed transcodes, and indexed streams; a growing
    progressive copy remux has no known length and stays excluded. Targets the
    mounted transport cannot serve — before the stream origin, past the
    produced head — still reanchor, and the existing same-route reanchor
    recovery (404/410/416) remains the fallback for native seeks that fail.
    The parameter is optional, so the audiobook and Cast call sites are
    unchanged.
  2. dc234833 — map REWIND/FAST_FORWARD/SKIP_BACKWARD/SKIP_FORWARD to
    SkipBack/SkipForward. They ignore dpadHorizontalSeek because they
    are never focus navigation, and UP halves plus auto-repeats are consumed
    so the system media-key fallback cannot seek a second time.
  3. 328d12b3 — invalidate the mounted-window facts when the transport is
    replaced. The facts describe exactly one Media3 item: reports are dropped
    while the transport mount gate suppresses position reports (the same guard
    onPositionChanged applies), and a won mount clears them before the
    queued after-mount seek is re-evaluated. Without this, the previous
    transport's window end maps through the new plan's timeline offset and can
    overstate the new extent — a target the new transport cannot serve becomes
    a silent, wrong-position native seek with no error and no self-heal. Until
    the next poll tick (≤500 ms) the hint is simply absent, which at worst
    costs an unnecessary reanchor.

Behavioral changes, end to end:

  • Quick skips within the mounted transport's proven extent no longer hit the
    server: no buffering screen, no seek_reanchor call, no remount. Skips the
    mounted transport cannot serve reanchor exactly as before.
  • The remote's rewind/fast-forward keys seek on the first press, take the
    same route-aware path as D-pad, and skip −10 s/+30 s matching the on-screen
    transport labels instead of Media3's default ±5/±15 s session increments.
  • In Watch Together rooms, media-key seeks now pass the room transport gate
    instead of forking playback.
  • After a remount (reanchor, subtitle/audio replan, content switch), seeks
    commit only once the new transport's window is known; the handoff window
    degrades to a reanchor rather than a guess.

Alternatives considered and rejected: flipping can_seek_anywhere server-side
for event playlists (web clients seek past the produced head and 404); waiting
for the manifest head to grow on short overshoots (stall/latency risk for
marginal gain — reanchor already settles in about a second).

Validation

  • ./gradlew :android-shared:testDebugUnitTest --tests "org.siloserver.silo.common.player.seek.PlaybackTimelineSeekPolicyTest" :androidTvApp:testDebugUnitTest --tests "org.siloserver.silo.tv.ui.screens.player.TvPlayerRemoteKeyActionTest" --tests "org.siloserver.silo.tv.ui.screens.player.TvPlayerWindowFactInvalidationTest"
    → BUILD SUCCESSFUL. Adds 3 policy tests (hint allows native inside an open
    window; hint does not cover targets beyond the proved extent; hint cannot
    rescue targets outside the published window), 2 key-mapping tests (first
    press skips, repeat/UP consumed; media keys skip even when the idle overlay
    owns focus), and 2 invariant tests locking the mounted-window-fact
    invalidation (handoff suppression; won-mount reset ordered before the
    queued-seek re-evaluation).

  • ./gradlew :androidTvApp:compileDebugKotlin :android-shared:compileDebugUnitTestKotlin
    → success.

  • ./gradlew :androidTvApp:assembleDebug, installed on a Shield over ADB and
    exercised by hand on a growing-HLS episode (build at
    33feccdf+dc234833). 48 seeks in the logcat trace: 32 committed
    action=native with a non-null mounted_source_range (settle 85–500 ms,
    no server interaction); 16 reanchor-class commits, only for targets before
    the stream origin (OutsideSeekWindow) or past the produced head
    (UnknownSeekWindow), each settling in ~0.8–1.3 s; 0 PlaybackExceptions.
    The final build (328d12b3) additionally invalidates the window facts
    across remounts — that path degrades to the reanchor behavior this trace
    already exercises. Representative excerpt (raw):

    I/TvPlayerViewModel: seek_commit seek_id=23 action=native target_source_seconds=415.921 target_player_seconds=38.044 mounted_source_range=377.877..435.935
    I/TvPlayerViewModel: seek_settled seek_id=23 target_source_seconds=415.921 actual_source_seconds=416.117
    I/TvPlayerViewModel: seek_commit seek_id=32 action=server_reanchor target_source_seconds=370.427 reason=OutsideSeekWindow
    I/TvPlayerViewModel: seek_settled seek_id=32 target_source_seconds=370.427 actual_source_seconds=370.426
    

Summary by CodeRabbit

  • New Features

    • TV media rewind, skip, and fast-forward keys now support single-press seeking across player states.
    • Seeking within already loaded, seekable content now responds more quickly without unnecessary server re-anchoring.
  • Bug Fixes

    • Prevented stale playback-window information from affecting seeks during transport changes.
    • Improved handling of seek targets outside the currently available playback range.
    • Auto-repeat and key-release events no longer trigger duplicate seek actions.

…nchoring

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.
…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.
…eplaced

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.
@coderabbitai

coderabbitai Bot commented Aug 29, 2026 •

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: ddbabb3f-490d-49bc-857c-c7eb3782938d

📥 Commits

Reviewing files that changed from the base of the PR and between af75ea9 and 5ea3e06.

📒 Files selected for processing (5)
  • android-shared/src/androidUnitTest/kotlin/org/siloserver/silo/common/player/seek/PlaybackTimelineSeekPolicyTest.kt
  • androidTvApp/src/androidMain/kotlin/org/siloserver/silo/tv/ui/screens/player/TvPlayerRemoteKeyAction.kt
  • androidTvApp/src/androidMain/kotlin/org/siloserver/silo/tv/ui/screens/player/TvPlayerViewModel.kt
  • androidTvApp/src/androidUnitTest/kotlin/org/siloserver/silo/tv/ui/screens/player/TvPlayerRemoteKeyActionTest.kt
  • androidTvApp/src/androidUnitTest/kotlin/org/siloserver/silo/tv/ui/screens/player/TvPlayerWindowFactInvalidationTest.kt
🚧 Files skipped from review as they are similar to previous changes (5)
  • androidTvApp/src/androidUnitTest/kotlin/org/siloserver/silo/tv/ui/screens/player/TvPlayerWindowFactInvalidationTest.kt
  • androidTvApp/src/androidMain/kotlin/org/siloserver/silo/tv/ui/screens/player/TvPlayerRemoteKeyAction.kt
  • android-shared/src/androidUnitTest/kotlin/org/siloserver/silo/common/player/seek/PlaybackTimelineSeekPolicyTest.kt
  • androidTvApp/src/androidUnitTest/kotlin/org/siloserver/silo/tv/ui/screens/player/TvPlayerRemoteKeyActionTest.kt
  • androidTvApp/src/androidMain/kotlin/org/siloserver/silo/tv/ui/screens/player/TvPlayerViewModel.kt

Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review.


📝 Walkthrough

Walkthrough

The TV player now tracks the mounted Media3 seekable window, passes its source-time range to seek policy decisions, and supports dedicated media rewind and fast-forward keys with first-press-only handling.

Changes

Transport seek behavior

Layer / File(s) Summary
Mounted range seek policy
android-shared/src/androidMain/.../PlaybackTimelineSeekPolicy.kt, android-shared/src/androidUnitTest/.../PlaybackTimelineSeekPolicyTest.kt
decideSeek accepts an optional mounted source range. Native seeking remains available inside that range. Targets outside the published or mounted bounds use server reanchoring.
Mounted window tracking
androidTvApp/src/androidMain/.../TvPlayerScreen.kt, androidTvApp/src/androidMain/.../TvPlayerViewModel.kt, androidTvApp/src/androidUnitTest/.../TvPlayerWindowFactInvalidationTest.kt
The screen reports Media3 window seekability and duration. The ViewModel maps valid window facts to source time, clears stale facts during transport mounts, and passes the range to decideSeek.
Dedicated media seek keys
androidTvApp/src/androidMain/.../TvPlayerRemoteKeyAction.kt, androidTvApp/src/androidUnitTest/.../TvPlayerRemoteKeyActionTest.kt
Rewind and fast-forward media keys trigger one skip on the initial press. Repeats and key-up events are consumed, including when the idle overlay owns focus.

Estimated code review effort: 3 (Moderate) | ~25 minutes

Merge Risk: ⚪ Minimal · up to 5ea3e

The change makes TV seeking more immediate and consistent while preserving server fallback for unsupported targets; no actionable merge-blocking risk remains after normal checks and review.

Sequence Diagram(s)

sequenceDiagram
  participant Media3Player
  participant TvPlayerScreen
  participant TvPlayerViewModel
  participant PlaybackTimeline
  Media3Player->>TvPlayerScreen: Expose current Timeline.Window
  TvPlayerScreen->>TvPlayerViewModel: Report seekability and window end
  TvPlayerViewModel->>PlaybackTimeline: Decide target with mounted source range
  PlaybackTimeline-->>TvPlayerViewModel: Return NativeSeek or ServerReanchor
Loading
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 66.67% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 21 functions across 7 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
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.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately identifies the main changes: preferring native mounted transport for quick skips, mapping seek input, and fixing repeated seek-button behavior.
  • Fix all pre-merge checks with AI
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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

@evulhotdog

Copy link
Copy Markdown
Contributor Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Aug 29, 2026 •

Copy link
Copy Markdown
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

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 Silo-Server#259.
@evulhotdog

Copy link
Copy Markdown
Contributor Author

@CodeRabbit review

@coderabbitai

coderabbitai Bot commented Aug 29, 2026 •

Copy link
Copy Markdown
⚠️ Action not completed

Review rate limited.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@evulhotdog evulhotdog changed the title Fix/tv seek native first + don't require second press for seek fix(tv): prefer native mounted transport for quick skips instead of re-anchoring + map seek + fix second press for seek Aug 29, 2026
@evulhotdog

Copy link
Copy Markdown
Contributor Author

@CodeRabbit review

@coderabbitai

coderabbitai Bot commented Aug 29, 2026 •

Copy link
Copy Markdown
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@evulhotdog
evulhotdog marked this pull request as ready for review August 29, 2026 23:38
@evulhotdog evulhotdog changed the title fix(tv): prefer native mounted transport for quick skips instead of re-anchoring + map seek + fix second press for seek fix(tv): prefer native mounted transport for quick skips instead of re-anchoring + map seek input + fix second press for seek Aug 29, 2026
@Quick104
Quick104 merged commit e4168c9 into Silo-Server:main Aug 30, 2026
2 of 3 checks passed
Quick104 added a commit that referenced this pull request Aug 30, 2026
#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]>
Quick104 added a commit that referenced this pull request Aug 30, 2026
* 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]>
@evulhotdog
evulhotdog deleted the fix/tv-seek-native-first branch August 31, 2026 19:55
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.

2 participants