Smoothly crossfade now-playing gradient into Library/Queue background - #123
Merged
Merged
Conversation
Add a continuous MainPagerState.scrollFraction driven by .onScrollGeometryChange on the vertical pager, and composite a small NowPlayingBackgroundFade leaf over the AlbumBackdrop that lerps in systemGroupedBackground by opacity as the user pages toward Library or Up Next. Removes the hard slide/seam; the gradient dissolves exactly into the neighbors' opaque background at page center. Only the tiny leaf reads scrollFraction, so the heavy AlbumBackdrop / NowPlayingView bodies are not invalidated per scroll frame (jetsam RCA). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0152PJuDNPYYxd7SDm4TSvbV
sanylax0
marked this pull request as ready for review
July 21, 2026 06:11
sanylax0
approved these changes
Jul 21, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The now-playing screen's album gradient (
AlbumBackdrop) previously hard-cut against the opaquesystemGroupedBackground(white in light mode / black in dark mode) used by the Library and Up-Next (Queue) pages when paging between them inMainPagerView. This PR makes the gradient dissolve smoothly into that black/white background, eliminating the visible seam.Changes
scrollFractionsignal toMainPagerState(1.0 = now-playing centered, 0 = Library, 2 = Up-Next), driven by.onScrollGeometryChangereadingcontentOffset.y / pageHeighton the vertical pagerScrollView.NowPlayingBackgroundFadecomposited overAlbumBackdropin the now-playing page background. It fadesColor(uiColor: .systemGroupedBackground)in at opacitymin(1, abs(scrollFraction - 1)). At center the full gradient shows; scrolled fully onto a neighbor it becomes exactlysystemGroupedBackground, matching the neighbor page seamlessly.NowPlayingBackgroundFadeleaf readsscrollFraction(via@ObservableMainPagerState), so the heavyAlbumBackdrop/NowPlayingView/ pager body do NOT re-render per scroll frame. This is consistent with the app's jetsam/OOM guardrails. No live.blurintroduced.Single file changed:
App/Continuity/Views/MainPagerView.swift. Commit8a38e64.Testing
App-target SwiftUI code cannot be compiled on Linux CI (only the ContinuityCore package is Linux-testable), so this was validated by review of SwiftUI API usage and Swift syntax.
.onScrollGeometryChangeis iOS 18+ and the app targets iOS 26, so it is available. Device verification pending on real hardware.Slack thread: https://continuity-org.slack.com/archives/C0BCTF2C5NK/p1784611489906939
Generated by Claude Code