fix(ui): portal fullscreen lyrics so opacity tween doesn't bleed through#140
Conversation
LyricsPanel is a `motion.aside` that animates `opacity: 0 -> 1` on mount. FullscreenLyrics was rendered as its descendant, so the opacity tween applied to the whole subtree: switching from the immersive Now Playing view to fullscreen lyrics flashed the regular app UI (search bar, sidebar) through the still-transparent overlay for the duration of the spring animation. The reverse direction was fine because LyricsPanel was already fully opaque by then. Portal the overlay to `document.body` so it sits as a sibling of the root and renders at full opacity from the first paint. The panel still owns the lyrics fetch + parse state — only the rendered subtree moves.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughLe rendu de l'overlay lyrics passe à un React Portal monté sur document.body ; parallèlement, les classes d'animation et les fonds floutés sont déplacés des conteneurs externes vers des wrappers absolus dans FullscreenLyrics et FullscreenNowPlaying. ChangesOverlay UI & mounting
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Suggested labels
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
… flashing `animate-fade-in` was on the outer wrapper of both FullscreenNowPlaying and FullscreenLyrics, so during the 300 ms opacity 0 -> 1 ramp the overlay itself was semi-transparent and the home view (search bar, cards, sidebar) showed through. Move the keyframe down one level: outer wrapper paints solid `bg-zinc-950` from frame 1 (blocks the page underneath), and the blurred-artwork backdrop + foreground content each fade in on top. The user-facing transition still looks like a 300 ms fade — without the ghost-of-home-view flash behind it.
Bug
Switching from the immersive Now Playing view (`FullscreenNowPlaying`) to the fullscreen lyrics view via the lyrics button caused a ~500 ms glitch where the regular app UI (search bar, sidebar, top bar) was visible through the new overlay. The reverse direction (lyrics → immersive) was unaffected.
Root cause
`LyricsPanel` is a `motion.aside` with `initial={{ width: 0, opacity: 0 }}` (LyricsPanel.tsx#L180-L186), animating to full opacity over a spring tween (~500 ms). `FullscreenLyrics` was rendered as a descendant of that motion subtree (LyricsPanel.tsx#L329), so:
Fix
Portal `FullscreenLyrics` to `document.body` via `react-dom/createPortal`, so the rendered subtree sits next to `` instead of inside the animated `motion.aside`. The panel still owns the lyrics fetch / parse state — only the visual subtree moves. Same pattern already used in `QueuePanel.tsx` for the dnd-kit drag overlay.
Test plan
Summary by CodeRabbit