Skip to content

fix(tv): address Fire TV rc.1+4 feedback - #161

Merged
RXWatcher merged 4 commits into
Silo-Server:mainfrom
RXWatcher:fix/firetv-rc1-feedback
Aug 3, 2026
Merged

fix(tv): address Fire TV rc.1+4 feedback#161
RXWatcher merged 4 commits into
Silo-Server:mainfrom
RXWatcher:fix/firetv-rc1-feedback

Conversation

@RXWatcher

@RXWatcher RXWatcher commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

Summary

Addresses the Fire TV rc.1+4 QA feedback reported on 2026-08-03:

  • show the complete release version in Settings while retaining the base Android package version
  • keep D-pad subtitle selection scrolling as focus reaches the last visible item
  • snapshot Stop progress before Media3 teardown so Resume shows the correct time
  • preserve selected subtitle and audio choices after Stop
  • make Start Over honor an explicit zero position
  • restore the For You row to the top when focus returns after partial scrolling
  • fit legacy long phone-confirmation codes without clipping

The coordinated server change that limits newly generated pairing codes to eight letters is Silo-Server/silo-server#535. This client remains compatible with older long codes.

Implementation notes

  • Separates BuildConfig.DISPLAY_VERSION from VERSION_NAME; release builds receive the full tag through SILO_DISPLAY_VERSION.
  • Brings focused anchored-selector rows into view for TV D-pad navigation.
  • Preserves explicit zero start positions while retaining nonzero HLS timeline re-anchoring.
  • Captures player-exit state synchronously, consumes the progress overlay once, and retains file/audio/subtitle session choices.
  • Restores the For You recommendation list to item zero when it regains focus while partially scrolled.
  • Uses adaptive match-code tile sizing for legacy codes.

Testing

  • ./gradlew :shared:testDebugUnitTest :androidTvApp:testDebugUnitTest :androidTvApp:assembleDebug -PsiloVersionName=1.0.0 -PsiloDisplayVersion=1.0.0-rc.1+4 --no-daemon
  • Result: BUILD SUCCESSFUL — 110 actionable tasks
  • Added behavioral regression coverage for Stop audio preservation and one-shot resume-position consumption.
  • Verified the release label as 1.0.0-rc.1+4 in the generated debug build.

Related work

Summary by CodeRabbit

  • New Features

    • TV About and settings screens now show the complete display version, including prerelease details.
    • Playback position, duration, and track selections are better preserved when returning from video playback.
    • Start Over playback behavior now correctly respects the selected starting point.
  • Bug Fixes

    • Focused dropdown and recommendation items are automatically brought into view.
    • Match-code tiles resize appropriately for different code lengths.
    • Improved playback exit and subtitle persistence behavior.

@coderabbitai

coderabbitai Bot commented Aug 3, 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: 4516cc40-6048-49f3-b16e-df9c06ecaa73

📥 Commits

Reviewing files that changed from the base of the PR and between a2e963c and aaf0128.

📒 Files selected for processing (12)
  • .github/workflows/release.yml
  • androidTvApp/src/androidMain/kotlin/org/siloserver/silo/tv/ui/components/TvMediaRow.kt
  • androidTvApp/src/androidMain/kotlin/org/siloserver/silo/tv/ui/screens/auth/TvServerSetupScreen.kt
  • androidTvApp/src/androidMain/kotlin/org/siloserver/silo/tv/ui/screens/detail/TvItemDetailViewModel.kt
  • androidTvApp/src/androidMain/kotlin/org/siloserver/silo/tv/ui/screens/player/TvPlayerViewModel.kt
  • androidTvApp/src/androidMain/kotlin/org/siloserver/silo/tv/ui/screens/player/TvVideoPlaybackStarter.kt
  • androidTvApp/src/androidMain/kotlin/org/siloserver/silo/tv/ui/screens/recommendations/TvRecommendationsScreen.kt
  • androidTvApp/src/androidUnitTest/kotlin/org/siloserver/silo/tv/ui/screens/detail/TvTrackSelectionPersistenceTest.kt
  • androidTvApp/src/androidUnitTest/kotlin/org/siloserver/silo/tv/ui/screens/player/TvFireTvRcFeedbackOwnershipTest.kt
  • androidTvApp/src/androidUnitTest/kotlin/org/siloserver/silo/tv/ui/screens/player/TvPlaybackExitSnapshotTest.kt
  • androidTvApp/src/androidUnitTest/kotlin/org/siloserver/silo/tv/ui/screens/player/TvPlaybackSourceStartTest.kt
  • docs/superpowers/plans/2026-08-03-firetv-rc-review-fixes.md
💤 Files with no reviewable changes (1)
  • androidTvApp/src/androidUnitTest/kotlin/org/siloserver/silo/tv/ui/screens/player/TvFireTvRcFeedbackOwnershipTest.kt
🚧 Files skipped from review as they are similar to previous changes (5)
  • androidTvApp/src/androidMain/kotlin/org/siloserver/silo/tv/ui/screens/recommendations/TvRecommendationsScreen.kt
  • androidTvApp/src/androidMain/kotlin/org/siloserver/silo/tv/ui/screens/auth/TvServerSetupScreen.kt
  • androidTvApp/src/androidMain/kotlin/org/siloserver/silo/tv/ui/screens/player/TvVideoPlaybackStarter.kt
  • .github/workflows/release.yml
  • androidTvApp/src/androidMain/kotlin/org/siloserver/silo/tv/ui/screens/detail/TvItemDetailViewModel.kt

📝 Walkthrough

Walkthrough

The TV app now propagates complete display versions, improves focused-item visibility and match-code sizing, restores playback state after player exit, refines playback start-position resolution, and adds unit-test coverage.

Changes

TV application updates

Layer / File(s) Summary
Display version and TV layout behavior
.github/workflows/release.yml, androidTvApp/build.gradle.kts, androidTvApp/src/androidMain/kotlin/org/siloserver/silo/tv/ui/components/*, androidTvApp/src/androidMain/kotlin/org/siloserver/silo/tv/ui/screens/{auth,recommendations,settings}/*
Release builds pass the complete display version to Gradle. Settings display BuildConfig.DISPLAY_VERSION. Focused menu items and recommendation rows adjust visibility. Match-code tiles use computed widths.
Playback start-position resolution
androidTvApp/src/androidMain/kotlin/org/siloserver/silo/tv/ui/screens/player/TvVideoPlaybackStarter.kt
Playback startup separately resolves player and source positions. Explicit Start Over and rewound request positions affect the corresponding coordinates.
Playback exit and return continuity
androidTvApp/src/androidMain/kotlin/org/siloserver/silo/tv/ui/screens/{detail,player}/*
Player exit records validated position, duration, and track state. Detail refresh restores playback metadata and consumes progress once.
Playback and release validation
androidTvApp/src/androidUnitTest/kotlin/org/siloserver/silo/tv/ui/screens/{detail,player}/*, docs/superpowers/plans/*
Tests cover track retention, exit snapshots, source positions, and release display-version propagation. The implementation plan records the completed review fixes.

Estimated code review effort: 4 (Complex) | ~45 minutes

Possibly related PRs

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 18.18% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly identifies the Fire TV feedback fixes addressed by the pull request.
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.
✨ 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.

@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: 5

🧹 Nitpick comments (1)
androidTvApp/src/androidUnitTest/kotlin/org/siloserver/silo/tv/ui/screens/player/TvFireTvRcFeedbackOwnershipTest.kt (1)

58-69: 📐 Maintainability & Code Quality | 🔵 Trivial | 🏗️ Heavy lift

Recommend: replace source-text pattern matching with behavioral tests for the Kotlin logic checks.

These two tests read TvVideoPlaybackStarter.kt / TvPlayerScreen.kt / TvPlayerViewModel.kt / TvItemDetailViewModel.kt as raw text and assert on substring presence, counts, or relative ordering (contains, assertBefore's indexOf), instead of exercising the actual functions.

This has two consequences. First, it cannot catch a logic regression that leaves the same tokens in the same order but changes the value flowing through them — for example, starter.contains("overridePosition = request.resumePositionOverride") at line 68 matches both the playerStartPos and sourceStartPos call sites in TvVideoPlaybackStarter.kt, since the substring is a prefix of the playerStartPos call's overridePosition = request.resumePositionOverride.takeIf(::isExplicitStartOver) too. Second, asyncBody.contains("TvDetailTrackSelectionSession.remember") at line 93 also matches TvDetailTrackSelectionSession.rememberPlaybackReturn, so a rename or behavior change to that call would not be caught as long as the prefix survives.

For the Gradle/YAML checks (release display version), this is a reasonable choice since those files aren't directly unit-testable. For the Kotlin logic — start-position resolution and exit-ordering — consider testing the real functions/classes with fakes instead, so a value or behavior regression is actually caught.

Also applies to: 71-110

🤖 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/player/TvFireTvRcFeedbackOwnershipTest.kt`
around lines 58 - 69, Replace the raw source-text assertions in the Kotlin logic
tests, including explicit start-position resolution and exit-ordering checks,
with behavioral tests that invoke the real functions/classes such as
TvVideoPlaybackStarter, TvPlayerScreen, TvPlayerViewModel, and
TvItemDetailViewModel using fakes. Assert the resolved values and observable
call/order behavior directly, while retaining source-text checks only for
Gradle/YAML release-version validation.
🤖 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/androidMain/kotlin/org/siloserver/silo/tv/ui/screens/auth/TvServerSetupScreen.kt`:
- Line 847: Update the separator width used by MatchCodeCard to the shared
MATCH_CODE_SEPARATOR_WIDTH_DP value instead of the hardcoded 12dp values. Apply
this consistently to the separator rendering at the referenced locations while
leaving matchCodeTileWidthDp unchanged, so the setup row honors the shared
maximum width.

In
`@androidTvApp/src/androidMain/kotlin/org/siloserver/silo/tv/ui/screens/detail/TvItemDetailViewModel.kt`:
- Around line 1507-1527: Update rememberPlaybackReturn so the subtitle field
falls back to previous?.subtitle when the subtitle argument is null, preserving
the prior explicit choice for keep-current signals. Keep explicit non-null
subtitle values unchanged, and add a test in TvTrackSelectionPersistenceTest
mirroring playbackReturnPreservesPreviouslySelectedAudio for the null-subtitle
case.

In
`@androidTvApp/src/androidMain/kotlin/org/siloserver/silo/tv/ui/screens/player/TvPlayerViewModel.kt`:
- Around line 3914-3937: Update stopSessionForExitAsync to apply the provided
positionMs and durationMs directly to _uiState before capturing the exit
snapshot, bypassing onPositionChanged and its seek-recovery or transport-mount
gates. Convert the values to the existing positionSeconds and durationSeconds
units, preserve the current state when either value is absent, and ensure
rememberPlaybackReturn uses the updated snapshot.

In
`@androidTvApp/src/androidMain/kotlin/org/siloserver/silo/tv/ui/screens/player/TvVideoPlaybackStarter.kt`:
- Around line 200-219: The sourceStartPos calculation in the
resolvePlaybackStartPosition call must use the already-rewound
startRequestPosition as the override instead of the raw
request.resumePositionOverride. Update this call while preserving
serverSourceStartPos and the existing playerStartPos logic, so
StartParams.startPosition matches the value sent as the server startPosition
during resume rewinds.

In
`@androidTvApp/src/androidMain/kotlin/org/siloserver/silo/tv/ui/screens/recommendations/TvRecommendationsScreen.kt`:
- Around line 303-316: The first recommendation’s onItemFocused handler must
keep enforcing the scroll-to-top reset until focus relocation finishes, rather
than issuing a single animateScrollToItem call. Update the index-0 callback
around recommendationsListState and focusBridgeScope so it rechecks the list
position and reapplies the reset while the first row remains focused, preserving
the existing no-op behavior when already at item 0.

---

Nitpick comments:
In
`@androidTvApp/src/androidUnitTest/kotlin/org/siloserver/silo/tv/ui/screens/player/TvFireTvRcFeedbackOwnershipTest.kt`:
- Around line 58-69: Replace the raw source-text assertions in the Kotlin logic
tests, including explicit start-position resolution and exit-ordering checks,
with behavioral tests that invoke the real functions/classes such as
TvVideoPlaybackStarter, TvPlayerScreen, TvPlayerViewModel, and
TvItemDetailViewModel using fakes. Assert the resolved values and observable
call/order behavior directly, while retaining source-text checks only for
Gradle/YAML release-version validation.
🪄 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: 1c8e085d-2beb-4c88-bf63-f20b48640bc0

📥 Commits

Reviewing files that changed from the base of the PR and between aff2f77 and a2e963c.

📒 Files selected for processing (12)
  • .github/workflows/release.yml
  • androidTvApp/build.gradle.kts
  • androidTvApp/src/androidMain/kotlin/org/siloserver/silo/tv/ui/components/TvAnchoredSelectorMenu.kt
  • androidTvApp/src/androidMain/kotlin/org/siloserver/silo/tv/ui/screens/auth/TvServerSetupScreen.kt
  • androidTvApp/src/androidMain/kotlin/org/siloserver/silo/tv/ui/screens/detail/TvItemDetailViewModel.kt
  • androidTvApp/src/androidMain/kotlin/org/siloserver/silo/tv/ui/screens/player/TvPlayerScreen.kt
  • androidTvApp/src/androidMain/kotlin/org/siloserver/silo/tv/ui/screens/player/TvPlayerViewModel.kt
  • androidTvApp/src/androidMain/kotlin/org/siloserver/silo/tv/ui/screens/player/TvVideoPlaybackStarter.kt
  • androidTvApp/src/androidMain/kotlin/org/siloserver/silo/tv/ui/screens/recommendations/TvRecommendationsScreen.kt
  • androidTvApp/src/androidMain/kotlin/org/siloserver/silo/tv/ui/screens/settings/TvSettingsScreen.kt
  • androidTvApp/src/androidUnitTest/kotlin/org/siloserver/silo/tv/ui/screens/detail/TvTrackSelectionPersistenceTest.kt
  • androidTvApp/src/androidUnitTest/kotlin/org/siloserver/silo/tv/ui/screens/player/TvFireTvRcFeedbackOwnershipTest.kt

@RXWatcher

Copy link
Copy Markdown
Contributor Author

Review follow-up pushed in a6803b48 and synchronized with current main in 8405dc96.

The Kotlin source-text checks called out in the review were removed. Real behavioral tests now cover:

  • one-shot playback-return state and audio/subtitle preservation
  • final Stop snapshots, including nonzero HLS timeline reanchoring
  • rewound source-start adoption, Start Over zero, and server-anchor fallback
  • bounded legacy match-code layout

Fresh verification on the merged tree:

  • ./gradlew :shared:testDebugUnitTest :androidTvApp:testDebugUnitTest :androidTvApp:assembleDebug -PsiloVersionName=1.0.0 -PsiloDisplayVersion=1.0.0-rc.1+4 --no-daemonBUILD SUCCESSFUL, 110 tasks
  • bash scripts/test-release-workflow.sh — all self-tests passed
  • git diff --check upstream/main...HEAD — clean

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Aug 3, 2026

Copy link
Copy Markdown

@RXWatcher I will review the current pull request state, including the follow-up commits and behavioral test coverage.

✅ 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.

@RXWatcher

Copy link
Copy Markdown
Contributor Author

Pushed audit follow-up in aaf01280:

  • preserve the previously selected file/version when the final playback snapshot has no reliable file ID
  • bound the For You top-row correction loop so it stops once the list is anchored at the top or focus leaves
  • add regression coverage for the unknown exit file-ID case
  • mark the implementation-plan checklist complete

Fresh verification passed: :shared:testDebugUnitTest, :androidTvApp:testDebugUnitTest, :androidTvApp:assembleDebug with display version 1.0.0-rc.1+4, release-workflow self-tests, and git diff --check.

@RXWatcher
RXWatcher merged commit 46f60ee into Silo-Server:main Aug 3, 2026
2 checks passed
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