Repository navigation
Fix v0.2.5 Android TV playback feedback - #37
Conversation
📝 WalkthroughWalkthroughThis 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. ChangesSubtitle Geometry
TV Home, Detail, and Player Navigation
Build Configuration
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
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
Possibly related issues
🚥 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 |
574519a to
80bc277
Compare
There was a problem hiding this comment.
💡 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".
There was a problem hiding this comment.
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 valueMinor: simplify the branching into a
when.The
if/else if/elsechain 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 winConsider covering the
PlayerView.contentFrameSubtitleRect()extension itself.Current tests only cover the pure
displayedSubtitleContentFrameRecthelper. SinceRobolectricTestRunneris already in use here, a test that inflates a realPlayerView, lays it out, and invokescontentFrameSubtitleRect()via reflection would cover thefindViewById(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
📒 Files selected for processing (16)
android-shared/src/androidMain/kotlin/org/siloserver/silo/common/player/SubtitleManager.ktandroid-shared/src/androidUnitTest/kotlin/org/siloserver/silo/common/player/SubtitleManagerAppearanceTest.ktandroidApp/build.gradle.ktsandroidTvApp/build.gradle.ktsandroidTvApp/src/androidMain/kotlin/org/siloserver/silo/tv/ui/screens/detail/TvDetailMetadata.ktandroidTvApp/src/androidMain/kotlin/org/siloserver/silo/tv/ui/screens/detail/TvItemDetailScreen.ktandroidTvApp/src/androidMain/kotlin/org/siloserver/silo/tv/ui/screens/home/TvHomeScreen.ktandroidTvApp/src/androidMain/kotlin/org/siloserver/silo/tv/ui/screens/home/TvHomeSections.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/androidUnitTest/kotlin/org/siloserver/silo/tv/ui/screens/detail/TvDetailMetadataTest.ktandroidTvApp/src/androidUnitTest/kotlin/org/siloserver/silo/tv/ui/screens/home/TvHomeSectionsTest.ktandroidTvApp/src/androidUnitTest/kotlin/org/siloserver/silo/tv/ui/screens/player/PlayerTrackEntriesTest.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/screens/player/TvPlayerScreenStartPositionTest.kt
80bc277 to
1a01513
Compare
1a01513 to
511aafe
Compare
Summary
Versioning
Review follow-up
whencleanup.Verification