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 (