watchparty/client/src/styles/base.css
Nicolas b2310216ce
Some checks failed
Publier l'image Docker / publish (push) Has been skipped
Publier l'image Docker / test (push) Failing after 8s
Fix settings menu visibility bug; make the music player a persistent bar
Fix: player settings menu stuck permanently open
----------------------------------------------
.hide { display: none; } and Player.css's .settingsPanel { display: flex;
... } are both single-class selectors - equal specificity - so whichever
one esbuild happened to bundle later into app.css won the `display`
property on an element carrying both classes. Player.css's own
display:flex always landed after base.css's .hide, so #settingsPanel
showed regardless of the hide class ever being toggled - the toggle logic
itself was correct the whole time, it just had no visible effect.

Fixed at the utility class, not the one call site: `.hide` now uses
`display: none !important`, which wins a same-specificity tie regardless
of bundling order - closes off the whole bug class, since several other
components already set their own `display` for a visible state.

Feature: music player is now a persistent bottom bar, not a page
------------------------------------------------------------------
The music player was its own route (/party/:id -> views/musicPlayer/),
which meant navigating anywhere else - the sidebar, an album to queue up
more tracks - tore the whole thing down (router.ts calls a route's
cleanup, which used to call leaveParty, on every hash change). No way to
browse and listen at the same time.

- client/src/musicBar/MusicBar.ts (new): a Shell-level singleton, mounted
  once into a #musicBar element that's a sibling of #mainContent, never
  touched by route changes. Renders as a fixed bottom bar. Exposes
  initMusicBar/joinMusicParty/leaveMusicParty instead of the router's
  render()-returns-cleanup pattern, since it never registers as a route.
- views/player/Player.ts's dispatcher: a music party no longer renders a
  page - it calls joinMusicParty() and bounces back to /home (a no-op for
  every reachable call site except album's). A video party now calls
  leaveMusicParty() first (harmless no-op if nothing's active) - starting
  or joining a video watch party always leaves the listen party, since
  every party-join call site already funnels through this one dispatcher.
- views/album/Album.ts: the last per-track "start a party" UI now that
  the music player's own inline browse panel is gone (browsing just
  means navigating there normally). Each track's button starts a new
  party or adds to whichever one is already active, decided by
  getActiveMusicPartyId() at CLICK time (not render time) so the action
  taken is always correct even if the label is momentarily stale; every
  button is relabeled in place after a successful click. Starting a
  party from here no longer navigates away at all.
- views/musicPlayer/ deleted entirely (MusicPlayer.ts/.html/.css) -
  superseded by musicBar/.
- Comment updates in global.d.ts/presence.css/trackList.css/party.ts/
  types.ts that named the old module by path.

Verified both fixes by rebuilding and driving the real compiled bundle
through a local static server, with fetch/window.io/window.Hls mocked:
starting a party from an album track leaves the sidebar/page in place and
relabels the other tracks; adding a track posts to the already-active
party's id; navigating into a video party hides the bar, disconnects its
socket, and posts a real leave for the music party before the video
player renders; the settings gear opens/closes correctly for the host in
that same run.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-09-14 10:43:12 +02:00

133 lines
4 KiB
CSS

/* Colors pulled live from this Emby server's own active theme (dark), via
its CSS custom properties (--theme-primary-color-*, --background-*, etc.)
- see docs/architecture.md for how these were read directly off the
running server rather than guessed. Loaded once, globally, by app.ts -
every other component/*.css only ever reads these variables, never
redefines them. */
:root {
color-scheme: dark;
--bg: #151216; /* hsl(285, 10%, 7.84%) - Emby's dark theme background */
--bg-header: #221d24; /* same hue, +5% lightness - Emby's header/footer background */
--panel: #262626; /* Emby's card/button/input background (achromatic, ~15-17% lightness) */
--text: #ffffff;
--muted: rgba(255, 255, 255, .6);
--accent: #52b54b; /* Emby's theme-primary-color (hsl(116, 41.7%, 50.2%)) */
--accent-bright: #6ccf65; /* Emby's --theme-accent-text-color-darkbg */
--danger: #ff6b6b;
}
* { box-sizing: border-box; }
html, body {
margin: 0;
height: 100%;
}
body {
background: var(--bg);
color: var(--text);
font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
}
#app { min-height: 100%; }
/* Login is a small centered form - everything else lives inside the app
shell (sidebar + .mainContent) - see shell/Shell.css. */
.wrap {
max-width: 420px;
margin: 0 auto;
padding: 32px 20px 80px;
}
h1 { font-size: 22px; margin: 0; }
h2 { font-size: 16px; margin: 0 0 12px; }
.panel {
background: var(--bg-header);
border-radius: 12px;
padding: 20px;
}
.hint { color: var(--muted); font-size: 13px; margin: 0 0 16px; }
.error { color: var(--danger); font-size: 13px; min-height: 18px; }
label {
display: block;
font-size: 13px;
color: var(--muted);
margin-bottom: 12px;
}
input {
display: block;
width: 100%;
margin-top: 4px;
padding: 10px;
border-radius: 8px;
border: 1px solid #3a3a3a;
background: var(--panel);
color: var(--text);
font-size: 14px;
}
input:focus {
outline: none;
border-color: var(--accent);
}
button {
padding: 12px 16px;
border: none;
border-radius: 8px;
background: var(--accent);
color: white;
font-size: 14px;
font-weight: 600;
cursor: pointer;
}
button:hover { background: var(--accent-bright); }
button[disabled] { opacity: .5; cursor: default; }
/* Class-only (not tag-qualified) so an <a class="linklike"> - e.g. the
"Voir sur Emby" link on the series/album detail pages - gets the same
treatment as the <button> ones without needing its own duplicate rule;
there's no global `a` reset in this file, so an unclassed anchor would
otherwise fall back to the browser's default blue/underline against
this dark theme. */
.linklike {
background: none;
color: var(--muted);
font-size: 12px;
font-weight: 400;
text-decoration: underline;
padding: 4px 0;
}
.linklike:hover { background: none; color: var(--accent-bright); }
.code { color: var(--accent-bright); letter-spacing: .1em; }
/* Generic "title + optional action on the right" header, reused by
home/library/artist/the music player - see each view's own .ts. */
.pageHeader {
display: flex;
align-items: center;
justify-content: space-between;
flex-wrap: wrap;
gap: 12px;
margin-bottom: 20px;
}
/* !important is deliberate, not cargo-culted: .hide is a generic toggle
applied from .ts (classList.add/remove/toggle('hide')) onto elements
whose OWN component CSS often also sets `display` for its visible state
(e.g. .settingsPanel { display: flex; ... } in Player.css). Without
!important, both rules are single-class selectors - equal specificity -
so the cascade falls back to source order, and whichever one esbuild
happens to bundle later wins; that's how #settingsPanel ended up
permanently visible regardless of the 'hide' class (its own display:flex
loaded after base.css's .hide in the bundled app.css). !important makes
.hide win unconditionally, independent of bundling order, for this
element and any future one with the same pattern. */
.hide { display: none !important; }