diff --git a/CHANGELOG.md b/CHANGELOG.md index 3059d0a2..9e0871e9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -142,6 +142,15 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 +### Album play — hold to shuffle + +**By [@ImAsra](https://github.com/ImAsra), PR [#888](https://github.com/Psychotoxical/psysonic/pull/888)** + +* Hold an album **Play** button (~1 s) for a filling wave animation, then the album starts in shuffled order; a short click still plays in track order. +* Album cards, hero, Because-you-like rail, and Most Played; tooltip in all locales. + + + ## Changed ### Linux — session GDK, WebKitGTK mitigations, and Wayland text diff --git a/src/components/AlbumCard.tsx b/src/components/AlbumCard.tsx index 5ddc2a97..1141b35f 100644 --- a/src/components/AlbumCard.tsx +++ b/src/components/AlbumCard.tsx @@ -16,7 +16,9 @@ import { COVER_DENSE_GRID_MIN_CELL_CSS_PX } from '../cover/layoutSizes'; import { resolveCoverDisplayTier } from '../cover/tiers'; import { acquireUrl } from '../utils/imageCache/urlPool'; import { OpenArtistRefInline } from './OpenArtistRefInline'; -import { playAlbum } from '../utils/playback/playAlbum'; +import { playAlbum, playAlbumShuffled } from '../utils/playback/playAlbum'; +import { useLongPressAction } from '../hooks/useLongPressAction'; +import { LongPressWaveOverlay } from './LongPressWaveOverlay'; import { useDragDrop } from '../contexts/DragDropContext'; import { isAlbumRecentlyAdded } from '../utils/albumRecency'; import { deriveAlbumArtistRefs } from '../utils/album/deriveAlbumHeaderArtistRefs'; @@ -59,6 +61,10 @@ function AlbumCard({ libraryResolve = false, }: AlbumCardProps) { const { t } = useTranslation(); + const { isHolding, pressBind } = useLongPressAction({ + onShortPress: () => playAlbum(album.id), + onLongPress: () => playAlbumShuffled(album.id), + }); const navigate = useNavigate(); const openContextMenu = usePlayerStore(s => s.openContextMenu); const enqueue = usePlayerStore(s => s.enqueue); @@ -157,15 +163,18 @@ function AlbumCard({ )} {!selectionMode && (
- + + + ); +} + export default function MostPlayed() { const { t } = useTranslation(); @@ -230,15 +256,7 @@ export default function MostPlayed() {
- +