feat(library): play all and shuffle all on every track list #242

Merged
logan merged 1 commits from feat/31-play-all-shuffle-all into main 2026-09-04 02:48:28 +00:00
Collaborator

What this is

Play all / Shuffle all on every page that lists tracks — the Tracks tab, genre details, artist details, and both playlist views — driven by one shared helper that owns the shuffle-mode semantics, with each host passing an honest queue Source (#14).

What changed and why

  • frontend/src/utils/play-all.ts (new) — the one place that owns "shuffle this collection". Load-bearing: SetQueue's shuffleStart only picks a random first track when shuffle mode is already on — it does not turn it on — so the helper toggles the mode before setting the queue.
  • track-list.ts — the pair as PageActions in the page header, queuing the displayed list (cachedSortedTracks) with effectiveQueueSource. One edit covers Tracks and genre-details (which embeds track-list).
  • artist-details.ts — the pair; paths from GetFilePathsByAlbums flattened in album order; source {type:'artist', …}. Plus a phone-width wrap (@media 599px) and an inline-failure notice.
  • playlist-details.ts — Shuffle all added beside Play all. Behaviour delta: Play all's shuffleStart: true is dropped — with shuffle already on it now starts at the first row, the album page's semantics.
  • smart-playlist-details.tsfixes a live bug: its Shuffle was a no-op (shuffleStart without enabling mode played track 1 in order).
  • explore-album-details.tsplayOwned re-routed through the helper (pure refactor, identical behaviour).
  • e2e/specs/playback.spec.tsexact: true on its Shuffle locator (would resolve to 2 elements once "Shuffle all" exists).

Verification run

Tier Result
make ui-test 1147 passed (incl. a case that fails when the smart-playlist fix is reverted)
npx tsc --noEmit clean
make e2e 255 passed (incl. 4 new play-all specs, the new Tracks header-fit case, the fixed playback spec)
screenshots artist header read at 424×439 / 320×600 / 900 — name visible, both buttons reachable, pair wraps below the title on a phone
make lint / make test 0 issues × 3 configs / all 3 passes
make bindings-check / make css-check current / clean

Deliberately not done

Page-level pairs on the card grids; per-card menu shuffleStart sites (honour-current-mode, unchanged). ui-visual/perf/generate/Android tiers not demanded (no baselines touched, no Go/schema change, Platform/Desktop).

Closes #31

## What this is Play all / Shuffle all on every page that lists tracks — the Tracks tab, genre details, artist details, and both playlist views — driven by one shared helper that owns the shuffle-mode semantics, with each host passing an honest queue `Source` (#14). ## What changed and why - `frontend/src/utils/play-all.ts` (new) — the one place that owns "shuffle this collection". Load-bearing: `SetQueue`'s `shuffleStart` only picks a random first track when shuffle mode is *already* on — it does not turn it on — so the helper toggles the mode **before** setting the queue. - `track-list.ts` — the pair as `PageAction`s in the page header, queuing the displayed list (`cachedSortedTracks`) with `effectiveQueueSource`. One edit covers Tracks and genre-details (which embeds track-list). - `artist-details.ts` — the pair; paths from `GetFilePathsByAlbums` flattened in album order; source `{type:'artist', …}`. Plus a phone-width wrap (`@media 599px`) and an inline-failure notice. - `playlist-details.ts` — Shuffle all added beside Play all. **Behaviour delta:** Play all's `shuffleStart: true` is dropped — with shuffle already on it now starts at the first row, the album page's semantics. - `smart-playlist-details.ts` — **fixes a live bug**: its Shuffle was a no-op (shuffleStart without enabling mode played track 1 in order). - `explore-album-details.ts` — `playOwned` re-routed through the helper (pure refactor, identical behaviour). - `e2e/specs/playback.spec.ts` — `exact: true` on its Shuffle locator (would resolve to 2 elements once "Shuffle all" exists). ## Verification run | Tier | Result | |---|---| | `make ui-test` | 1147 passed (incl. a case that fails when the smart-playlist fix is reverted) | | `npx tsc --noEmit` | clean | | `make e2e` | 255 passed (incl. 4 new play-all specs, the new Tracks header-fit case, the fixed playback spec) | | screenshots | artist header read at 424×439 / 320×600 / 900 — name visible, both buttons reachable, pair wraps below the title on a phone | | `make lint` / `make test` | 0 issues × 3 configs / all 3 passes | | `make bindings-check` / `make css-check` | current / clean | ## Deliberately not done Page-level pairs on the card grids; per-card menu `shuffleStart` sites (honour-current-mode, unchanged). `ui-visual`/`perf`/`generate`/Android tiers not demanded (no baselines touched, no Go/schema change, Platform/Desktop). Closes #31
logan added 1 commit 2026-09-03 21:07:29 +00:00
feat(library): play all and shuffle all on every track list
CI / check (push) Skipped
CI / e2e (push) Skipped
CI / check (pull_request) Successful in 3m38s
CI / e2e (pull_request) Successful in 12m3s
0be7b4fdc8
Four pages that list tracks — Tracks, genre, artist, and both playlist
views — had no way to start the whole list, or had a broken one. One
shared helper (utils/play-all.ts) now owns what "shuffle this
collection" means: SetQueue's shuffleStart only picks a random first
track when shuffle mode is already on, it does not turn it on, so the
mode is toggled before the queue is set. Each host passes an honest
queue Source (#14): anything that builds a queue names what it built it
from, so "Playing from" stops lying.

Two behaviour changes ride along, both flagged: smart-playlist-details'
Shuffle was a live no-op (shuffleStart without enabling mode played
track 1 in order) and is fixed; playlist-details' Play all drops its
shuffleStart:true, so with shuffle mode already on it now starts at the
first row instead of a random one — the album page's existing
semantics.

Verified: make ui-test (1147, incl. a case that fails when the
smart-playlist fix is reverted), npx tsc --noEmit, make e2e (255,
incl. new play-all and header-fit specs), make lint, make test,
make bindings-check, make css-check; artist header read from
screenshots at 424/320/900 (the pair wraps below the name on a phone).

Closes #31
logan merged commit ca00f8a803 into main 2026-09-04 02:48:28 +00:00
Sign in to join this conversation.