Repository navigation
fix(android): harden navigation, library state, and Watch Together - #126
Conversation
|
Warning Review limit reached
Next review available in: 3 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (5)
📝 WalkthroughWalkthroughHome hydration and identity-safe caching, Android TV focus and For You routing, editorial hero metadata, phone library layout, Watch Together delivery, playback teardown, and download state handling are updated with regression tests and supporting documentation. ChangesAndroid remediation
Estimated code review effort: 5 (Critical) | ~100 minutes Possibly related issues
Possibly related PRs
🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (3 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 |
There was a problem hiding this comment.
Actionable comments posted: 4
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
androidTvApp/src/androidMain/kotlin/org/siloserver/silo/tv/ui/shell/TvMainShell.kt (1)
371-385: 🎯 Functional Correctness | 🟠 Major | ⚡ Quick winPass the shell fallback into Calendar.
TvCalendarScreenis called withoutonContentUpFallbackChanged = onContentUpFallbackat Lines 1068-1075. Consequently, CalendarList never registers its custom shelf-to-controls Up choreography and the shell uses generic Up behavior instead.Proposed fix
TvCalendarScreen( onOpenItemDetail = onOpenItemDetail, onInitialContentFocus = { ... }, focusRequest = contentFocusRequest, + onContentUpFallbackChanged = onContentUpFallback, )🤖 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/shell/TvMainShell.kt` around lines 371 - 385, Update the TvCalendarScreen call site to pass the existing onContentUpFallback callback through onContentUpFallbackChanged. Use the shell’s onContentUpFallback symbol so CalendarList can register its custom shelf-to-controls Up behavior while preserving the existing screen configuration.
🧹 Nitpick comments (1)
shared/src/commonMain/kotlin/org/siloserver/silo/repository/SectionRepository.kt (1)
15-34: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winInject the dispatcher instead of hardcoding
Dispatchers.Default.
homeRequestScopehardcodesDispatchers.Default. Official Android coroutines guidance recommends injecting dispatchers as constructor parameters (with aDispatchers.Defaultdefault) so tests can substitute aTestDispatcherfor deterministic virtual-time execution instead of relying on real background-thread scheduling andCompletableDeferredgates, as the new tests currently do.♻️ Suggested refactor
class SectionRepository( private val sectionApi: SectionApi, /** Offline read cache for a library's Recommended sections (Track B). No-op by default. */ private val catalogCache: CatalogCachePort = NoOpCatalogCachePort, + private val homeRequestDispatcher: CoroutineDispatcher = Dispatchers.Default, ) { - private val homeRequestScope = CoroutineScope(SupervisorJob() + Dispatchers.Default) + private val homeRequestScope = CoroutineScope(SupervisorJob() + homeRequestDispatcher)🤖 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 `@shared/src/commonMain/kotlin/org/siloserver/silo/repository/SectionRepository.kt` around lines 15 - 34, Update the SectionRepository constructor to accept an injectable CoroutineDispatcher parameter defaulting to Dispatchers.Default, then use that parameter when creating homeRequestScope instead of referencing Dispatchers.Default directly. Preserve the existing SupervisorJob structure and default runtime behavior while allowing tests to provide a TestDispatcher.
🤖 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/components/TvSkylineSectionFeed.kt`:
- Around line 118-123: Update the LaunchedEffect key in the initial marquee
seeding block to include initialMarqueeSeed?.rowIdentity alongside the existing
item content ID and row title keys, ensuring a changed section identity reseeds
the marquee before focus changes.
In
`@androidTvApp/src/androidMain/kotlin/org/siloserver/silo/tv/ui/screens/library/TvLibraryDetailScreen.kt`:
- Line 312: Update the TvLibraryTab.Alphabet branch to pass
onContentUpFallbackChanged through to LibraryTab, matching the Browse branch.
Ensure TvAlphabetRail receives the fallback so Up from “All” is held instead of
falling through to the menu.
In
`@androidTvApp/src/androidMain/kotlin/org/siloserver/silo/tv/ui/shell/TvMainShell.kt`:
- Around line 540-545: Update the top-menu onSelectRoot path for
TvRootDestination.ForYou to reset forYouEntryRequest to the default/root
selection before navigating or opening the For You destination. Keep
openForYou()’s existing selection-advancement behavior unchanged, while ensuring
direct root-tab selection opens recommendations rather than a previously saved
Watchlist/Favorites list.
In
`@docs/reviews/2026-07-27-android-tv-navigation-remediation-executive-summary.md`:
- Line 71: Update the phrase in the executive summary to hyphenate the compound
modifier, changing “TV focused unit tests” to “TV-focused unit tests.”
---
Outside diff comments:
In
`@androidTvApp/src/androidMain/kotlin/org/siloserver/silo/tv/ui/shell/TvMainShell.kt`:
- Around line 371-385: Update the TvCalendarScreen call site to pass the
existing onContentUpFallback callback through onContentUpFallbackChanged. Use
the shell’s onContentUpFallback symbol so CalendarList can register its custom
shelf-to-controls Up behavior while preserving the existing screen
configuration.
---
Nitpick comments:
In
`@shared/src/commonMain/kotlin/org/siloserver/silo/repository/SectionRepository.kt`:
- Around line 15-34: Update the SectionRepository constructor to accept an
injectable CoroutineDispatcher parameter defaulting to Dispatchers.Default, then
use that parameter when creating homeRequestScope instead of referencing
Dispatchers.Default directly. Preserve the existing SupervisorJob structure and
default runtime behavior while allowing tests to provide a TestDispatcher.
🪄 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: aa8310bc-4a29-4b4c-8a34-4b33626b6220
📒 Files selected for processing (28)
android-shared/src/androidMain/kotlin/org/siloserver/silo/common/startup/StartupWarmup.ktandroidTvApp/src/androidMain/kotlin/org/siloserver/silo/tv/ui/components/TvAlphabetRail.ktandroidTvApp/src/androidMain/kotlin/org/siloserver/silo/tv/ui/components/TvFocusMarqueeModel.ktandroidTvApp/src/androidMain/kotlin/org/siloserver/silo/tv/ui/components/TvSkylinePrefetchPolicy.ktandroidTvApp/src/androidMain/kotlin/org/siloserver/silo/tv/ui/components/TvSkylineSectionFeed.ktandroidTvApp/src/androidMain/kotlin/org/siloserver/silo/tv/ui/components/TvSkylineUpNavigation.ktandroidTvApp/src/androidMain/kotlin/org/siloserver/silo/tv/ui/screens/calendar/TvCalendarScreen.ktandroidTvApp/src/androidMain/kotlin/org/siloserver/silo/tv/ui/screens/home/TvHomeScreen.ktandroidTvApp/src/androidMain/kotlin/org/siloserver/silo/tv/ui/screens/library/TvLibraryDetailScreen.ktandroidTvApp/src/androidMain/kotlin/org/siloserver/silo/tv/ui/screens/recommendations/TvForYouEntryRequest.ktandroidTvApp/src/androidMain/kotlin/org/siloserver/silo/tv/ui/screens/recommendations/TvRecommendationsFocusBridge.ktandroidTvApp/src/androidMain/kotlin/org/siloserver/silo/tv/ui/screens/recommendations/TvRecommendationsScreen.ktandroidTvApp/src/androidMain/kotlin/org/siloserver/silo/tv/ui/shell/TvMainShell.ktandroidTvApp/src/androidUnitTest/kotlin/org/siloserver/silo/tv/ui/components/TvFocusMarqueeEnrichmentTest.ktandroidTvApp/src/androidUnitTest/kotlin/org/siloserver/silo/tv/ui/components/TvSkylinePrefetchPolicyTest.ktandroidTvApp/src/androidUnitTest/kotlin/org/siloserver/silo/tv/ui/components/TvSkylineUpNavigationTest.ktandroidTvApp/src/androidUnitTest/kotlin/org/siloserver/silo/tv/ui/screens/recommendations/TvForYouEntryRequestTest.ktandroidTvApp/src/androidUnitTest/kotlin/org/siloserver/silo/tv/ui/screens/recommendations/TvRecommendationsFocusBridgeTest.ktdocs/reviews/2026-07-27-android-tv-navigation-remediation-executive-summary.mddocs/superpowers/plans/2026-07-27-android-tv-navigation-remediation.mddocs/superpowers/specs/2026-07-27-android-tv-navigation-remediation-design.mdshared/src/commonMain/kotlin/org/siloserver/silo/repository/CatalogRepository.ktshared/src/commonMain/kotlin/org/siloserver/silo/repository/SectionRepository.ktshared/src/commonMain/kotlin/org/siloserver/silo/viewmodel/HomeSectionHydrator.ktshared/src/commonMain/kotlin/org/siloserver/silo/viewmodel/HomeViewModel.ktshared/src/commonTest/kotlin/org/siloserver/silo/repository/CatalogRepositoryDetailCacheTest.ktshared/src/commonTest/kotlin/org/siloserver/silo/repository/SectionRepositoryCacheTest.ktshared/src/commonTest/kotlin/org/siloserver/silo/viewmodel/HomeSectionHydratorTest.kt
|
CodeRabbit remediation is complete on the current head. Verified corrections include Alphabet Up fallback forwarding, top-level For You reset, row-identity marquee reseeding with real-focus precedence, phone/TV IMDb bounds and independent invalid-field coverage, compiler-visible Watch Together delivery keys, request/cache guard cleanup, dynamic library-tab focus retry, and branch-wide changed-document privacy sanitation. Shared in-flight recommendation work remains repository-owned and is not cancelled by a superseded UI caller. Fresh local verification on the final fix head:
No APK was installed or deployed, and this PR was not merged. |
There was a problem hiding this comment.
Actionable comments posted: 3
🤖 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
`@androidApp/src/androidUnitTest/kotlin/org/siloserver/silo/android/ui/screens/player/RoomDeliveryKeySourceTest.kt`:
- Around line 15-24: Update the source-block extraction in the test around
reportingBlock to first assert that both marker comments exist in
controllerSource, then extract only the text between their validated positions.
Keep the existing deliveryKey and repository.stateReport assertions scoped to
that exact drift-reporting block, avoiding substringAfter/substringBefore
fallback behavior.
In
`@androidTvApp/src/androidUnitTest/kotlin/org/siloserver/silo/tv/ui/screens/player/TvRoomDeliveryKeySourceTest.kt`:
- Around line 15-24: Update the source-extraction assertions in
TvRoomDeliveryKeySourceTest so both "// Drift reporting loop" and "// ready /
buffering during the waiting barrier." anchors are verified present before
slicing. Compute and use their offsets to extract only the intended reporting
block, then retain the existing deliveryKey and stateReport ordering assertions.
In `@docs/superpowers/plans/2026-07-28-pr-126-coderabbit-remediation.md`:
- Line 3: Update the plan’s task checkboxes to reflect the completed remediation
cycles and record their results, or clearly label the document as a
historical/pre-implementation plan if execution was not performed. Correct the
Task 3 verification guidance around RoomSyncController.kt so it matches the
existing deliveryKey != null implementation instead of claiming the RED run
should fail on deliveryKey!!.
🪄 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: ff8fafb0-d43a-4c17-9cd2-aa9d5b67b418
📒 Files selected for processing (33)
.superpowers/sdd/2026-07-28-android-tv-active-header-focus-editorial-hero/task-4-report.mdandroidApp/src/androidMain/kotlin/org/siloserver/silo/android/ui/screens/home/FeaturedHeroMetadata.ktandroidApp/src/androidMain/kotlin/org/siloserver/silo/android/ui/screens/libraries/LibrariesScreen.ktandroidApp/src/androidMain/kotlin/org/siloserver/silo/android/ui/screens/player/RoomSyncController.ktandroidApp/src/androidUnitTest/kotlin/org/siloserver/silo/android/ui/screens/home/FeaturedHeroMetadataTest.ktandroidApp/src/androidUnitTest/kotlin/org/siloserver/silo/android/ui/screens/player/RoomDeliveryKeySourceTest.ktandroidTvApp/src/androidMain/kotlin/org/siloserver/silo/tv/ui/components/TvFocusMarqueeModel.ktandroidTvApp/src/androidMain/kotlin/org/siloserver/silo/tv/ui/components/TvSkylineSectionFeed.ktandroidTvApp/src/androidMain/kotlin/org/siloserver/silo/tv/ui/screens/library/TvLibraryDetailScreen.ktandroidTvApp/src/androidMain/kotlin/org/siloserver/silo/tv/ui/screens/player/TvRoomSyncController.ktandroidTvApp/src/androidMain/kotlin/org/siloserver/silo/tv/ui/screens/recommendations/TvForYouEntryRequest.ktandroidTvApp/src/androidMain/kotlin/org/siloserver/silo/tv/ui/shell/TvMainShell.ktandroidTvApp/src/androidMain/kotlin/org/siloserver/silo/tv/ui/shell/TvTopMenuBar.ktandroidTvApp/src/androidMain/kotlin/org/siloserver/silo/tv/ui/shell/TvTopMenuFocusRequest.ktandroidTvApp/src/androidUnitTest/kotlin/org/siloserver/silo/tv/ui/components/TvFocusMarqueeEnrichmentTest.ktandroidTvApp/src/androidUnitTest/kotlin/org/siloserver/silo/tv/ui/components/TvFocusMarqueeModelTest.ktandroidTvApp/src/androidUnitTest/kotlin/org/siloserver/silo/tv/ui/screens/library/TvLibraryReviewWiringSourceTest.ktandroidTvApp/src/androidUnitTest/kotlin/org/siloserver/silo/tv/ui/screens/player/SubtitleTransactionIntegrationTest.ktandroidTvApp/src/androidUnitTest/kotlin/org/siloserver/silo/tv/ui/screens/player/TvRoomDeliveryKeySourceTest.ktandroidTvApp/src/androidUnitTest/kotlin/org/siloserver/silo/tv/ui/screens/recommendations/TvForYouEntryRequestTest.ktandroidTvApp/src/androidUnitTest/kotlin/org/siloserver/silo/tv/ui/shell/TvTopMenuFocusRequestTest.ktdocs/reviews/2026-07-27-android-tv-navigation-remediation-executive-summary.mddocs/superpowers/plans/2026-07-27-android-tv-navigation-remediation.mddocs/superpowers/plans/2026-07-28-android-phone-library-chrome-inset.mddocs/superpowers/plans/2026-07-28-android-tv-active-header-focus-editorial-hero.mddocs/superpowers/plans/2026-07-28-pr-126-coderabbit-remediation.mddocs/superpowers/specs/2026-07-28-pr-126-coderabbit-remediation-design.mdshared/src/commonMain/kotlin/org/siloserver/silo/repository/CatalogRepository.ktshared/src/commonMain/kotlin/org/siloserver/silo/repository/PersonalDataRepository.ktshared/src/commonMain/kotlin/org/siloserver/silo/repository/SectionRepository.ktshared/src/commonMain/kotlin/org/siloserver/silo/watchtogether/RoomDeliveryLatch.ktshared/src/commonTest/kotlin/org/siloserver/silo/repository/SectionRepositoryCacheTest.ktshared/src/commonTest/kotlin/org/siloserver/silo/watchtogether/RoomDeliveryLatchTest.kt
🚧 Files skipped from review as they are similar to previous changes (24)
- androidApp/src/androidMain/kotlin/org/siloserver/silo/android/ui/screens/home/FeaturedHeroMetadata.kt
- androidApp/src/androidMain/kotlin/org/siloserver/silo/android/ui/screens/player/RoomSyncController.kt
- androidTvApp/src/androidMain/kotlin/org/siloserver/silo/tv/ui/screens/library/TvLibraryDetailScreen.kt
- shared/src/commonTest/kotlin/org/siloserver/silo/watchtogether/RoomDeliveryLatchTest.kt
- androidTvApp/src/androidMain/kotlin/org/siloserver/silo/tv/ui/screens/player/TvRoomSyncController.kt
- shared/src/commonMain/kotlin/org/siloserver/silo/repository/PersonalDataRepository.kt
- androidTvApp/src/androidMain/kotlin/org/siloserver/silo/tv/ui/shell/TvTopMenuBar.kt
- shared/src/commonMain/kotlin/org/siloserver/silo/watchtogether/RoomDeliveryLatch.kt
- androidTvApp/src/androidMain/kotlin/org/siloserver/silo/tv/ui/shell/TvTopMenuFocusRequest.kt
- docs/superpowers/plans/2026-07-28-android-tv-active-header-focus-editorial-hero.md
- androidTvApp/src/androidMain/kotlin/org/siloserver/silo/tv/ui/screens/recommendations/TvForYouEntryRequest.kt
- shared/src/commonMain/kotlin/org/siloserver/silo/repository/CatalogRepository.kt
- docs/superpowers/plans/2026-07-27-android-tv-navigation-remediation.md
- shared/src/commonTest/kotlin/org/siloserver/silo/repository/SectionRepositoryCacheTest.kt
- .superpowers/sdd/2026-07-28-android-tv-active-header-focus-editorial-hero/task-4-report.md
- androidTvApp/src/androidUnitTest/kotlin/org/siloserver/silo/tv/ui/screens/recommendations/TvForYouEntryRequestTest.kt
- docs/superpowers/plans/2026-07-28-android-phone-library-chrome-inset.md
- androidTvApp/src/androidUnitTest/kotlin/org/siloserver/silo/tv/ui/components/TvFocusMarqueeModelTest.kt
- androidTvApp/src/androidMain/kotlin/org/siloserver/silo/tv/ui/components/TvFocusMarqueeModel.kt
- androidTvApp/src/androidMain/kotlin/org/siloserver/silo/tv/ui/shell/TvMainShell.kt
- androidTvApp/src/androidMain/kotlin/org/siloserver/silo/tv/ui/components/TvSkylineSectionFeed.kt
- docs/reviews/2026-07-27-android-tv-navigation-remediation-executive-summary.md
- shared/src/commonMain/kotlin/org/siloserver/silo/repository/SectionRepository.kt
- androidApp/src/androidMain/kotlin/org/siloserver/silo/android/ui/screens/libraries/LibrariesScreen.kt
Executive summary
This release branch fixes the reported first-load navigation and For You regressions, makes phone and TV browse chrome/focus behavior consistent, replaces technical hero badges with editorial metadata, and closes the serious Watch Together/lifecycle defects found during the final code audit.
External testing confirmed the original sluggish navigation, For You routing, active-tab focus, and library presentation fixes. No server, protocol, schema, proxy, or production configuration changes are included.
User-facing changes
runTestschedulerReliability and lifecycle fixes
Fixes #121.
Fixes #122.
Verification
BUILD SUCCESSFUL— 313/313 tasks in 3m31sgit diff --check: passedThe reconnect regression proves:
Scope
Android phone, Android TV, and their shared Android/common modules only. No physical-device installation is part of this PR.
Summary by CodeRabbit
New Features
Bug Fixes