Commit 30b4016d authored by Aryan Noshirvnai's avatar Aryan Noshirvnai

Add will-change hints to animated overlays (real-device stuck-transition fix)

User reported FullPlayer's Queue/Lyrics panels occasionally freeze
mid-slide after backing out, only on a real phone. Traced the full
React/history state machine for every close path (Escape, backdrop,
X, system back button, rapid/interrupted sequences) via 6 scripted
reproductions - the underlying state and resulting CSS classes are
already correct in every case, which points at Android's predictive-
back gesture: its compositor-level preview snapshot can catch an
element mid-transition on a layer that wasn't already GPU-promoted.
Added will-change-transform to every transitioning overlay (FullPlayer
itself, its Queue/Lyrics panels, the three shared bottom-sheet modals,
and Layout's More sheet) so the browser promotes the layer proactively
instead of mid-transition. Best-effort pending real-device
confirmation - documented in Roadmap with the next lead if it recurs.
Co-Authored-By: 's avatarClaude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019i3NAUkLkHNbsPg5vKfzF9
parent c28afaef
Pipeline #1153 passed with stage
in 8 minutes and 54 seconds
...@@ -110,7 +110,7 @@ export function AddToPlaylistModal({ song, onClose }: AddToPlaylistModalProps) { ...@@ -110,7 +110,7 @@ export function AddToPlaylistModal({ song, onClose }: AddToPlaylistModalProps) {
onClick={requestClose} onClick={requestClose}
> >
<div <div
className={`flex max-h-[80vh] w-full max-w-md flex-col overflow-hidden rounded-t-2xl bg-surface-container transition-all duration-300 ease-out motion-reduce:transition-none sm:rounded-2xl ${ className={`flex max-h-[80vh] w-full max-w-md flex-col overflow-hidden rounded-t-2xl bg-surface-container will-change-transform transition-all duration-300 ease-out motion-reduce:transition-none sm:rounded-2xl ${
// Mobile slides up as a true bottom sheet; desktop's centered card instead does a // Mobile slides up as a true bottom sheet; desktop's centered card instead does a
// gentle fade+rise (matching FullPlayer's own idiom) since a full-height slide would // gentle fade+rise (matching FullPlayer's own idiom) since a full-height slide would
// travel an oddly large distance for a card that isn't anchored to an edge there. // travel an oddly large distance for a card that isn't anchored to an edge there.
......
...@@ -175,7 +175,7 @@ export function FullPlayer() { ...@@ -175,7 +175,7 @@ export function FullPlayer() {
role="dialog" role="dialog"
aria-modal="true" aria-modal="true"
aria-label={`Now playing: ${currentSong.title} by ${currentSong.artist}`} aria-label={`Now playing: ${currentSong.title} by ${currentSong.artist}`}
className={`fixed inset-0 z-30 overflow-hidden bg-background text-on-surface transition-all duration-300 ease-out motion-reduce:transition-none ${ className={`fixed inset-0 z-30 overflow-hidden bg-background text-on-surface will-change-transform transition-all duration-300 ease-out motion-reduce:transition-none ${
visible ? 'translate-y-0 opacity-100' : 'translate-y-6 opacity-0' visible ? 'translate-y-0 opacity-100' : 'translate-y-6 opacity-0'
}`} }`}
> >
...@@ -195,9 +195,14 @@ export function FullPlayer() { ...@@ -195,9 +195,14 @@ export function FullPlayer() {
</div> </div>
{/* Main screen: cover/lyrics (crossfaded in place), transport, and a lyrics toggle bar. {/* Main screen: cover/lyrics (crossfaded in place), transport, and a lyrics toggle bar.
Slides left and out of view when the Queue screen is open. */} Slides left and out of view when the Queue screen is open. will-change-transform
promotes this to its own compositor layer proactively (rather than mid-transition) -
without it, Android's predictive-back gesture preview (which rasterizes the page for
its own animated preview) can catch this element mid-slide and leave the transition
visually stuck even though the underlying queueOpen state and classes are already
correct - a real device-only rendering issue, not a logic bug in this component. */}
<div <div
className={`absolute inset-0 flex flex-col transition-transform duration-300 ease-out motion-reduce:transition-none ${ className={`absolute inset-0 flex flex-col will-change-transform transition-transform duration-300 ease-out motion-reduce:transition-none ${
queueOpen ? '-translate-x-1/4 opacity-0' : 'translate-x-0 opacity-100' queueOpen ? '-translate-x-1/4 opacity-0' : 'translate-x-0 opacity-100'
}`} }`}
aria-hidden={queueOpen} aria-hidden={queueOpen}
...@@ -259,7 +264,7 @@ export function FullPlayer() { ...@@ -259,7 +264,7 @@ export function FullPlayer() {
role="region" role="region"
aria-label="Lyrics" aria-label="Lyrics"
aria-hidden={!showLyrics} aria-hidden={!showLyrics}
className={`absolute inset-0 overflow-y-auto rounded-2xl bg-surface-container px-5 py-6 transition-opacity duration-300 ease-out motion-reduce:transition-none ${ className={`absolute inset-0 overflow-y-auto rounded-2xl bg-surface-container px-5 py-6 will-change-transform transition-opacity duration-300 ease-out motion-reduce:transition-none ${
showLyrics ? 'opacity-100' : 'pointer-events-none opacity-0' showLyrics ? 'opacity-100' : 'pointer-events-none opacity-0'
}`} }`}
style={{ style={{
...@@ -431,7 +436,7 @@ export function FullPlayer() { ...@@ -431,7 +436,7 @@ export function FullPlayer() {
jumping to an arbitrary track in a list is a genuinely different action from viewing jumping to an arbitrary track in a list is a genuinely different action from viewing
lyrics for the track that's already playing. */} lyrics for the track that's already playing. */}
<div <div
className={`absolute inset-0 flex flex-col transition-transform duration-300 ease-out motion-reduce:transition-none ${ className={`absolute inset-0 flex flex-col will-change-transform transition-transform duration-300 ease-out motion-reduce:transition-none ${
queueOpen ? 'translate-x-0' : 'translate-x-full' queueOpen ? 'translate-x-0' : 'translate-x-full'
}`} }`}
aria-hidden={!queueOpen} aria-hidden={!queueOpen}
......
...@@ -206,7 +206,7 @@ export function Layout({ title, children }: { title: string; children: ReactNode ...@@ -206,7 +206,7 @@ export function Layout({ title, children }: { title: string; children: ReactNode
}`} }`}
/> />
<div <div
className={`absolute inset-x-0 bottom-0 rounded-t-2xl border-t border-outline-variant bg-surface-container-low p-4 transition-transform duration-300 ease-out motion-reduce:transition-none ${ className={`absolute inset-x-0 bottom-0 rounded-t-2xl border-t border-outline-variant bg-surface-container-low p-4 will-change-transform transition-transform duration-300 ease-out motion-reduce:transition-none ${
moreSheetVisible ? 'translate-y-0' : 'translate-y-full' moreSheetVisible ? 'translate-y-0' : 'translate-y-full'
}`} }`}
style={{ paddingBottom: 'calc(env(safe-area-inset-bottom) + 16px)' }} style={{ paddingBottom: 'calc(env(safe-area-inset-bottom) + 16px)' }}
......
...@@ -84,7 +84,7 @@ export function RemixSongPicker({ selected, onChange, onClose }: RemixSongPicker ...@@ -84,7 +84,7 @@ export function RemixSongPicker({ selected, onChange, onClose }: RemixSongPicker
onClick={requestClose} onClick={requestClose}
> >
<div <div
className={`flex max-h-[80vh] w-full max-w-md flex-col overflow-hidden rounded-t-2xl bg-surface-container transition-all duration-300 ease-out motion-reduce:transition-none sm:rounded-2xl ${ className={`flex max-h-[80vh] w-full max-w-md flex-col overflow-hidden rounded-t-2xl bg-surface-container will-change-transform transition-all duration-300 ease-out motion-reduce:transition-none sm:rounded-2xl ${
visible ? 'translate-y-0 opacity-100' : 'translate-y-full opacity-0 sm:translate-y-4' visible ? 'translate-y-0 opacity-100' : 'translate-y-full opacity-0 sm:translate-y-4'
}`} }`}
onClick={(e) => e.stopPropagation()} onClick={(e) => e.stopPropagation()}
......
...@@ -88,7 +88,7 @@ export function SongPicker({ onSelect, onClose }: SongPickerProps) { ...@@ -88,7 +88,7 @@ export function SongPicker({ onSelect, onClose }: SongPickerProps) {
onClick={requestClose} onClick={requestClose}
> >
<div <div
className={`flex max-h-[80vh] w-full max-w-md flex-col overflow-hidden rounded-t-2xl bg-surface-container transition-all duration-300 ease-out motion-reduce:transition-none sm:rounded-2xl ${ className={`flex max-h-[80vh] w-full max-w-md flex-col overflow-hidden rounded-t-2xl bg-surface-container will-change-transform transition-all duration-300 ease-out motion-reduce:transition-none sm:rounded-2xl ${
visible ? 'translate-y-0 opacity-100' : 'translate-y-full opacity-0 sm:translate-y-4' visible ? 'translate-y-0 opacity-100' : 'translate-y-full opacity-0 sm:translate-y-4'
}`} }`}
onClick={(e) => e.stopPropagation()} onClick={(e) => e.stopPropagation()}
......
...@@ -150,6 +150,7 @@ const FRONTEND_DONE: DoneGroup[] = [ ...@@ -150,6 +150,7 @@ const FRONTEND_DONE: DoneGroup[] = [
'Every page rebuilt from its matching Stitch screen where one existed (Library, Discovery, Remix, Rooms, Channels, Upload, Business/Admin panels, Now Playing); Login, Playlists, and Telegram linking - which had no Stitch mockup - were designed from scratch to match the same system', 'Every page rebuilt from its matching Stitch screen where one existed (Library, Discovery, Remix, Rooms, Channels, Upload, Business/Admin panels, Now Playing); Login, Playlists, and Telegram linking - which had no Stitch mockup - were designed from scratch to match the same system',
'Spotify-inspired UX pass (2026-08-31), interaction patterns only - color identity deliberately stayed cobalt, not Spotify\'s green, per the earlier decision above: nav active state simplified to bold+accent icon/label with no background chip (both sidebar and mobile tabs now carry real aria-current="page"); Library\'s shared song row overlays play/pause on the artwork itself on hover (always visible, not just on hover, for whichever track is actually current) instead of a separate always-on circular button', 'Spotify-inspired UX pass (2026-08-31), interaction patterns only - color identity deliberately stayed cobalt, not Spotify\'s green, per the earlier decision above: nav active state simplified to bold+accent icon/label with no background chip (both sidebar and mobile tabs now carry real aria-current="page"); Library\'s shared song row overlays play/pause on the artwork itself on hover (always visible, not just on hover, for whichever track is actually current) instead of a separate always-on circular button',
'Motion pass (2026-08-31): the three shared bottom-sheet modals (AddToPlaylistModal, SongPicker, RemixSongPicker) and Layout\'s mobile More sheet popped in/out instantly with zero transition - now wired into useMountTransition (same 300ms fade+rise idiom as FullPlayer/NowPlayingBar) so they fade the backdrop and slide/rise the panel both ways. The three modals defer calling their real onClose prop until the exit animation actually finishes (a requestClose + closing-state indirection), since the caller still owns whether they exist in the tree at all and would otherwise unmount them mid-animation. Every page navigation also gets a subtle fade+rise on mount (Layout re-mounts per page already, so a plain CSS animation is enough - no router-level transition machinery needed), and EmptyState now fades in instead of appearing flat', 'Motion pass (2026-08-31): the three shared bottom-sheet modals (AddToPlaylistModal, SongPicker, RemixSongPicker) and Layout\'s mobile More sheet popped in/out instantly with zero transition - now wired into useMountTransition (same 300ms fade+rise idiom as FullPlayer/NowPlayingBar) so they fade the backdrop and slide/rise the panel both ways. The three modals defer calling their real onClose prop until the exit animation actually finishes (a requestClose + closing-state indirection), since the caller still owns whether they exist in the tree at all and would otherwise unmount them mid-animation. Every page navigation also gets a subtle fade+rise on mount (Layout re-mounts per page already, so a plain CSS animation is enough - no router-level transition machinery needed), and EmptyState now fades in instead of appearing flat',
'`will-change-transform` added to every one of the above transitioning surfaces plus FullPlayer\'s Queue/Lyrics panels (2026-09-01), addressing a real-device-only report of panels freezing mid-slide when backing out. Extensive tracing (both logic-level and 6 separate scripted reproductions covering every close path - Escape, backdrop, X, and the system back button, including rapid/interrupted sequences) found the React state and resulting CSS classes are already correct in every case, which points at Android\'s predictive-back gesture (its own compositor-level preview snapshot can catch an element mid-transition on a layer that wasn\'t already GPU-promoted) rather than an app logic bug - will-change proactively promotes the layer instead of letting the browser upgrade it mid-transition. Best-effort fix pending confirmation on a real device; if it recurs, the next lead is a pagehide/pageshow-driven forced reflow',
], ],
}, },
{ {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment