[GH-ISSUE #3070] [Issue]: On mobile, the floating music/Spotify/YouTube mini-widget (z-60) covers the slide-in right/tracker/detail panel header tabs because it stacks above them (z-40) #1636

Closed
opened 2026-10-21 05:41:10 +07:00 by bsakaguchi · 1 comment
Owner

Originally created by @kolacheee on GitHub (Jun 29, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/3070

Originally assigned to: @SpicyMarinara on GitHub.

What's wrong
On a phone, the floating media mini-widget (local music, Spotify, or YouTube) always paints on top of any slide-in mobile panel you open. The three persistent floating widgets render at z-[60], while every overlay mobile panel — the right Settings/Tools panel, the tracker data panel, and the detail editor sheet — renders at z-40 (their backdrops at z-30). Because the widget's z-index is higher, whenever music or a video is playing the widget floats over whichever panel you open. Its default spot is the top-left corner (x:16, y:96), and the panels start ~48px from the top, so the widget lands inside the panel's header/tab strip and covers those controls. Taps in that region hit the widget instead of the panel. It is draggable, so you can shove it aside — that's why this is degraded-but-recoverable rather than a hard block. (Note: the same overlap also hits the mobile sidebar drawer, which is z-40 too.)

How to reproduce (try it yourself)

  1. On a phone-width viewport (<=767px, where the shell is in overlay mode), start any local music track / Spotify / YouTube playback so the floating mini-widget appears. It defaults to the top-left corner, collapsed, at roughly 16px from the left and 96px from the top.
  2. Tap the right-panel toggle (Settings/Tools) or the tracker-panel toggle in the top bar to slide a panel in over the chat.
  3. Look at the panel's upper-left header / tab row.

You'll see: the media widget sitting on top of the panel header, covering the tab buttons or header controls underneath it; taps in that area hit the widget, not the panel.
Expected: the panel you deliberately opened should sit above an ambient floating widget — or the widget should drop below the panel / hide while a full-screen mobile panel is open.

Where it is
The three mobile floating widgets all use z-[60] on their md:hidden mobile branch:

  • packages/client/src/components/chat/LocalMusicPlayer.tsx:378 — className="fixed z-[60] touch-none select-none md:hidden"
  • packages/client/src/components/spotify/SpotifyMiniPlayer.tsx:1031 — cn("fixed z-[60] touch-none select-none", mobile && "md:hidden")
  • packages/client/src/components/chat/YouTubePlayer.tsx:543 — className="fixed z-[60] touch-none select-none md:hidden"

Default position { x: 16, y: 96 } and collapsed-by-default come from packages/client/src/stores/ui.store.ts:1206 (spotifyMobileWidgetPosition: { x: 16, y: 96 }) and ui.store.ts:1205 (spotifyMobileWidgetCollapsed: true).

The panels render LOWER, all at z-40:

  • packages/client/src/components/layout/AppShell.tsx:903 — mobile tracker panel mari-tracker-panel !fixed bottom-0 z-40 ...
  • AppShell.tsx:938 — mobile right panel mari-right-panel !fixed bottom-0 right-0 z-40 !w-full ...
  • AppShell.tsx:986 — mobile detail sheet mari-mobile-detail-sheet !fixed bottom-0 right-0 z-40 ... !w-full ...
  • AppShell.tsx:804 — the mobile sidebar drawer is ALSO z-40 (same overlap surface, not in the original report)

All four are positioned with MOBILE_SHELL_PANEL_TOP_CLASS = "top-[calc(env(safe-area-inset-top)_+_3rem)]" (AppShell.tsx:97), i.e. ~48px + inset from the top. Their backdrops are z-30 (AppShell.tsx:920 and :885).

The floating widgets are mounted globally at packages/client/src/components/layout/AppShell.tsx:1017-1019 (<SpotifyMobileWidget /> <YouTubeMobileWidget /> <LocalMusicMobileWidget />), so they persist regardless of which panel is open. (For the record: these are NOT mounted from TopBar — TopBar mounts the separate desktop in-bar pill players.)

The desktop in-bar players are a separate, non-floating render path (LocalMusicPlayer.tsx:439, SpotifyMiniPlayer.tsx:1087, YouTubePlayer.tsx:605) and have no z-index dependency.

What's happening
The media widget and the panels are both position: fixed direct children of the AppShell root, which is fixed inset-0 flex overflow-hidden with no transform/isolate/z-index of its own (AppShell.tsx:766-772). That means there is no separate stacking context — the widget and the panels are pure z-index siblings, and stacking is decided purely by z-index. z-60 > z-40, so the widget always wins and paints over the panel body. Framer Motion's transform on the panel's motion.aside only isolates the panel's own subtree, not the sibling widget. And because the widget's collapsed default coordinate (y:96) falls ~48px below the panel's top edge, inside the full-width panel's header region, the overlap is guaranteed, not incidental.

Suggested fix
Lower the three mobile floating widgets below the shell-panel layer by changing their z-[60] to z-[35] (between the z-30 backdrop and the z-40 panels):

  • LocalMusicPlayer.tsx:378 → fixed z-[35] touch-none select-none md:hidden
  • YouTubePlayer.tsx:543 → fixed z-[35] touch-none select-none md:hidden
  • SpotifyMiniPlayer.tsx:1031 → cn("fixed z-[35] touch-none select-none", mobile && "md:hidden")

z-35 keeps the widget above the chat content and the z-30 backdrop during normal playback, but tucks it behind every open mobile overlay — the right/tracker/detail panels AND the sidebar drawer, all of which are z-40. Do NOT use the alternative "hide the widget while a panel is open" gate: it would unmount the widget and tear down its inner <audio>/YouTube iframe, stopping playback, and it misses the sidebar-drawer surface.

Regression avoided: Desktop and >=768px are untouched — the z-[60]/z-[35] token only lives on the md:hidden mobile floating branch; desktop renders via a separate in-bar pill path with no z-index dependency. There is no theme coupling (globals.css has no widget/z-index override for light/dark/sillytavern; its @media (pointer: coarse) block only touches scrollbars and input font-size). In normal no-panel mobile playback the widget still floats above the chat because z-35 > z-30 and nothing in the chat content is positioned above it. As a bonus, the game-mode .game-party-sidebar (z-50 on mobile) now correctly covers the widget too. The widget stays mounted, so playback continues uninterrupted.

AI-investigated against v2.0.6 (packages/client); cited lines read and confirmed. Mobile layout verified by reading the computed Tailwind classes + globals.css, not on a device — please confirm on a phone before fixing.

Originally created by @kolacheee on GitHub (Jun 29, 2026). Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/3070 Originally assigned to: @SpicyMarinara on GitHub. **What's wrong** On a phone, the floating media mini-widget (local music, Spotify, or YouTube) always paints on top of any slide-in mobile panel you open. The three persistent floating widgets render at `z-[60]`, while every overlay mobile panel — the right Settings/Tools panel, the tracker data panel, and the detail editor sheet — renders at `z-40` (their backdrops at `z-30`). Because the widget's z-index is higher, whenever music or a video is playing the widget floats over whichever panel you open. Its default spot is the top-left corner (x:16, y:96), and the panels start ~48px from the top, so the widget lands inside the panel's header/tab strip and covers those controls. Taps in that region hit the widget instead of the panel. It is draggable, so you can shove it aside — that's why this is degraded-but-recoverable rather than a hard block. (Note: the same overlap also hits the mobile sidebar drawer, which is `z-40` too.) **How to reproduce (try it yourself)** 1. On a phone-width viewport (<=767px, where the shell is in overlay mode), start any local music track / Spotify / YouTube playback so the floating mini-widget appears. It defaults to the top-left corner, collapsed, at roughly 16px from the left and 96px from the top. 2. Tap the right-panel toggle (Settings/Tools) or the tracker-panel toggle in the top bar to slide a panel in over the chat. 3. Look at the panel's upper-left header / tab row. You'll see: the media widget sitting on top of the panel header, covering the tab buttons or header controls underneath it; taps in that area hit the widget, not the panel. Expected: the panel you deliberately opened should sit above an ambient floating widget — or the widget should drop below the panel / hide while a full-screen mobile panel is open. **Where it is** The three mobile floating widgets all use `z-[60]` on their `md:hidden` mobile branch: - `packages/client/src/components/chat/LocalMusicPlayer.tsx:378` — `className="fixed z-[60] touch-none select-none md:hidden"` - `packages/client/src/components/spotify/SpotifyMiniPlayer.tsx:1031` — `cn("fixed z-[60] touch-none select-none", mobile && "md:hidden")` - `packages/client/src/components/chat/YouTubePlayer.tsx:543` — `className="fixed z-[60] touch-none select-none md:hidden"` Default position `{ x: 16, y: 96 }` and collapsed-by-default come from `packages/client/src/stores/ui.store.ts:1206` (`spotifyMobileWidgetPosition: { x: 16, y: 96 }`) and `ui.store.ts:1205` (`spotifyMobileWidgetCollapsed: true`). The panels render LOWER, all at `z-40`: - `packages/client/src/components/layout/AppShell.tsx:903` — mobile tracker panel `mari-tracker-panel !fixed bottom-0 z-40 ...` - `AppShell.tsx:938` — mobile right panel `mari-right-panel !fixed bottom-0 right-0 z-40 !w-full ...` - `AppShell.tsx:986` — mobile detail sheet `mari-mobile-detail-sheet !fixed bottom-0 right-0 z-40 ... !w-full ...` - `AppShell.tsx:804` — the mobile sidebar drawer is ALSO `z-40` (same overlap surface, not in the original report) All four are positioned with `MOBILE_SHELL_PANEL_TOP_CLASS = "top-[calc(env(safe-area-inset-top)_+_3rem)]"` (`AppShell.tsx:97`), i.e. ~48px + inset from the top. Their backdrops are `z-30` (`AppShell.tsx:920` and `:885`). The floating widgets are mounted globally at `packages/client/src/components/layout/AppShell.tsx:1017-1019` (`<SpotifyMobileWidget /> <YouTubeMobileWidget /> <LocalMusicMobileWidget />`), so they persist regardless of which panel is open. (For the record: these are NOT mounted from TopBar — TopBar mounts the separate desktop in-bar pill players.) The desktop in-bar players are a separate, non-floating render path (`LocalMusicPlayer.tsx:439`, `SpotifyMiniPlayer.tsx:1087`, `YouTubePlayer.tsx:605`) and have no z-index dependency. **What's happening** The media widget and the panels are both `position: fixed` direct children of the AppShell root, which is `fixed inset-0 flex overflow-hidden` with no `transform`/`isolate`/`z-index` of its own (`AppShell.tsx:766-772`). That means there is no separate stacking context — the widget and the panels are pure z-index siblings, and stacking is decided purely by z-index. `z-60 > z-40`, so the widget always wins and paints over the panel body. Framer Motion's transform on the panel's `motion.aside` only isolates the panel's own subtree, not the sibling widget. And because the widget's collapsed default coordinate (y:96) falls ~48px below the panel's top edge, inside the full-width panel's header region, the overlap is guaranteed, not incidental. **Suggested fix** Lower the three mobile floating widgets below the shell-panel layer by changing their `z-[60]` to `z-[35]` (between the `z-30` backdrop and the `z-40` panels): - `LocalMusicPlayer.tsx:378` → `fixed z-[35] touch-none select-none md:hidden` - `YouTubePlayer.tsx:543` → `fixed z-[35] touch-none select-none md:hidden` - `SpotifyMiniPlayer.tsx:1031` → `cn("fixed z-[35] touch-none select-none", mobile && "md:hidden")` `z-35` keeps the widget above the chat content and the `z-30` backdrop during normal playback, but tucks it behind every open mobile overlay — the right/tracker/detail panels AND the sidebar drawer, all of which are `z-40`. Do NOT use the alternative "hide the widget while a panel is open" gate: it would unmount the widget and tear down its inner `<audio>`/YouTube iframe, stopping playback, and it misses the sidebar-drawer surface. Regression avoided: Desktop and >=768px are untouched — the `z-[60]`/`z-[35]` token only lives on the `md:hidden` mobile floating branch; desktop renders via a separate in-bar pill path with no z-index dependency. There is no theme coupling (globals.css has no widget/z-index override for light/dark/sillytavern; its `@media (pointer: coarse)` block only touches scrollbars and input font-size). In normal no-panel mobile playback the widget still floats above the chat because `z-35 > z-30` and nothing in the chat content is positioned above it. As a bonus, the game-mode `.game-party-sidebar` (z-50 on mobile) now correctly covers the widget too. The widget stays mounted, so playback continues uninterrupted. *AI-investigated against v2.0.6 (packages/client); cited lines read and confirmed. Mobile layout verified by reading the computed Tailwind classes + globals.css, not on a device — please confirm on a phone before fixing.*
Author
Owner

@SpicyMarinara commented on GitHub (Jun 29, 2026):

Addressed in PR #3072 by commit 4146a380. Validated locally with pnpm check and pnpm smoke:ui.

<!-- gh-comment-id:4836258659 --> @SpicyMarinara commented on GitHub (Jun 29, 2026): Addressed in PR #3072 by commit 4146a380. Validated locally with pnpm check and pnpm smoke:ui.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Pasta-Devs/Marinara-Engine#1636
No description provided.