From e5950b64935265e6413752874ee3af9fbfe924ea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Padez?= Date: Wed, 29 Jul 2026 18:34:44 +0000 Subject: [PATCH] music: dismiss the dock when playback ends MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The in-flow music dock reserves its height whenever a track is loaded (current), even paused — so after a queue finished (onEndOfQueue set playing=false but kept the queue) the dock lingered, shifting the layout up with a faint idle bar. On natural end-of-queue, close() the queue so the dock releases its space. The saved now-playing snapshot is untouched, so reload still resumes. Co-Authored-By: Claude Opus 4.8 --- .../officerdev/src/MusicPlayer/MusicPlayerHost.tsx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/workspaces/officerdev/src/MusicPlayer/MusicPlayerHost.tsx b/src/workspaces/officerdev/src/MusicPlayer/MusicPlayerHost.tsx index d58922b3..7ebb5eb2 100644 --- a/src/workspaces/officerdev/src/MusicPlayer/MusicPlayerHost.tsx +++ b/src/workspaces/officerdev/src/MusicPlayer/MusicPlayerHost.tsx @@ -67,6 +67,8 @@ export const MusicPlayerHost = () => { syncIndexRef.current = syncIndex; const setPlayingRef = useRef(setPlaying); setPlayingRef.current = setPlaying; + const closeRef = useRef(close); + closeRef.current = close; const withToken = (u: string) => (token ? `${u}${u.includes('?') ? '&' : '?'}token=${encodeURIComponent(token)}` : u); const streamUrl = (t: PlayerTrack) => @@ -101,7 +103,9 @@ export const MusicPlayerHost = () => { engineIndexRef.current = i; // engine advanced on its own → mirror to UI without restarting syncIndexRef.current(i); }, - onEndOfQueue: () => setPlayingRef.current(false), + // Queue finished on its own → clear it so the in-flow dock releases its space (no idle bar lingering + // after playback). The saved snapshot is left intact, so a reload still resumes where you left off. + onEndOfQueue: () => closeRef.current(), onLoadingChange: setLoading, }); engineRef.current = engine;