feat(queue): add Now-Playing Info tab with artist bio, song credits and Bandsintown tour dates (#244)

* feat(queue): add Now-Playing Info tab with artist bio, song credits and Bandsintown tour dates

A third tab in the right-side queue panel surfaces context for the
currently playing track:

- Artist card: image + biography from Subsonic getArtistInfo (Last.fm
  "Read more on Last.fm" anchor stripped), with read-more toggle that
  only appears when the bio actually overflows the 4-line clamp.
- Song info: contributor credits from OpenSubsonic contributors[]
  rendered stacked (name prominent, role muted). Section is hidden
  entirely on servers without contributor support, and rows that just
  re-state the main artist under role "artist" are filtered out.
- On tour: optional Bandsintown integration (opt-in, off by default).
  HTTP fetch + JSON parsing happen entirely on the Rust side; the
  frontend wrapper deduplicates concurrent calls and caches results in
  RAM for the session. Limited to 5 events with a "Show N more" toggle.
  When the toggle is off, the section becomes an in-place opt-in card
  with a privacy info-tooltip explaining what data is sent — same
  tooltip is also exposed on the matching toggle in Settings.

Caching: artist info and song detail are memoised by stable IDs across
component remounts, so jumping between tracks of the same album/artist
does not refire the network calls.

Implementation notes:
- Bandsintown app_id "js_app_id" — arbitrary strings (e.g. "psysonic")
  now return HTTP 403 from rest.bandsintown.com; js_app_id is the ID
  Bandsintown's own embeddable widget uses and is broadly accepted.
- Tour items use negative left/right margins so the date badge stays
  visually aligned with the section title while the hover background
  extends slightly past the section edges.
- New i18n namespace nowPlayingInfo across all 8 locales (en, de, fr,
  nl, zh, nb, ru, es) including pluralised "Show N more" forms.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* fix(now-playing-info): switch nested flex-columns to block layout to stop content-dependent drift

Repeated reports of the Tour and Song-info sections rendering at
inconsistent x-positions (sometimes left of the section title,
sometimes centred, sometimes correctly aligned) — varying by artist,
sidebar width, and even whether "Show more" was clicked.

Root cause: nested flex-direction: column containers
(.np-info → .np-info-section → .np-info-tour / .np-info-credits) where
the cross-axis (horizontal) sizing on WebKitGTK occasionally inherits
the intrinsic min-content of the longest child. With one
"Naherholungsgebiet/Freizeitgelände Lago Alfredo"-style venue name
that overflows the sidebar, the parent ul gets pushed past 100% width
and the entire layout drifts. min-width: 0 on every level didn't help
because cross-axis stretch in flex-column ignores it for content-driven
overflow.

Fix: collapse all the section/list containers to display: block. Block
layout is content-agnostic — children always render at 100% parent
width, left-aligned, deterministically. Spacing between siblings now
uses the lobotomy selector (`> * + * { margin-top }`).

Only the tour item itself stays flex (badge ↔ meta horizontal layout),
and that one still has overflow: hidden + flex: 1 1 0 + min-width: 0
on the meta column to truncate venue/place text with ellipsis.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Psychotoxical <dev@psysonic.app>
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
Frank Stellmacher
2026-04-21 19:13:18 +02:00
committed by GitHub
parent 76ed6eca55
commit 06140a490b
17 changed files with 1026 additions and 3 deletions
+296
View File
@@ -9574,3 +9574,299 @@ html[data-app-hidden="true"] *::before,
html[data-app-hidden="true"] *::after {
animation-play-state: paused !important;
}
/* ── Now Playing Info panel ──────────────────────────────────────────────── */
.np-info {
flex: 1;
overflow-y: auto;
overflow-x: hidden;
padding: 6px 16px 20px;
display: block;
color: var(--text-primary);
text-align: left;
min-width: 0;
}
.np-info-empty {
flex: 1;
display: flex;
align-items: center;
justify-content: center;
padding: 32px 16px;
color: var(--text-muted);
font-size: 13px;
text-align: center;
}
.np-info-section {
display: block;
padding: 18px 0;
border-bottom: 1px solid color-mix(in srgb, var(--border-subtle, var(--ctp-surface0)) 70%, transparent);
}
.np-info-section > * + * { margin-top: 12px; }
.np-info-section:last-child {
border-bottom: none;
padding-bottom: 4px;
}
.np-info-section:first-child {
padding-top: 10px;
}
.np-info-section-title {
font-size: 10.5px;
font-weight: 700;
text-transform: uppercase;
letter-spacing: 0.08em;
color: var(--text-muted);
text-align: left;
}
/* Artist card */
.np-info-artist-image-wrap {
width: 100%;
aspect-ratio: 16 / 10;
border-radius: 12px;
overflow: hidden;
background: var(--bg-elevated);
box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
}
.np-info-artist-image {
width: 100%;
height: 100%;
object-fit: cover;
display: block;
}
.np-info-artist-body {
display: block;
}
.np-info-artist-body > * + * { margin-top: 8px; }
.np-info-artist-name {
font-size: 22px;
font-weight: 700;
line-height: 1.15;
letter-spacing: -0.01em;
text-align: left;
}
.np-info-artist-bio {
margin: 0;
font-size: 13px;
line-height: 1.55;
color: var(--text-secondary);
text-align: left;
}
.np-info-artist-bio.is-clamped {
display: -webkit-box;
-webkit-box-orient: vertical;
overflow: hidden;
}
.np-info-link-btn {
align-self: flex-start;
background: none;
border: none;
padding: 4px 0;
margin: -2px 0 0;
font-size: 12px;
font-weight: 600;
color: var(--accent);
cursor: pointer;
text-align: left;
}
.np-info-link-btn:hover { text-decoration: underline; }
/* Credits / contributors — stacked: name prominent, role muted underneath */
.np-info-credits {
list-style: none;
margin: 0;
padding: 0;
display: block;
}
.np-info-credit-row {
display: block;
padding: 0;
text-align: left;
}
.np-info-credit-row + .np-info-credit-row { margin-top: 10px; }
.np-info-credit-names {
display: block;
font-size: 14px;
font-weight: 600;
color: var(--text-primary);
text-align: left;
line-height: 1.3;
}
.np-info-credit-role {
display: block;
font-size: 11.5px;
color: var(--text-muted);
text-transform: capitalize;
text-align: left;
margin-top: 1px;
}
/* Tour */
.np-info-tour {
list-style: none;
margin: 0;
padding: 0;
display: block;
}
.np-info-tour > .np-info-tour-item + .np-info-tour-item { margin-top: 6px; }
.np-info-tour-item {
display: flex;
align-items: center;
gap: 12px;
padding: 10px 12px;
background: var(--bg-elevated);
border-radius: 10px;
cursor: pointer;
transition: background 0.15s;
border: none;
text-align: left;
width: 100%;
min-width: 0; /* allow children to shrink past their min-content */
box-sizing: border-box;
overflow: hidden;
}
.np-info-tour-item:hover {
background: color-mix(in srgb, var(--accent) 10%, var(--bg-elevated));
}
.np-info-tour-date {
flex-shrink: 0;
width: 48px;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
padding: 6px 0 5px;
border-radius: 8px;
background: color-mix(in srgb, var(--accent) 16%, transparent);
color: var(--accent);
line-height: 1;
}
.np-info-tour-date-month {
font-size: 10px;
font-weight: 700;
text-transform: uppercase;
letter-spacing: 0.06em;
}
.np-info-tour-date-day {
font-size: 19px;
font-weight: 700;
margin-top: 3px;
font-variant-numeric: tabular-nums;
}
.np-info-tour-meta {
/* `flex: 1 1 0` + `min-width: 0` is the canonical fix for the flex
* truncation bug — without `flex-basis: 0` the meta column inherits
* its intrinsic width from the longest venue/place text, which then
* overflows the parent ul on WebKit. */
flex: 1 1 0;
min-width: 0;
display: flex;
flex-direction: column;
gap: 3px;
overflow: hidden;
}
.np-info-tour-venue {
font-size: 13.5px;
font-weight: 600;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
text-align: left;
}
.np-info-tour-place {
font-size: 11.5px;
color: var(--text-muted);
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
text-align: left;
}
.np-info-tour-when { color: var(--text-secondary); }
.np-info-tour-sep { opacity: 0.55; margin: 0 2px; }
.np-info-tour-empty {
font-size: 13px;
color: var(--text-muted);
padding: 8px 0;
text-align: left;
}
.np-info-tour-credit {
font-size: 10.5px;
color: var(--text-muted);
margin-top: 10px;
text-align: right;
opacity: 0.55;
letter-spacing: 0.02em;
}
.np-info-tour-more {
align-self: center;
margin-top: 4px;
padding: 6px 14px;
background: none;
border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent);
border-radius: 999px;
color: var(--accent);
font-size: 12px;
font-weight: 600;
cursor: pointer;
transition: background 0.15s, border-color 0.15s;
}
.np-info-tour-more:hover {
background: color-mix(in srgb, var(--accent) 12%, transparent);
border-color: var(--accent);
}
/* Bandsintown opt-in prompt — shown in place of tour list when toggle is off */
.np-info-bandsintown-prompt {
display: flex;
flex-direction: column;
gap: 6px;
padding: 14px 16px;
border-radius: 12px;
background: color-mix(in srgb, var(--accent) 8%, var(--bg-elevated));
border: 1px solid color-mix(in srgb, var(--accent) 22%, transparent);
}
.np-info-bandsintown-prompt-title {
display: flex;
align-items: center;
gap: 6px;
font-size: 13.5px;
font-weight: 600;
color: var(--text-primary);
}
.np-info-bandsintown-prompt-info {
display: inline-flex;
align-items: center;
justify-content: center;
color: var(--text-muted);
cursor: help;
border-radius: 50%;
padding: 2px;
transition: color 0.15s, background 0.15s;
}
.np-info-bandsintown-prompt-info:hover,
.np-info-bandsintown-prompt-info:focus-visible {
color: var(--accent);
background: color-mix(in srgb, var(--accent) 12%, transparent);
outline: none;
}
.np-info-bandsintown-prompt-desc {
font-size: 12px;
color: var(--text-secondary);
line-height: 1.45;
}
.np-info-bandsintown-prompt-btn {
align-self: flex-start;
margin-top: 6px;
padding: 6px 16px;
background: var(--accent);
border: none;
border-radius: 999px;
color: var(--ctp-base, #1e1e2e);
font-size: 12.5px;
font-weight: 600;
cursor: pointer;
transition: filter 0.12s;
}
.np-info-bandsintown-prompt-btn:hover { filter: brightness(1.08); }