mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[GH-ISSUE #2795] [Issue]: Mobile: Music DJ YouTube mini-player is open/visible by default (obstructive leftover state) #1420
Labels
No labels
android
bug
bugfix
ci
client
code freeze pause
container
dependencies
docs
documentation
duplicate
enhancement
feature
feature
feature
feature-creep
fixed-in-refactor
fixed-in-staging
good first issue
help wanted
in-pr
in-pr
needs-codeowner-decision
normal-scope
old-codebase
old-codebase
pull-request
qol
question
refactor
regression
revisit later
roadmap
scope-risk
scope-risk
server
server
shared
soup
upstream
windows
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Pasta-Devs/Marinara-Engine#1420
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @kolacheee on GitHub (Jun 22, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/2795
Summary
On mobile, the floating Music DJ YouTube mini-player widget is visible by default on a fresh install — and on most upgraded installs — with no track playing and zero user opt-in. It floats over the empty Chats/CONVO screen, obstructing the UI. Two distinct defects combine: (1) the music-player defaults ship on, and (2) the visible-chrome render guard ignores playback state and ignores the very flag (
youtubePlayerEnabled) whose JSDoc says the pill should only appear "when Music DJ plays a track."Symptom & UX impact (mobile)
nowPlaying, no loading, no error — yet the widget chrome renders.z-[60]) floating widget overlaps content and controls, and the user has no obvious way to understand why it is there (they never enabled music).Steps to reproduce
marinara-engine-uilocalStorage), or upgrade from a pre-v44 build without ever touching music settings.Root cause (exact file:line trace)
Both the mount gate and the visible-chrome gate are
musicPlayerEnabled && musicPlayerSource === "youtube"— and both of those defaults ship on — so the widget renders for every fresh (and most upgraded) installs with nothing playing.Defaults ship on —
packages/client/src/stores/ui.store.ts:1077-1080:On a brand-new install there is no persisted blob, so zustand
persistdoes not runmigrate; these initial values are the live state directly.Always mounted, ungated on conversation —
packages/client/src/components/layout/AppShell.tsx:975renders<YouTubeMobileWidget />in the app chrome regardless of whether any chat is open.Mobile mount gate —
packages/client/src/components/chat/YouTubePlayer.tsx:640-643:Visible-chrome gate ignores playback — inside the player:
YouTubePlayer.tsx:148const musicPlayerActive = useUIStore((s) => s.musicPlayerEnabled && s.musicPlayerSource === "youtube");YouTubePlayer.tsx:181const active = musicPlayerActive && (mobile || desktopViewport);YouTubePlayer.tsx:540{active && (— renders the floating draggable widget.YouTubePlayer.tsx:607{active && (— same problem on desktop top bar.There is no gate on a track actually playing. The component already computes
const hasPlayerContent = !!nowPlaying || loading || !!error;atYouTubePlayer.tsx:385, but it is never used to gate the render. So the widget is visible the moment the app loads.youtubePlayerEnabledis dead code — its JSDoc atui.store.ts:481says: "When true, show the Music DJ YouTube mini player when Music DJ plays a track." It is persisted, has a setter, and is maintained by migrations and the source/enabled setters, but it is never read inYouTubePlayer.tsx(grep: 0 matches). The implemented gate ignores both playback state and this flag — the opposite of the documented intent.Upgrade path inherits the widget — migration
ui.store.ts:2137-2148(version <= 44):So even users who never touched music get
musicPlayerEnabled: true+musicPlayerSource: "youtube"and inherit the visible widget.Convergent trace:
ui.store.ts:481(JSDoc intent) →ui.store.ts:1077-1080(defaults on) /ui.store.ts:2137-2148(upgrade derives on) →AppShell.tsx:975(always mounted) →YouTubePlayer.tsx:640-643(mount gate = enabled, no playback check) →YouTubePlayer.tsx:148,181(active, no playback check) →YouTubePlayer.tsx:540/:607({active && (renders chrome with nothing playing).Suggested fix (concrete)
PRIMARY — intent-honoring, keeps the DJ working (recommended, fixes both mobile and desktop):
In
packages/client/src/components/chat/YouTubePlayer.tsx, gate the visible chrome on real content using the already-computedhasPlayerContent(:385). Change the render guards fromactive &&toactive && hasPlayerContent &&:YouTubePlayer.tsx:540:YouTubePlayer.tsx:607:This leaves the component mounted so the play effect (
YouTubePlayer.tsx:217, which early-returnsif (!active) return) still reacts to the DJ'syoutubePlayintent, but renders no visible chrome untilnowPlaying/loading/erroris set. This alone resolves the user complaint ("player open/visible by default with nothing playing") on both mobile and desktop, and matches theui.store.ts:481JSDoc.OPTIONAL — make music opt-in (only if the team also wants music off until enabled):
Flip defaults in
ui.store.ts:1077-1080:Add a migration using the CORRECT persist version. The store is currently
version: 62(ui.store.ts:1775) with migration blocks running throughversion <= 61. Aversion <= 47block would never run for an existing v62 install, so it must be:and bump
version: 62→version: 63atui.store.ts:1775.Note: with the optional defaults applied, the user must enable music via the settings panel before the DJ can play YouTube — nothing in the DJ play path (
use-generate.ts→agent.store.ts setYoutubePlay) auto-enablesmusicPlayerEnabled. This is acceptable for opt-in but should be stated in the PR description.DO NOT add
youtubePlayerEnabledto the mount gate atYouTubePlayer.tsx:643together with defaultingyoutubePlayerEnabled: false. The DJ play path sets onlyyoutubePlay, neveryoutubePlayerEnabled; if the widget is gated out of mounting it will never see the play intent, permanently breaking YouTube Music DJ playback.Alternatives: ship PRIMARY alone (smallest, safest, fixes the reported symptom on both viewports). Add OPTIONAL only if the product decision is for music to be fully opt-in.
Affected files
packages/client/src/components/chat/YouTubePlayer.tsx— render guards at:540(mobile) and:607(desktop);hasPlayerContentat:385; gates at:148,:181,:640-643; play effect at:217.packages/client/src/stores/ui.store.ts— defaults:1077-1080; JSDoc:481; persistversion:1775; migrations:2137-2148and the migration block list near:2155-2194. (Only touched if the OPTIONAL opt-in fix is applied.)packages/client/src/components/layout/AppShell.tsx— mount site:975(no change needed; reference for the always-mounted behavior).Validation
active && hasPlayerContent &&at:540and:607).pnpm installthenpnpm checkpasses (TypeScript + ESLint). Nopnpm db:pushneeded (client-only).marinara-engine-uilocalStorage): on load with no track playing, no YouTube widget chrome is visible.hasPlayerContentcoversloadinganderror).versionbumped 62 → 63,version <= 62migration resets existing installs; confirm an upgraded profile with no explicit music choice loads with music off.stagingbranch per CLAUDE.md.AI-investigated against released 2.0.0; verify before fixing.
@SpicyMarinara commented on GitHub (Jun 22, 2026):
Addressed in PR #2790 / commit acab1fba: the YouTube mini-player chrome now requires actual player content/loading/error state before it appears, so the saved YouTube source alone no longer shows an empty obstructive player.