From 0eeef6048e62a36be6e718ec7dfedaa9d88fe6ee Mon Sep 17 00:00:00 2001 From: Caleb Allen Date: Mon, 17 Aug 2026 08:34:27 -0400 Subject: [PATCH] feat(frontend): credit the artists on the full-screen now playing too MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The phone shell's now-playing view landed on main while the credit rendering was being written, so it arrived with the one call site that still showed a multi-artist credit as a single link with the other artists as punctuation inside it. It is the same fix as the other ten: render from the parts, fall back to the single link when there are fewer than two. The subscription is what makes it show up at all — credits arrive after the track does, so the name already on screen has to be re-rendered when they land. Co-Authored-By: Claude Opus 5 (1M context) Claude-Session: https://claude.ai/code/session_01AfVYUVExXsx1nSWrXN8mAh --- .../now-playing-view/now-playing-view.ts | 25 +++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) diff --git a/frontend/src/components/now-playing-view/now-playing-view.ts b/frontend/src/components/now-playing-view/now-playing-view.ts index 2ec9699..cfdb99b 100644 --- a/frontend/src/components/now-playing-view/now-playing-view.ts +++ b/frontend/src/components/now-playing-view/now-playing-view.ts @@ -5,11 +5,12 @@ import '../audio-player/controls/player-controls'; import '../audio-player/seekbar/seek-bar'; import '../audio-player/volume-control/volume-control'; import { - artistLink, + creditLink, albumLink, exploreLinkStyles, } from '@utils/explore-link'; import { PlayerController } from '@store/controllers/player-controller'; +import { creditStore } from '@store/credit-store'; import { FavoritesController } from '@store/controllers/favorites-controller'; import { designTokens } from '../../styles/tokens.css'; import { srOnly } from '../../styles/sr-only.css'; @@ -36,6 +37,22 @@ import { srOnly } from '../../styles/sr-only.css'; @customElement('now-playing-view') export class NowPlayingView extends LitElement { private player = new PlayerController(this); + + /** Unsubscribes the credit-arrival repaint. */ + private creditsUnsub?: () => void; + + override connectedCallback(): void { + super.connectedCallback(); + // Credits arrive after the track does, so the name this view is + // already showing has to be re-rendered when they land. + this.creditsUnsub = creditStore.subscribe(() => this.requestUpdate()); + } + + override disconnectedCallback(): void { + super.disconnectedCallback(); + this.creditsUnsub?.(); + this.creditsUnsub = undefined; + } private favCtrl = new FavoritesController(this); static override styles = [designTokens, srOnly, exploreLinkStyles, css` @@ -262,7 +279,11 @@ export class NowPlayingView extends LitElement { ${track.title || track.fileName}

- ${artistLink(track.artist, track.artistMbid)} + ${creditLink( + creditStore.credits(track.recordingMbid), + track.artist, + track.artistMbid, + )}

${track.album ? html`