Skip to content

Smoothly crossfade now-playing gradient into Library/Queue background - #123

Merged
sanylax0 merged 1 commit into
mainfrom
claude/slack-session-wxfs6u
Jul 21, 2026
Merged

sanylax0 merged 1 commit into
mainfrom
claude/slack-session-wxfs6u

Conversation

@sanylax2

Copy link
Copy Markdown
Collaborator

Summary

The now-playing screen's album gradient (AlbumBackdrop) previously hard-cut against the opaque systemGroupedBackground (white in light mode / black in dark mode) used by the Library and Up-Next (Queue) pages when paging between them in MainPagerView. This PR makes the gradient dissolve smoothly into that black/white background, eliminating the visible seam.

Changes

  • Added a continuous scrollFraction signal to MainPagerState (1.0 = now-playing centered, 0 = Library, 2 = Up-Next), driven by .onScrollGeometryChange reading contentOffset.y / pageHeight on the vertical pager ScrollView.
  • Added an isolated leaf overlay view NowPlayingBackgroundFade composited over AlbumBackdrop in the now-playing page background. It fades Color(uiColor: .systemGroupedBackground) in at opacity min(1, abs(scrollFraction - 1)). At center the full gradient shows; scrolled fully onto a neighbor it becomes exactly systemGroupedBackground, matching the neighbor page seamlessly.
  • Performance-safe: only the tiny NowPlayingBackgroundFade leaf reads scrollFraction (via @Observable MainPagerState), so the heavy AlbumBackdrop / NowPlayingView / pager body do NOT re-render per scroll frame. This is consistent with the app's jetsam/OOM guardrails. No live .blur introduced.

Single file changed: App/Continuity/Views/MainPagerView.swift. Commit 8a38e64.

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. .onScrollGeometryChange is 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

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
sanylax0 marked this pull request as ready for review July 21, 2026 06:11
@sanylax0
sanylax0 merged commit c46a0be into main Jul 21, 2026
4 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.

3 participants