Repository navigation
fix(tv): keep the For You list selection, scroll, and a legible top bar - #156
Conversation
Reported against v1.0.0+3 (83e23da), which already contains the recent TV focus batch — these are live on current code, not stale-release artifacts. **Watchlist and Favorites reverted to For You after opening an item.** `savedListSelection` was a plain `remember`, so opening an item disposed the composition and the value re-initialised from `entryRequest.selection` on the way back. Top-level For You entry carries `selection = null`, so returning from a Watchlist item did not merely forget the list — it actively reselected the recommendations feed. `lastAppliedEntrySequence` had to move with it. Left as `remember` it resets to 0, which makes the entry-request effect treat the unchanged request as new and re-apply its selection — reintroducing the same jump even once the selection itself is saved. Both are now `rememberSaveable`. **Scroll position was lost returning to the feed.** The recommendations `LazyColumn` created its list state inside the `when` branch, so a refresh that briefly flipped to loading/empty and back discarded it. Hoisted above the branch. **The top bar was unreadable over For You.** `TvTopMenuBar` deliberately has no background band of its own and documents that "the SHELL draws a fixed top scrim behind the bar" (QA 2026-07-08) — but the shell drew none, so the labels sat directly on whatever scrolled underneath. On For You that is a poster row. Restored as a gradient rather than a solid band, which satisfies both that contract and the shell's own intent that content stay visible behind the bar. This fixes every route, not just For You. Not addressed: the jerky scrolling on For You, and "cannot scroll the sections" after returning. The latter looks like focus restoration rather than scroll state (on a D-pad, no focus means no scrolling) and belongs with TvRecommendationsFocusBridge; both want their own change. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
|
Warning Review limit reached
Next review available in: 37 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 (2)
📝 WalkthroughWalkthroughThe recommendations screen now persists selection, entry sequence, and feed scroll state. The TV shell adds a top-aligned gradient scrim behind the menu bar. ChangesRecommendations state persistence
TV menu scrim
Estimated code review effort: 2 (Simple) | ~10 minutes Possibly related PRs
Suggested reviewers: 🚥 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 |
Completes the second half of the report: "I can't scroll the For You sections anymore" after opening an item and coming back. The shell already has a detail-return path — a flag set when opening, a resume claim on the content group, and a restorer fallback pointing at the launch card — but every part of it was Home-only, and For You was wired to the raw onOpenItemDetail. Nothing claimed content focus on the way back, so focus settled wherever Compose's default search landed, and the D-pad no longer drove the rows the viewer was just in. Two flags now, deliberately: `restoreContentAfterDetail` means a return is pending for ANY root and gates the resume claim; `restoreHomeContentAfterDetail` additionally means it was the Home feed, which is the only root that attaches homeDetailReturnCardFocusRequester to its launch card. Using that requester as the restorer fallback for a root that never attached it would aim the restorer at a detached node, so Home's behaviour is left byte-identical and For You opts into the claim alone. The screen's own once-per-entry focus grab had to stop fighting it. Its guards were plain `remember`, so a detail return reset them, re-fired the effect and slammed focus onto the Watchlist pill while the feed sat scrolled where the viewer left it — the exact anti-pattern TvMainShell warns about: "fired LaunchedEffects in each screen that imperatively re-focused index 0 — defeating the restorer". Saved, the grab stays genuinely once-per-entry. Jerky scrolling is NOT addressed. The usual causes are ruled out — TvMediaRow carries key and contentType, hoists its row state, and memoises its item mapping on remember(items, showProgress, style, cardLayout) — so what remains (image decode during scroll, focus-driven recomposition, the absence of the skyline feed's settled-focus prefetch policy on this plain LazyColumn) needs a device profile rather than a guess. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 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/shell/TvMainShell.kt`:
- Around line 1154-1176: Condition the top scrim Box in TvMainShell to render
only when TvTopMenuBar is visible, using the same menu-suppression condition
that hides it on TvMainRoute.Settings. Keep the existing gradient, sizing, and
alignment unchanged for routes where the menu remains visible.
🪄 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: b23218d9-90c0-4ac6-9a0a-f9a4257693de
📒 Files selected for processing (2)
androidTvApp/src/androidMain/kotlin/org/siloserver/silo/tv/ui/screens/recommendations/TvRecommendationsScreen.ktandroidTvApp/src/androidMain/kotlin/org/siloserver/silo/tv/ui/shell/TvMainShell.kt
|
@coderabbitai review |
✅ Action performedReview finished.
|
Reported against v1.0.0+3 (
83e23da1). That build already contains the recent TV focus batch, so these are live on current code rather than artifacts of an old release.Four of the five reported issues; the other two are called out at the bottom as deliberately not addressed.
Watchlist and Favorites reverted to For You after opening an item
savedListSelectionwas a plainremember. Opening an item disposes this screen's composition, so on the way back it re-initialised fromentryRequest.selection— and top-level For You entry carriesselection = null. So returning from a Watchlist item didn't merely forget the list, it actively reselected the recommendations feed. That's why it lands on For You rather than on an empty or default list.lastAppliedEntrySequencehad to move with it. Left asrememberit resets to0, andapplyForYouEntryRequestthen treats the unchanged entry request as new and re-applies its selection — reintroducing the identical jump even once the selection itself is saved. Fixing one without the other looks correct and isn't.Both are now
rememberSaveable.Scroll position lost returning to the feed
The recommendations
LazyColumncreated its list state inside thewhenbranch that renders content. A refresh on return briefly flips that branch to loading/empty and back, discarding the state with it. Hoisted above the branch so it survives.The top bar was unreadable over For You
TvTopMenuBardeliberately has no background band of its own, and says why:The shell drew no such scrim. Its own comment two lines above the bar reads "content remains visible behind the transparent bar" — the two had drifted into contradicting each other, and the bar lost. With nothing behind it the labels sat directly on whatever scrolled underneath; on For You that's a poster row.
Restored in the shell as a gradient rather than a solid band, which satisfies both statements: content stays visible behind the bar, it just stops competing with the labels. Being in the shell it fixes every route, not only For You.
Deliberately not addressed
keyandcontentType, so the usual suspects are ruled out and I'd want to look at image loading during scroll before guessing.TvRecommendationsFocusBridgeand wants its own change.Testing
./gradlew testgreen; both apps assemble. No tests added: per the repo guidelines these are UI changes, and the state-restoration behaviour needs an instrumented test rather than a unit test to be meaningful.Note for CI:
ServerSetupPersistenceTestand two:android-sharedtests have been flaking today independently of any change — verified by re-running on cleanmain.Summary by CodeRabbit