Repository navigation
Refine tvOS startup paint and top menu focus - #89
Conversation
- Prefetch profiles on authenticated cold launches and hydrate the top-bar avatar from cache (single-flight join with the prefetch) - Deepen the tvOS home artwork warmup (12 -> 28 URLs) to cover the first screen's cards, marquee logo, and backdrop - Paint prefetched art synchronously in CachedAsyncImage: the prefetchers warm the bare-URL cache key, which the resized render request always missed, forcing an async re-decode on first paint - Seed the focus marquee with the first row's first item on cold entry instead of waiting for focus + rest debounce - Snap in the initial backdrop, marquee block, and cached logo; only content-to-content swaps keep the ambient crossfade - Let the focus engine's initial resolution land on the first card (defaultFocus .automatic) so it renders pre-focused instead of growing after the page paints; d-pad movement stays geometric
- Cache sampled backdrop tints in HeroBackdropPalette with a synchronous cachedTint(for:) lookup - Warm the first home item's tint during the startup splash prefetch - Apply a cached tint synchronously in the marquee model so the seeded backdrop and its color wash land on the same frame - Snap the initial tint in TVRootHeroBackdrop; tint-to-tint changes keep the ambient crossfade
- Seed TVMainTabView's libraries and currentProfile from the startup prefetch cache so the bar's first frame after the splash has all type tabs and the avatar instead of popping them in a beat later. - Move the search button into the centered tab cluster, left of Home, balanced by an invisible trailing twin so the tabs stay screen-centered. - Choose the focus owner explicitly when the nav stack pops to root: re-assert bar suppression (the engine's restore could land on the last bar element for a frame), and hand focus back to the bar for routes pushed from it (search, profile / For You panel items) instead of letting the engine free-resolve onto an arbitrary row card.
|
Warning Review limit reached
Next review available in: 49 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 (1)
📝 WalkthroughWalkthroughChangestvOS experience
Estimated code review effort: 4 (Complex) | ~45 minutes Sequence Diagram(s)sequenceDiagram
participant StartupContentPrefetcher
participant HeroBackdropPalette
participant TVSkylineSectionFeed
participant TVFocusMarquee
participant TVRootHeroBackdrop
StartupContentPrefetcher->>HeroBackdropPalette: sample and cache hero tint
TVSkylineSectionFeed->>TVFocusMarquee: seed first section item
TVFocusMarquee->>HeroBackdropPalette: read cached tint
TVFocusMarquee->>TVRootHeroBackdrop: display initial artwork and tint
TVRootHeroBackdrop->>TVRootHeroBackdrop: enable transitions after first artwork
Possibly related PRs
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 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.
🧹 Nitpick comments (1)
iosApp/iosApp/Startup/StartupContentPrefetcher.swift (1)
401-409: 🚀 Performance & Scalability | 🔵 Trivial | ⚡ Quick winGate the tint warmup to tvOS.
HeroBackdropPalette.tintColoris consumed only by tvOS's focus marquee/hero backdrop (per the suppliedTVFocusMarquee/TVRootHeroBackdropevidence). This new warmup task runs unconditionally in shared code, so phone/other platforms pay for an image fetch + CIImage average-color sample with no consumer, unlike themaxHomeArtworkURLssplit just above (lines 5-12) which is already platform-gated.♻️ Proposed fix
guard !urls.isEmpty else { return } PosterImageCache.prefetcher.startPrefetching(with: urls) + `#if` os(tvOS) // Warm the marquee's initial tint: tvOS seeds the marquee with the // first row's first item on cold entry, and a cached sample lets the // tint wash paint on the same frame as the backdrop instead of // fading up from the black background once sampling finishes. if let firstBackdrop = normalizedURL(from: contentSections.first?.items.first?.backdropUrl) { Task { _ = await HeroBackdropPalette.tintColor(for: firstBackdrop) } } + `#endif` }🤖 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 `@iosApp/iosApp/Startup/StartupContentPrefetcher.swift` around lines 401 - 409, Gate the HeroBackdropPalette.tintColor warmup in StartupContentPrefetcher to tvOS only, using the existing platform-conditional pattern near maxHomeArtworkURLs. Keep the normalized first backdrop selection and Task behavior unchanged within the tvOS branch, and avoid scheduling the image fetch or palette sampling on other platforms.
🤖 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.
Nitpick comments:
In `@iosApp/iosApp/Startup/StartupContentPrefetcher.swift`:
- Around line 401-409: Gate the HeroBackdropPalette.tintColor warmup in
StartupContentPrefetcher to tvOS only, using the existing platform-conditional
pattern near maxHomeArtworkURLs. Keep the normalized first backdrop selection
and Task behavior unchanged within the tvOS branch, and avoid scheduling the
image fetch or palette sampling on other platforms.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro Plus
Run ID: cfb8d968-bc75-40bf-876f-f75ededef30d
📒 Files selected for processing (11)
iosApp/iosApp/Components/HeroBackdropPalette.swiftiosApp/iosApp/Components/MediaRow.swiftiosApp/iosApp/Screens/Home/SectionRow.swiftiosApp/iosApp/Screens/Player/tvOS/TVPlayerControls.swiftiosApp/iosApp/Startup/StartupContentPrefetcher.swiftiosApp/iosApp/tvOS/Caching/CachedAsyncImage.swiftiosApp/iosApp/tvOS/Components/TVFocusMarquee.swiftiosApp/iosApp/tvOS/Components/TVRootHeroBackdrop.swiftiosApp/iosApp/tvOS/Components/TVSkylineSectionFeed.swiftiosApp/iosApp/tvOS/Navigation/TVMainTabView.swiftiosApp/iosApp/tvOS/Navigation/TVTopMenuBar.swift
Summary
CachedAsyncImageso cards never flash black;TVMainTabViewseedslibraries/currentProfilefrom the prefetch cache, so all type tabs and the avatar are in the bar's first frame instead of popping in late.Test plan
Summary by CodeRabbit
New Features
Bug Fixes