Skip to content

Fix v0.2.5 Android TV playback feedback - #37

Merged
RXWatcher merged 1 commit into
Silo-Server:mainfrom
RXWatcher:fix/v025-feedback
Jul 7, 2026
Merged

RXWatcher merged 1 commit into
Silo-Server:mainfrom
RXWatcher:fix/v025-feedback

Conversation

@RXWatcher

@RXWatcher RXWatcher commented Jul 7, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • Fix TV subtitle quick-pick state so selections only advance after the backend applies the requested track, and unknown subtitle indexes no longer resolve to Off.
  • Make TV D-pad left/right seek during playback instead of opening the HUD, including the visible idle-overlay path.
  • Keep detail hero version chips in sync when the selected media version changes.
  • Keep subtitles bounded to the actual video content frame during letterboxed playback without double-applying content-frame offsets.
  • Split audiobook progress into a TV Home Continue Listening row instead of mixing it into Continue Watching.
  • Set the default visible app version to 0.2.6 and bump the local Android version-code base to 7.

Versioning

  • Mobile: versionName 0.2.6, default versionCode 14.
  • TV: versionName 0.2.6, default versionCode 15.
  • CI can still override these via SILO_VERSION_NAME/SILO_VERSION_CODE or Gradle properties.

Review follow-up

  • Addressed the subtitle content-frame review by converting visible bounds back into the subtitle parent local coordinate space.
  • Added tests for letterboxed/clipped subtitle frame bounds and visible-overlay D-pad skip behavior.
  • Applied the home row-style when cleanup.
  • Skipped the optional real PlayerView glue test because android-shared Robolectric unit tests cannot instantiate Media3 PlayerView reliably without packaged app style resources; the regression is covered by pure helper tests.

Verification

  • ./gradlew :android-shared:testDebugUnitTest --tests org.siloserver.silo.common.player.SubtitleManagerAppearanceTest
  • ./gradlew :android-shared:testDebugUnitTest --tests org.siloserver.silo.common.player.SubtitleManagerAppearanceTest :androidTvApp:testDebugUnitTest --tests org.siloserver.silo.tv.ui.screens.player.TvPlayerRemoteKeyActionTest --tests org.siloserver.silo.tv.ui.screens.player.TvPlayerControlsUsabilityTest --tests org.siloserver.silo.tv.ui.screens.home.TvHomeSectionsTest
  • ./gradlew :android-shared:testDebugUnitTest :androidTvApp:testDebugUnitTest :androidTvApp:assembleDebug :androidApp:assembleDebug
  • generated manifests show versionName=0.2.6 for both apps

@coderabbitai

coderabbitai Bot commented Jul 7, 2026 •

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

This PR updates subtitle overlay positioning to prefer the PlayerView content frame, adds TV home audiobook progress row splitting, threads a selected file id through TV detail hero metadata, introduces D-pad left/right skip-back/skip-forward playback actions with unified relative seek logic, and bumps Gradle version codes.

Changes

Subtitle Geometry

Layer / File(s) Summary
Content-frame subtitle rect computation and sync
android-shared/.../SubtitleManager.kt, android-shared/.../SubtitleManagerAppearanceTest.kt
Adds displayedSubtitleContentFrameRect and PlayerView.contentFrameSubtitleRect, wires them as the primary source for subtitle rectangle sync with fallback to prior logic, and adds tests for valid/invalid content frames.

TV Home, Detail, and Player Navigation

Layer / File(s) Summary
TV home audiobook section splitting
androidTvApp/.../TvHomeSections.kt, TvHomeScreen.kt, TvHomeSectionsTest.kt
Adds normalizeTvHomeSections/splitAudioProgress to separate audiobook items into a "Continue Listening" row, wires TvHomeScreen to use it and tvHomeRowStyle(), with tests.
Hero facts use selected file id
TvDetailMetadata.kt, TvItemDetailScreen.kt, TvDetailMetadataTest.kt
Threads selectedFileId through factsLine/qualityTokens/preferredVersion; TvItemDetailScreen computes heroSelectedFileId from series/season next-up state.
D-pad skip-back/skip-forward navigation
TvPlayerRemoteKeyAction.kt, TvPlayerScreen.kt, related tests
Adds SkipBack/SkipForward actions and key mapping, introduces performRelativeSeek for room/solo seeking, rewires subtitle selection ordering and overlay key handling.

Build Configuration

Layer / File(s) Summary
Gradle siloVersionCode base update
androidApp/build.gradle.kts, androidTvApp/build.gradle.kts
Bumps default siloVersionCode base from 6 to 7 and updates related comments.

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

Sequence Diagram(s)

sequenceDiagram
  participant DPad
  participant tvPlayerRemoteKeyAction
  participant TvPlayerScreen
  participant performRelativeSeek
  participant RoomController
  participant MediaController

  DPad->>tvPlayerRemoteKeyAction: KEYCODE_DPAD_LEFT/RIGHT ACTION_DOWN
  tvPlayerRemoteKeyAction-->>TvPlayerScreen: SkipBack/SkipForward
  TvPlayerScreen->>performRelativeSeek: deltaMs, snapshot, revealControls
  performRelativeSeek->>RoomController: onUserSeek() if room
  performRelativeSeek->>MediaController: seekTo() if solo
Loading
sequenceDiagram
  participant SubtitleVideoRectSync
  participant PlayerView
  participant ContentFrameHelper as displayedSubtitleContentFrameRect
  participant FallbackHelper as displayedSubtitleVideoRect

  SubtitleVideoRectSync->>PlayerView: contentFrameSubtitleRect()
  PlayerView->>ContentFrameHelper: compute rect from exo_content_frame
  ContentFrameHelper-->>PlayerView: rect or null
  PlayerView-->>SubtitleVideoRectSync: rect or null
  SubtitleVideoRectSync->>FallbackHelper: fallback if null
  FallbackHelper-->>SubtitleVideoRectSync: fallback rect
Loading

Possibly related issues

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
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 matches the main theme of the changes: Android TV playback and related feedback fixes for v0.2.5.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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

❤️ Share

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

@RXWatcher
RXWatcher force-pushed the fix/v025-feedback branch from 574519a to 80bc277 Compare July 7, 2026 08:49

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 574519a5a0

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

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🧹 Nitpick comments (2)
androidTvApp/src/androidMain/kotlin/org/siloserver/silo/tv/ui/screens/home/TvHomeSections.kt (1)

17-20: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Minor: simplify the branching into a when.

The if/else if/else chain where the final two branches converge on distinct results reads slightly awkwardly. Not blocking, purely stylistic.

♻️ Optional simplification
-internal fun ResolvedSection.tvHomeRowStyle(): TvRowStyle =
-    if (isTvAudioProgressSection()) TvRowStyle.Poster
-    else if (isTvProgressRow()) TvRowStyle.Backdrop
-    else TvRowStyle.Poster
+internal fun ResolvedSection.tvHomeRowStyle(): TvRowStyle = when {
+    isTvAudioProgressSection() -> TvRowStyle.Poster
+    isTvProgressRow() -> TvRowStyle.Backdrop
+    else -> TvRowStyle.Poster
+}
🤖 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/home/TvHomeSections.kt`
around lines 17 - 20, Simplify ResolvedSection.tvHomeRowStyle() by replacing the
current if/else chain with a when expression. Keep the same mapping for
isTvAudioProgressSection() and isTvProgressRow(), and preserve the default
TvRowStyle.Poster branch for all other cases.
android-shared/src/androidUnitTest/kotlin/org/siloserver/silo/common/player/SubtitleManagerAppearanceTest.kt (1)

150-178: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Consider covering the PlayerView.contentFrameSubtitleRect() extension itself.

Current tests only cover the pure displayedSubtitleContentFrameRect helper. Since RobolectricTestRunner is already in use here, a test that inflates a real PlayerView, lays it out, and invokes contentFrameSubtitleRect() via reflection would cover the findViewById(exo_content_frame) glue logic, which is the part most exposed to library-layout assumptions.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In
`@android-shared/src/androidUnitTest/kotlin/org/siloserver/silo/common/player/SubtitleManagerAppearanceTest.kt`
around lines 150 - 178, Add coverage for the
PlayerView.contentFrameSubtitleRect() extension itself, not just
displayedSubtitleContentFrameRect. Since RobolectricTestRunner is already
available, create a test that inflates a real PlayerView, lays it out, and
invokes contentFrameSubtitleRect() via reflection so the
findViewById(exo_content_frame) path is exercised. Keep the existing
displayedSubtitleContentFrameRect tests, but add one that verifies the extension
returns the expected bounds from an actual PlayerView hierarchy.
🤖 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
`@androidTvApp/src/androidUnitTest/kotlin/org/siloserver/silo/tv/ui/screens/player/TvPlayerControlsUsabilityTest.kt`:
- Around line 357-367: The test currently verifies only the hidden-controls skip
wiring, so it misses the visible-overlay focus regression in
TvPlayerIdleOverlay. Update TvPlayerControlsUsabilityTest to also exercise
TvPlayerIdleOverlay.onPreviewKeyEvent with the transport cluster focused and
assert the SkipBack/SkipForward actions behave correctly without breaking focus
navigation. Use the existing TvPlayerIdleOverlay and onPreviewKeyEvent symbols
so the coverage targets the visible overlay path, not just the hidden-controls
branch.

---

Nitpick comments:
In
`@android-shared/src/androidUnitTest/kotlin/org/siloserver/silo/common/player/SubtitleManagerAppearanceTest.kt`:
- Around line 150-178: Add coverage for the
PlayerView.contentFrameSubtitleRect() extension itself, not just
displayedSubtitleContentFrameRect. Since RobolectricTestRunner is already
available, create a test that inflates a real PlayerView, lays it out, and
invokes contentFrameSubtitleRect() via reflection so the
findViewById(exo_content_frame) path is exercised. Keep the existing
displayedSubtitleContentFrameRect tests, but add one that verifies the extension
returns the expected bounds from an actual PlayerView hierarchy.

In
`@androidTvApp/src/androidMain/kotlin/org/siloserver/silo/tv/ui/screens/home/TvHomeSections.kt`:
- Around line 17-20: Simplify ResolvedSection.tvHomeRowStyle() by replacing the
current if/else chain with a when expression. Keep the same mapping for
isTvAudioProgressSection() and isTvProgressRow(), and preserve the default
TvRowStyle.Poster branch for all other cases.
🪄 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: 69cb9a57-5f73-4b3f-91c1-fd9d23ab6dee

📥 Commits

Reviewing files that changed from the base of the PR and between c25d26c and 574519a.

📒 Files selected for processing (16)
  • android-shared/src/androidMain/kotlin/org/siloserver/silo/common/player/SubtitleManager.kt
  • android-shared/src/androidUnitTest/kotlin/org/siloserver/silo/common/player/SubtitleManagerAppearanceTest.kt
  • androidApp/build.gradle.kts
  • androidTvApp/build.gradle.kts
  • androidTvApp/src/androidMain/kotlin/org/siloserver/silo/tv/ui/screens/detail/TvDetailMetadata.kt
  • androidTvApp/src/androidMain/kotlin/org/siloserver/silo/tv/ui/screens/detail/TvItemDetailScreen.kt
  • androidTvApp/src/androidMain/kotlin/org/siloserver/silo/tv/ui/screens/home/TvHomeScreen.kt
  • androidTvApp/src/androidMain/kotlin/org/siloserver/silo/tv/ui/screens/home/TvHomeSections.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/TvPlayerScreen.kt
  • androidTvApp/src/androidUnitTest/kotlin/org/siloserver/silo/tv/ui/screens/detail/TvDetailMetadataTest.kt
  • androidTvApp/src/androidUnitTest/kotlin/org/siloserver/silo/tv/ui/screens/home/TvHomeSectionsTest.kt
  • androidTvApp/src/androidUnitTest/kotlin/org/siloserver/silo/tv/ui/screens/player/PlayerTrackEntriesTest.kt
  • androidTvApp/src/androidUnitTest/kotlin/org/siloserver/silo/tv/ui/screens/player/TvPlayerControlsUsabilityTest.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/TvPlayerScreenStartPositionTest.kt

@RXWatcher
RXWatcher force-pushed the fix/v025-feedback branch from 80bc277 to 1a01513 Compare July 7, 2026 08:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant