From cc04a0c93d00b3a04dfda68d19b19f2e27d83c95 Mon Sep 17 00:00:00 2001 From: Frank Stellmacher <171614930+Psychotoxical@users.noreply.github.com> Date: Tue, 2 Jun 2026 20:34:54 +0200 Subject: [PATCH] Distinct circular song cards with jump-to-album badge (#953) * feat(tracks): distinct circular song cards with jump-to-album badge Single-track cards looked identical to album tiles, so clicking the body read as album behaviour even though it starts playback. Give them a round vinyl-style cover (square stays album-only) via a shared .cover-circle utility, and add a 'To album' badge under the artist that navigates to the track's album. Card click still plays; the badge is the explicit nav path. * i18n(tracks): add toAlbum label across 9 locales * docs(changelog): track-card redesign + to-album badge (#953) --- CHANGELOG.md | 7 +++++ src/components/SongCard.tsx | 24 +++++++++++++++-- src/locales/de/tracks.ts | 1 + src/locales/en/tracks.ts | 1 + src/locales/es/tracks.ts | 1 + src/locales/fr/tracks.ts | 1 + src/locales/nb/tracks.ts | 1 + src/locales/nl/tracks.ts | 1 + src/locales/ro/tracks.ts | 1 + src/locales/ru/tracks.ts | 1 + src/locales/zh/tracks.ts | 1 + src/styles/layout/cover-art.css | 22 +++++++++++++++ src/styles/tracks/song-card.css | 48 +++++++++++++++++++++++++++------ 13 files changed, 100 insertions(+), 10 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 43432bae..936790fc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -394,6 +394,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 * Analysis **tpm** and cover **cpm** (lib + ui) now measure throughput over the trailing **5 seconds** instead of a full-minute rolling average. The figure is still extrapolated to per-minute, but reacts promptly to bursts/stalls and decays to 0 within the window when idle, instead of coasting on minute-long inertia. +### Track cards — distinct look + jump to album + +**By [@Psychotoxical](https://github.com/Psychotoxical), PR [#953](https://github.com/Psychotoxical/psysonic/pull/953)** + +* Single tracks in the discovery rails now show a round, vinyl-style cover so they read as songs rather than albums — clicking one still plays it instantly. +* A new **To album** badge under the artist jumps to the track's album, available in all 9 languages. + diff --git a/src/components/SongCard.tsx b/src/components/SongCard.tsx index fde7c9bf..d9363bca 100644 --- a/src/components/SongCard.tsx +++ b/src/components/SongCard.tsx @@ -2,7 +2,7 @@ import type { SubsonicSong } from '../api/subsonicTypes'; import { songToTrack } from '../utils/playback/songToTrack'; import React, { memo } from 'react'; import { useNavigate } from 'react-router-dom'; -import { Play, ListPlus, Star } from 'lucide-react'; +import { Play, ListPlus, Star, Disc3 } from 'lucide-react'; import { useTranslation } from 'react-i18next'; import { usePlayerStore } from '../store/playerStore'; import { CoverArtImage } from '../cover/CoverArtImage'; @@ -12,6 +12,7 @@ import { COVER_DENSE_RAIL_CELL_CSS_PX } from '../cover/layoutSizes'; import { enqueueAndPlay } from '../utils/playback/playSong'; import { useDragDrop } from '../contexts/DragDropContext'; import { useOrbitSongRowBehavior } from '../hooks/useOrbitSongRowBehavior'; +import { useNavigateToAlbum } from '../hooks/useNavigateToAlbum'; interface SongCardProps { song: SubsonicSong; @@ -41,6 +42,7 @@ function SongCard({ const coverUrl = coverHandle.src; const psyDrag = useDragDrop(); const { orbitActive, addTrackToOrbit } = useOrbitSongRowBehavior(); + const navigateToAlbum = useNavigateToAlbum(); const handlePlay = () => { if (orbitActive) { addTrackToOrbit(song.id); return; } @@ -60,6 +62,12 @@ function SongCard({ navigate(`/artist/${song.artistId}`); }; + const handleAlbumClick = (e: React.MouseEvent) => { + if (!song.albumId) return; + e.stopPropagation(); + navigateToAlbum(song.albumId); + }; + return (