Commit Graph
3889 Commits
Author SHA1 Message Date
vicrodh 0896d8cb93 style(sidebar): drop the Playlists header icon
The "PLAYLISTS" section label no longer carries an icon — it returns
to a plain .section-header div. With padding: 0 8px, the text now
starts at x=8px, which matches where the icon containers of every row
below it begin, so the header visually sits on the same vertical line
as the sidebar's icon column.

Cleanup:
  * Removed the PlaylistsGlyph import.
  * Removed the .section-header-with-icon CSS rule, now orphan
    (Library stopped using it when that section got flattened).

The PlaylistsGlyph component and the source SVG under static/ stay
for future use.

cc
2026-04-21 10:24:07 -06:00
vicrodh feb750e231 style(sidebar): shrink icon slot from 22×22 to 20×20
Small tightening pass — 22×22 felt bulky in practice. 20×20 keeps the
Cider-style alignment guarantee (all labels share the same x) while
giving the sidebar a slightly denser look.

Touches NavigationItem's iconSize default, the 5 custom-sized
icon-containers in Sidebar (my-qbz, favorites, folder header, popover
header, context menu), and the two PlaylistCoverCollage size={20}
call sites.

cc
2026-04-21 10:17:10 -06:00
vicrodh e9a6b223a0 style(sidebar): unify icon container to 22×22 so every label shares one x
Cider-style alignment: the glyph inside the container can be any size
(most lucide nav icons still render at 14×14), but the container slot
is always 22×22 so labels across every sidebar entry land at the same
horizontal position regardless of whether the row shows a lucide icon,
a folder glyph, a collage, or the favorites/my-qbz mask.

Changes:
  * NavigationItem iconSize default 14 → 22 (only affects the
    container; the caller-supplied icon snippet is unchanged).
  * Playlist rows drop the explicit iconSize prop (default now matches
    the collage already at 22×22).
  * .my-qbz-parent .icon-container, .favorites-nav-item .icon-container
    bumped from 14×14 to 22×22.
  * Folder header, folder popover header, and "move to folder" context
    menu items: wrap the FolderGlyph in an .icon-container div and
    size it 22×22. .folder-header also gains height:32px, gap:8px and
    padding:0 8px to match NavigationItem.

cc
2026-04-21 10:07:17 -06:00
vicrodh 54988d8dff style(sidebar): drop label tier from text-primary to text-secondary
First pass pushed sidebar labels all the way to --text-primary (same
brightness as track titles in detail views), which read too loud in
actual use. Matches the Settings view's .setting-label tone
(--text-secondary) — brighter than the original --text-muted baseline
but calmer than --text-primary.

Also fixes the Favorites / Library row that was still running on its
old hand-rolled .favorites-nav-item styles (text-muted, no icon
accent): now matches the rest of the sidebar with text-secondary on
the row and accent-primary on the icon container. The
.favorites-nav-item.active override that bumped back up to
text-primary was removed too, since the background tint alone is
enough to mark the active state.

Surfaces touched:
  * NavigationItem: .nav-item + .label → --text-secondary
  * .favorites-nav-item: same + icon-container gets accent
  * .my-qbz-parent: --text-secondary
  * .folder-name: --text-secondary
  * .folder-popover-header > span: --text-secondary
  * .section-header-with-icon > span: --text-secondary

cc
2026-04-21 10:01:23 -06:00
vicrodh e47480b30f refactor(sidebar): flatten Local Library collapsible into a single nav item
Removes the collapsible Local Library section — header button with
chevron + Browse child row — in favor of a single NavigationItem that
goes straight to the library view. Label is "Local Library"
(library.title), icon is LibraryBig at 14×14 (inherits accent via
NavigationItem's icon-container like every other nav entry).

Also removes the now-unused localLibraryCollapsed state, its entry in
the SidebarCollapseState interface, and the HardDrive icon import
(was only used by the removed Browse row). Persisted collapse state
from previous sessions is read with ?? false so old keys are ignored
gracefully without touching the stored blob.

Side effect: the earlier Library section-header-with-icon tint issue
is moot — the section header that needed custom styling no longer
exists.

cc
2026-04-21 09:58:02 -06:00
vicrodh 4ef7242e4c style(sidebar): accent-tint parent icons and add glyphs to section headers
Addresses three visual gaps in the sidebar after the earlier brightening
pass:

1. My QBZ parent — icon was inheriting the row's text-muted color
   because the custom .icon-container had no color rule of its own. Now
   the icon container sets accent-primary and the parent row's label
   uses text-primary, matching NavigationItem.

2. Folder rows — the folder glyphs were still muted because .folder-
   header / .collapsed-folder-btn / .folder-popover-header all carried
   text-muted as their base color, and FolderGlyph paints via
   currentColor. Switched each surface's base color to accent-primary
   and added explicit text-primary overrides on the actual label spans
   (.folder-name, the popover header span) so the labels stay bright.

3. Section headers — PLAYLISTS had no icon at all and Library only had
   a chevron. Added glyphs via a new .section-header-with-icon class
   that runs accent-primary at the container level (so the SVG picks
   up the tint) with a nested span override for the uppercase label.
   PLAYLISTS uses a new PlaylistsGlyph.svelte (user-supplied
   list-music-player SVG, checked into static/). Library uses
   lucide-svelte LibraryBig for now — swap to a custom SVG later if
   desired.

cc
2026-04-21 09:48:01 -06:00
vicrodh d71bf2334d style(sidebar): replace outline folder icons with solid two-state glyphs
Swaps the outline lucide Folder / FolderPlus icons throughout the
sidebar for the user-supplied solid SVGs, with a state-aware variant
on the folder header so expanded folders actually *look* open.

New component: icons/FolderGlyph.svelte — a single file with three
variants (closed / open / new), fill="currentColor" so it picks up the
surrounding --accent-primary color from the nav item.

Placements:
  * Folder header (collapsible tree node): open variant when expanded,
    closed when not. Reinforces the chevron rotation with a second
    visual cue.
  * Collapsed-sidebar folder button: closed (there's no expand state
    when the whole sidebar is narrow).
  * "Move to folder" context-menu entries: closed (list items).
  * Folder popover header (opened from the collapsed-sidebar button):
    open (the popover IS showing the folder's contents).
  * "New Folder" menu item: the new variant (with the + indicator
    baked into the glyph).

Source SVGs are checked into static/ for traceability.

cc
2026-04-21 09:38:51 -06:00
vicrodh e98bfd62d8 feat(settings): opt-out toggle for sidebar playlist cover collage
Adds Settings > Appearance > "Show playlist cover collages in sidebar"
(on by default, persisted to localStorage as
qbz-sidebar-playlist-collage).

When off, playlist rows in the sidebar fall back to the original
ListMusic icon at its natural 14×14 size — same row alignment as
every other nav item. When on, the 2×2 collage renders as before.
Toggle is reactive via a new subscribePlaylistCollage listener in
sidebarStore, so flipping it applies immediately without a refresh.

Intended for low-end machines where the four extra <img> tags per
visible playlist row (even at _50.jpg, even gated by virtual scroll
and loading="lazy") are still measurable overhead.

i18n: added keys to all 5 locales (en/es/de/fr/pt).

cc
2026-04-21 09:35:31 -06:00
vicrodh ff5d143011 perf(sidebar): request 50x50 variant for playlist cover collage tiles
The collage renders at 22x22 total (each tile ~11x11), so Qobuz's
_150.jpg variant (that comes back in images150/300) is roughly 13×
oversampled and ~4× heavier on the wire than needed. Rewrites matching
Qobuz cover URLs to the _50.jpg variant — ~2 KB per tile instead of
~8 KB. A playlist row with 4 tiles drops from ~32 KB to ~8 KB.

Regex only touches URLs ending in `_150.jpg` / `_300.jpg` / `_600.jpg`
(optionally followed by a query string), so non-Qobuz URLs (local
library covers, data URIs) pass through untouched.

cc
2026-04-21 09:25:25 -06:00
vicrodh 17cee63142 feat(sidebar): show 2x2 cover collage for playlist entries
Replaces the ListMusic icon on user-playlist rows with a 22x22
2x2 collage of the first four track covers when available, matching
the visual pattern used by Cider and other modern music clients.

Data source: images150 / images300 already come back from
v2_get_user_playlists (qbz-models::Playlist.images150/300). Zero
extra backend calls; the sidebar Playlist interface just gains the
two fields that were being stripped by the narrower TS type.

Resource cost: <img loading="lazy"> + the existing virtual scroll in
the sidebar ensures covers only fetch for playlist rows currently
visible. Playlists nested in collapsed folders are excluded from
visiblePlaylistItems, so their covers never load until the folder
is expanded.

Fallback: if a playlist has no cover images (edge case — playlist
with no tracks, or API omits them), the original ListMusic icon
renders inside the same 22x22 slot to keep row alignment stable.

Components:
- PlaylistCoverCollage.svelte (new): 22x22 grid / single-image /
  empty-passthrough based on image count.
- NavigationItem.svelte: adds iconSize prop (default 14) so
  playlist rows can expand to 22x22 without affecting the other
  nav entries.
- Sidebar.svelte: integrates the collage into both folder-playlist
  and root-playlist render paths.

cc
2026-04-21 09:24:25 -06:00
vicrodh fa21db5216 style(sidebar): brighten nav labels and accent-tint nav icons
Makes sidebar entries more legible at a glance — item labels now use
--text-primary (was --text-muted, inherited from the button) and the
icon container uses --accent-primary. Matches the visual hierarchy
common in modern music clients (label = content, icon = branded
affordance).

Active state keeps its background highlight but no longer overrides
the label color, since both active and inactive labels are now at the
brightest tier.

cc
2026-04-21 09:22:09 -06:00
vicrodh f5cb7bb7b4 fix(ui): apply pending-seek pattern to immersive PlayerControlsCompact
Last of the four seekbar surfaces. Previously only NowPlayingBar had
the fix; the immersive-mode compact controls kept showing the old snap
back to pre-seek position during the decoder reinit window.

Adds pendingSeekTime, the 2s lands-near-target detection effect, the
8s safety timeout, and a spinner thumb that renders only while pending
(the immersive design has no thumb by default, so we inject one via
{#if isSeekingPending}).

Part of #335.

cc
2026-04-20 21:38:07 -06:00
vicrodh 1e9861c351 fix(ui): apply pending-seek pattern to MiniPlayerFooter seekbar
Same treatment as NowPlayingBar and ExpandedPlayer — the miniplayer
already deferred onSeek until mouseup, but had no pendingSeekTime, so
the thumb still snapped back to pre-seek position during the 1–2s
decoder reinit window.

Adds pendingSeekTime, a 2s-window effect to clear it once currentTime
lands, an 8s safety timeout, and a spinning-ring variant of the thumb
while the seek is pending. The thumb was display:none in the
miniplayer's minimalist style; it now renders when .seeking is set so
the user gets feedback.

Part of #335.

cc
2026-04-20 21:36:30 -06:00
vicrodh 448df9c59f fix(ui): apply pending-seek pattern to ExpandedPlayer seekbar
Brings the large-player seekbar up to parity with NowPlayingBar so long
seeks no longer show the thumb snapping back to the pre-seek position
during the 1–2s decoder reinit window.

Changes:
  * Defer onSeek until mouseup (was firing on every mousemove, which
    flooded the backend with seek commands and made the visual feedback
    noisy).
  * Add dragPreviewTime for in-drag thumb position.
  * Add pendingSeekTime — thumb stays pinned to target after mouseup
    until currentTime lands within 2s of it.
  * Spinner on the thumb while pendingSeekTime is active, with an 8s
    safety timeout to clear if the seek never lands.
  * Time display reads from effectiveTime so the user's intended
    position shows through the wait.

Part of #335.

cc
2026-04-20 21:34:41 -06:00
vicrodh 8833174f21 fix(ui): keep seekbar thumb on target position with spinner during seek
After the user releases the seekbar the backend still needs 1–2s to
reinit the decoder, run the format seek and restart the audio engine
(especially for long jumps on FLAC Hi-Res). The thumb used to snap back
to the pre-seek position during that window, giving the impression the
seek was rejected, then jump to the clicked position when audio
resumed.

Now the thumb stays at the clicked time (pendingSeekTime) and renders
as a spinning ring until currentTime lands within 2s of the target.
Includes an 8s safety timeout so the UI can't be stuck spinning if the
seek never lands (track ended, device lost, etc.).

Part of #335.

cc
2026-04-20 21:29:07 -06:00
vicrodh dd443ba822 perf(player): use Symphonia native seek for cached-track seeks
Adds InMemorySource — a Symphonia FormatReader+Decoder backed by an
in-memory Cursor — and wires it into the cached branch of the Seek
handler so FLAC Hi-Res and MP3 seeks on LRU-cached / local-library /
offline-cached tracks jump via seek table instead of decoding every
sample from byte 0. Matches the streaming path's behavior, eliminates
the CPU spike during long seeks that was producing audible stuttering
after the streaming seek fix landed.

Falls back to the previous decode_with_fallback + skip_duration path
when Symphonia can't probe the format (rodio-only MP4/AAC container)
or when the native seek itself fails, so nothing regresses for those
formats.

Part of #335.

cc
2026-04-20 21:25:17 -06:00
vicrodh 11d01a2075 perf(player): use Symphonia native seek for CMAF streaming seeks
Replaces skip_duration's decode-every-sample-from-zero loop with
FormatReader::seek(SeekMode::Accurate, SeekTo::Time) on a fresh
IncrementalStreamingSource. For FLAC this jumps via the seek table to
the nearest seek point, then decodes forward to the exact sample —
instead of grinding through millions of samples under the buffered
source's mutex (the cause of post-seek stuttering).

Added IncrementalStreamingSource::seek_to(Duration) which also resets
the decoder, clears the sample queue, and rearms the finished flag so
the source is cleanly re-primed for the iterator.

Non-streaming seeks (cache, offline-cache, local library) still use
skip_duration — they hit in-memory bytes with no lock contention, so
the linear decode is effectively free and there's no reason to change
the path.

Part of #335.

cc
2026-04-20 21:15:14 -06:00
vicrodh bdc901a88a fix(ui): show not-allowed cursor past streaming watermark
Communicates the seek ceiling that the drag clamp already enforces.
When the mouse hovers the portion of the seekbar past
bufferProgress × 0.9, the cursor switches to not-allowed so the user
gets immediate feedback that aiming there won't land.

Only active while a CMAF stream is still downloading
(bufferProgress < 1). Fully cached, offline, and local-library playback
keep the normal pointer cursor across the full bar.

Part of #335.

cc
2026-04-20 21:08:32 -06:00
vicrodh 3b8b457836 fix(ui): clamp seekbar drag to buffered zone during streaming
While a CMAF stream is still downloading, the backend rejects seeks
past the buffered watermark. This clamps the drag visually to the same
ceiling (bufferProgress × 0.90) so the user can't aim at a position the
backend would bounce. The 0.90 factor matches the safety margin on the
Rust side so frontend and backend agree on the cutoff.

Fully cached, offline, and local-library tracks (bufferProgress === null)
are unaffected and keep full-range seek.

Part of #335.

cc
2026-04-20 21:06:54 -06:00
vicrodh f58ee31ed7 fix(player): allow seek within buffered zone during CMAF streaming
Relaxes the seek gate added in 2dc1ee9e so seeks that fall inside the
already-downloaded portion of a streaming track succeed instead of being
rejected wholesale. The cutoff is approximated from download fraction ×
track duration with a 10% safety margin (0.90) to cover FLAC/VBR byte
density variance; exact for CBR.

Seeks past the watermark still reject cleanly with a warning log — they
would block the audio thread since skip_duration reads samples
sequentially. Cache, offline-cache, and local-library seeks are
untouched (they don't hit the streaming branch).

Part of #335.

cc
2026-04-20 21:06:00 -06:00
vicrodh 2dc1ee9e9f fix(player): reject seek during active CMAF streaming
Tightens the streaming-seek handler to the simpler contract signed off
by the user: seek works after a streaming track finishes downloading
(buffered_source.is_complete()), but is rejected cleanly with a warning
log while the download is still in progress. Avoids skip_duration
blocking the audio thread on past-watermark seeks without adding
watermark-tracking complexity.

Cache, offline-cache, and local-library seeks are unaffected — they
reach this handler with current_audio_data Some and skip the streaming
branch entirely.

Fixes part of #335.

cc
2026-04-20 20:52:03 -06:00
vicrodh 7d9a847a87 fix(player): honour seek during active CMAF streaming
The audio thread's Seek handler bailed on `current_audio_data.is_none()`
with a warning and returned. That field is intentionally None during
streaming playback — the bytes live inside current_streaming_source's
Arc<BufferedMediaSource>. Effect: every seek on a streaming track with
the CMAF download still in progress was silently dropped; the UI sent
the command, the player ignored it, and the seekbar snapped back to
whatever position the playback timer had reached (issue #335).

Branch the handler on the live source kind. Streaming: build a fresh
IncrementalStreamingSource from the shared buffered_source (new reader
at byte 0, same downloaded bytes — no re-download), then skip_duration
to the target. Non-streaming path unchanged.

Within-watermark seeks now work. Past-watermark seeks currently block
the audio thread while the decoder waits for more bytes; the clamp to
prevent that lands in the next commit.

cc
2026-04-20 20:28:48 -06:00
vicrodh 927fabbd78 fix(alsa): fall back to hw:CARD=<name>,DEV=<n> when aliased id can't open
Minimal distros (the reporter's Raspberry Pi OS case in issue #331) ship
a trimmed /etc/asound.conf that defines only `!default` and doesn't pull
in the broader alias set most desktop distros provide. A card like the
HifiBerry Digi2 Pro — S/PDIF-only, so its selectable PCM is
`iec958:CARD=sndrpihifiberry,DEV=0` — then fails to open even though
the card is present and usable via the raw `hw:` device.

When CPAL's primary lookup by id returns None AND /proc/asound confirms
the card exists, rebuild the id as `hw:CARD=<name>,DEV=<n>` and retry
the lookup. The raw `hw:` PCM is exposed by the kernel driver for every
registered card, so it's a safe last resort — same card, same channel
routing, just skipping whichever userspace alias layer was missing.

Log both the alias failure and the fallback at warn/info so users can
see what happened without needing to diagnose ALSA config by hand.
Original error path is preserved when no fallback is possible (unknown
id shape, card not in /proc/asound, or hw: equally unavailable).

cc
2026-04-20 20:12:39 -06:00
vicrodh 05f0d69fcb fix(alsa): recognise iec958:/hdmi: prefixes in extract_card_name_from_device
Device enumeration produces four "CARD=" alias shapes (front:, sysdefault:,
iec958:, hdmi:) but the extractor only handled the first two. When a user
selected an S/PDIF or HDMI device id, the downstream proc_found check
always returned false, so the device-not-found error message dropped to
the generic "disconnected, renamed, or handled by another app" wording
even when /proc/asound showed the card present.

Part of issue #331 — reporter's HifiBerry Digi2 Pro is S/PDIF-only, so
its id is iec958:CARD=sndrpihifiberry,DEV=0, and the missing prefix match
obscured the real cause of the open failure.

This commit is a pure parsing extension; behavior changes only in the
error message accuracy. The hw:/plughw: fallback attempt lands in the
next commit.

cc
2026-04-20 20:09:27 -06:00
vicrodh 38edf2d012 fix(playlist): shuffle button starts on a random track, not canonical track 0
Issue #333. handleShuffle was calling handlePlayAll() which hardcoded
playableTracks[0] as the track to start playing. After v2_set_shuffle(true)
the queue was correctly shuffled, but the UI always landed on track 0 —
defeating the point of playlist-level shuffle.

Match the pattern ArtistDetailView / LabelView / LocalLibraryView and
+page.svelte::handleShuffleAlbum already use: pick a random index from
the blacklist-filtered playable set, pass it to handlePlayAll, and let the
existing qbz-player/queue.rs `set_queue` semantics move that index to
shuffle_order[0] so the remaining tracks still cover the full playlist
in random order.

Not touching the Rust-side "CRITICAL FIX" block in queue.set_queue even
though the user suggested removing it — that block is load-bearing for
the other callers that already pass a random index and expect it to
become the shuffle head. Removing it would regress those views.

handlePlayAll now takes an optional `startIndex = 0` so the Play-All
button (unchanged behavior — plays from start) and the Shuffle button
(random start) share the same implementation. Context position is
clamped against the Qobuz-only subset so a random pick landing on a
local track doesn't point past its end.

cc
2026-04-20 19:35:28 -06:00
vicrodh d1895f83d0 fix(cast): route local + plex tracks through cast when a device is connected
Drop the `!isLocal` gate on the cast branch so castTrack is invoked for
every source when a cast device is connected. castTrack now knows how to
dispatch to the three source-specific backend commands; the guard was
the only thing keeping non-Qobuz tracks from ever reaching the cast pipeline.

Fixes issue #332: user connects to a DLNA renderer, plays a local file,
expects audio on the renderer, gets silence (audio routes to app's local
ALSA output instead). Same shape as Foobar2000's local-over-DLNA workflow
the reporter compared against.

cc
2026-04-20 18:36:51 -06:00
vicrodh c978e38aef feat(cast): dispatch castTrack on source (qobuz/local/plex) × protocol
Previously castTrack hardcoded two calls (v2_cast_play_track for
Chromecast, v2_dlna_play_track for DLNA) which both assume a Qobuz track
id. Extend the signature with an optional source parameter (default
'qobuz' so existing callers keep working) and route to the matching
backend command per protocol × source.

Plex branch pulls baseUrl + token from userStorage the same way
playbackService does for local Plex playback and passes ratingKey as a
string to the backend. Local branch uses trackId as-is (library row id).

Follow-up commit removes the `!isLocal` guard in playbackService so
non-Qobuz tracks actually take this branch.

cc
2026-04-20 18:35:36 -06:00
vicrodh 42d432469a feat(cast): v2_{dlna,cast}_play_plex_track for Plex tracks over DLNA/Chromecast
Plex has the same cast routing problem as local library: the Qobuz-only
play_track commands can't resolve Plex ratingKeys. Add dedicated commands
that fetch bytes through plex_resolve_track_media (existing), proxy them
through the cast media server, and load the URL on the renderer.

Proxying through the media server (rather than giving the renderer a
direct Plex URL) keeps the user's Plex token in-process. Renderers would
need the token to fetch from Plex directly and that's not a surface we
want to expose.

Content-type fallback to audio/mpeg when Plex omits it (transcode path),
with a plex_key_to_u64 namespaced hash (high bit set) so Plex ratingKeys
can't collide with Qobuz/library ids in the MediaServer keyspace.

cc
2026-04-20 18:33:46 -06:00
vicrodh 76158c81d3 feat(cast): v2_cast_play_local_track for local-library tracks over Chromecast
Companion to v2_dlna_play_local_track. Same bug, same fix applied to the
Chromecast protocol branch: reads library row + file, infers content_type,
registers bytes with the shared media server, loads the URL on the
Chromecast receiver. Reuses the local_track_content_type helper.

User flagged this on the #332 thread — same Qobuz-only assumption in the
Chromecast play command as in the DLNA one.

cc
2026-04-20 18:26:58 -06:00
vicrodh 75146d66a9 feat(cast): v2_dlna_play_local_track for local-library tracks over DLNA
Mirrors v2_dlna_play_track but for library row ids. Reads the file from
disk, infers content_type from AudioFormat (with extension fallback for
Unknown), registers bytes with the DLNA media server, sends AVTransport
URI + Play to the renderer.

Without this command the cast path had no way to send local audio to a
DLNA device — v2_dlna_play_track resolves the id as a Qobuz track and
fails (404 in offline sessions, wrong-song match in online sessions where
the library row id happens to collide with a real Qobuz track id). Issue
#332 reported the symptom as "DLNA not operational"; logs showed the
renderer connected successfully but never received a SOAP SetAVTransportURI.

Frontend wiring in the cast dispatch + playbackService guard removal lands
in follow-up commits.

cc
2026-04-20 18:23:18 -06:00
vicrodh 7c7e819165 Merge branch 'feature/mixtapes-collections' into pre-release
Mixtapes & Collections — a second container family alongside Qobuz
playlists. Private to the install, cross-source (Qobuz + LocalLibrary +
Plex), with its own detail view, Add-to picker, bulk ops, per-collection
view prefs, and a Discography Builder for one-click Artist Collections.

Backend:
- New tables mixtape_collections + mixtape_collection_items with
  CASCADE + additive migrations.
- New v2_* command surface: CRUD, enqueue_collection,
  enqueue_collection_item, skip_to_next_item / previous_item for
  album-boundary navigation, mixtape_item_exists for duplicate checks,
  custom cover upload / remove.
- Plex branch in resolve_local_album so plex: album keys route to the
  plex cache instead of local_tracks.

Frontend:
- Sidebar My QBZ collapsible nav, title bar entry, index + detail views
  with virtualization / sticky unified toolbars / size-aware Qobuz
  artwork / image cache. Per-collection view prefs (viewMode / sort /
  filter) persisted in per-user localStorage.
- Index views get search + sort + kind filter + list-or-grid toggle.
- Add-to-Mixtape wired across ArtistDetail / Search / Label /
  PlaylistDetail / LocalLibrary; multi-select + bulk ops for albums.
- Queue / playback fixes bundled: per-album Play for all three sources,
  session source round-trip for local/Plex auto-advance, NowPlayingBar
  artwork resolver for Plex / local paths, clear-queue includeCurrent
  flag, natural-end queue cleanup.

Release notes in docs/release-1.2.8/TAG_DETAILS.md.

cc
2026-04-20 17:50:04 -06:00
vicrodh c09213a0ee docs(release-1.2.8): Mixtapes & Collections tag notes
Release notes for 1.2.8 explaining Mixtape vs Collection vs Playlist in
user-facing terms: playlists are Qobuz-hosted track lists, Mixtapes are
private ordered cross-source listening sessions, Collections are
private themed album shelves. Covers the Discography Builder, the
Add to Mixtape picker kind rules, custom covers, duplicate-handling
dialog, and the under-the-hood notes for upgraders (new tables, new
v2_* command surface, Plex queue resolver branch).

cc
2026-04-20 17:49:27 -06:00
vicrodh 68e76a203e fix(ui): wire per-album play + session source restore + NowPlayingBar artwork + My QBZ titlebar
Consolidates the +page.svelte side of several independent fixes/features
whose non-+page pieces landed in the preceding commits.

- handleMixtapeItemAction: was calling v2_set_queue with { trackIds }
  but the command expects { tracks, startIndex } — Tauri rejected the
  call so per-album Play from a Collection did nothing. Now routes
  Qobuz items through the existing fast path (with blacklist filter +
  artwork fallbacks) and local/Plex items through the new
  v2_enqueue_collection_item backend command, then resolves the queue
  via playQueueIndex(0) + playQueueTrack(trk) so audio actually starts
  (v2_play_queue_index only moves the cursor; it doesn't tell the
  player to load bytes).
- Session save (saveSessionBeforeClose): includes source on each
  PersistedQueueTrack. Without it, a LocalLibrary queue came back as
  is_local=true / source=undefined and the auto-advance path routed
  local row-ids to v2_play_track (Qobuz).
- Session restore: map session.queue_tracks with a source fallback
  (trk.source ?? (trk.is_local ? 'local' : undefined)) so older saved
  sessions (pre-source-field) still route correctly. setCurrentTrack
  default for source is now 'local' when is_local is true, not
  hardcoded 'qobuz'.
- playQueueTrack: artwork goes through resolveQueueTrackArtwork so a
  raw Plex /library/... thumb path or a bare local filesystem path
  becomes a valid src for NowPlayingBar instead of a 404.
- Title bar: isMyQbzInTitlebar state + showMyQbz prop passed to
  TitleBarNav so the new My QBZ entry can be toggled from Settings.

cc
2026-04-20 17:49:17 -06:00
vicrodh 260f147621 feat(titlebar): add My QBZ to title bar nav
Mirrors the Discover / Library / Local Library / Purchases title-bar
entries. Button opens a hover dropdown with Mixtapes and Collections;
label comes from myQbzNavStore so a sidebar rename propagates.

- titlebarNavStore: new myQbz flag with getter/setter/migration.
  isTitlebarNavEnabled() includes it in the enabled-any check.
- TitleBarNav: new showMyQbz prop + CassetteTape button with a
  dropdown menu (Mixtapes / Collections); shared open/close mechanics
  with the other nav dropdowns so only one is open at a time.
- SettingsView: new Toggle between Library and Purchases, disabled
  when the title bar is hidden or the system title bar is active
  (matches the other toggles in the section).

Wiring in +page.svelte ships with the next commit.

cc
2026-04-20 17:48:59 -06:00
vicrodh 739d5b0f7e feat(collections): index toolbar (search/sort/filter/view) + i18n
Root Collections and Mixtapes pages had only a title + New button + a
grid of cards. Added the same .list-controls vocabulary the detail view
uses so users see a consistent control surface across the feature.

- Search: matches name + description.
- Sort dropdown with asc/desc toggle on re-click: Position (manual),
  Name, Items, Recently updated.
- Kind filter on CollectionsView only (All / Collections / Artist
  Collections). MixtapesView omits it — one kind means the dropdown
  would be noise.
- View-mode segmented toggle (list / grid). Grid keeps the existing
  208px cards; list is a dense row with 48px mosaic cover + name +
  kind label + count.
- Empty-results state when search/filter returns zero.
- Preferences persisted globally (per user) under
  collections-index-prefs / mixtapes-index-prefs — viewMode, sortBy,
  sortDir, kindFilter round-trip across sessions. searchQuery stays
  transient per-session.

i18n (en / es-MX / de / fr / pt):
- collections.searchPlaceholder / sortByItems / sortByUpdated /
  kindFilterAll / kindFilterCollection / kindFilterArtistCollection
- mixtapes.searchPlaceholder
- nav.myQbz (used by the upcoming title bar entry)

cc
2026-04-20 17:48:49 -06:00
vicrodh 62355f8b64 perf(mixtape+playlist): virtualize + unified sticky headers + small artwork
Collection / Mixtape detail, Playlist detail, and Playlist manager all
got sluggish with 50+ items — too many <img> tags, full 600px Qobuz
covers decoded for tiny tiles, and two-tier sticky headers with visible
gaps between them. Straightened all of it with patterns we already had
in the codebase; no new deps.

MixtapeCollectionDetailView:
- Fixed-height windowed virtualization for list/grid modes (LIST_ROW_HEIGHT 56,
  GRID_ROW_HEIGHT 240). Top/bottom spacer divs reserve scroll height.
- Row height forced to 56px (was variable 52-60), so the scrollbar's
  scrollHeight matches the actual end of the content and the user can
  reach the last row without stutter.
- The scroll-reset effect now reads listAnchorOffsetTop via untrack so
  mid-scroll ResizeObserver ticks don't re-fire the reset and snap
  scroll back; RO no longer observes the list anchor itself (its size
  changes every scroll tick and is irrelevant to its offsetTop).
- Expanded-mode auto-fetch is gated to visible items — no more 60
  concurrent backend calls on mode switch.
- Sticky toolbar wraps search + sort + filter + select + view-mode as
  ONE block; box-shadow -8px/+8px extends the opaque background over
  the scroller's 8px padding-top gap and any next-element margin seam.
- Qobuz artwork URLs downsized (_50 / _150) for list/grid thumbnails
  instead of the stored _600.

PlaylistDetailView:
- Track controls + batch-controls + column header wrapped in one
  .tracks-sticky-header inside .track-list. Single sticky instead of
  two at top:0 and top:56 with a visible row peeking through the gap;
  containing block is .track-list (tall as virtual content) so the
  toolbar no longer disappears when scrolled past the .view-transition
  wrapper's height: 100%.
- Cover <img> routed through use:cachedSrc + loading=lazy / decoding=async.

PlaylistManagerView:
- .controls sticky with box-shadow -8px/+12px to cover the padding-top
  gap and bottom margin; folder-icon <img> tags (grid / list / tree)
  now use:cachedSrc with convertFileSrc + lazy/async.

Shared components:
- QualityBadgeStatic: new component, visually 1:1 with QualityBadge's
  full mode but no hardware-status polling, no downgrade arrow, no
  plughw tooltip — used in list rows where every item advertises its
  own stored quality and shouldn't react to now-playing state.
- CollectionMosaic + PlaylistCollage: size-aware Qobuz URL picker
  (50/150/300/600 based on rendered tile size) and use:cachedSrc +
  lazy/async on every cell. 20 mosaics × 4 cells at 140px used to
  pull 80 × 600px JPEGs; now they pull 80 × 150px JPEGs through the
  shared image cache.

cc
2026-04-20 17:48:31 -06:00
vicrodh ec52997c02 feat(library): album multi-select + bulk ops + root-view padding
- AddToMixtapeModal: accepts an array of items (was single), gains a
  duplicate pre-check panel with Add anyway / Skip duplicates / Cancel,
  hides the + Collection button for non-album items (Collection shelves
  can't hold a bare track or nested playlist).
- AlbumCard: selectable / selected / onToggleSelect props — corner
  checkbox overlay that replaces the click-to-open behavior when
  selection mode is on. Same pattern ArtistDetailView already used for
  popular tracks.
- VirtualizedAlbumList: pass-through for the select-mode props +
  forwards albumId / year / trackCount so cards render consistently in
  the grid.
- LocalLibraryView: new SquareCheckBig toggle in the Albums tab; bulk
  handlers (PlayNext / PlayLater / AddToMixtape / AddToPlaylist) route
  each selected album through fetchAlbumTracks so local + Plex items
  resolve correctly. BulkActionBar mounted at the bottom of the albums
  grid.
- ArtistDetailView + LocalLibraryView: root-view padding now
  'padding: 8px 8px 100px 18px' and .back-btn margin-top 8px to match
  the AlbumDetailView / FavoritesView standard.

cc
2026-04-20 17:48:04 -06:00
vicrodh 4b6d8173af fix(queue): preserve source on session save/restore + resolve queue artwork
Two fixes that together clear the LocalLibrary auto-advance desync:
audio played a different track than the NowPlayingBar showed, and the
cover showed a '?' placeholder for local/Plex tracks.

- sessionService.ts: PersistedQueueTrack gains an optional source
  field so qobuz | local | plex round-trips through session_store.
  Without this, the restore path rebuilt the queue with is_local=true
  but source=undefined, and downstream callers that defaulted
  undefined-source to 'qobuz' routed v2_next_track results to
  v2_play_track — Qobuz then resolved library row ids to whatever
  random track shared the id.
- queueArtwork.ts: new resolveQueueTrackArtwork() turns a CoreQueueTrack
  artwork_url (http, file://, bare Plex /library/... path, or bare
  filesystem path) into something the WebView can actually fetch.
  Previously a raw Plex thumb path hit localhost:1420 and 404'd;
  local paths tried to load as if relative URLs.
- playbackService.ts: both auto-skip fallback paths now resolve next
  track artwork through the helper before handing off to playTrack.

cc
2026-04-20 17:47:51 -06:00
vicrodh 23f56b178a feat(mixtape): v2_enqueue_collection_item + Plex branch + repo hydration
Backend:
- New v2_enqueue_collection_item(collectionId, position, mode) routes a
  single collection item through the existing ProdItemResolver — same
  path v2_enqueue_collection uses, scoped to one position. Supports
  replace / play_next / append modes. Unlocks per-album Play for local
  and Plex items from the Collection detail view (previously only Qobuz
  had a working fast-path there).
- enqueue.rs: resolve_local_album now detects plex: prefixes and routes
  to plex_cache_get_album_tracks instead of querying local_tracks, so
  Collections with Plex albums actually enqueue end-to-end.
- repo.rs: list_collections now hydrates items for every collection so
  the item count in CollectionsView / MixtapesView is real, not 0.
- mixtapeCollectionsStore.ts: bindings updated for new + changed
  commands (add_item with allow_duplicate, item_exists, custom cover
  upload/remove).

cc
2026-04-20 17:47:38 -06:00
vicrodh 93eef97b4b feat(mixtape): Collection/Mixtape detail view rewrite
Full rework of MixtapeCollectionDetailView. Groups of changes:

Play + UX correctness
  - Play / Shuffle actually start audio: after enqueueCollection fires,
    fetch the first queue track via playQueueIndex(0) and hand off to
    playTrack() so the audio pipeline kicks in (bridge.play_index alone
    only updates queue state, never triggers playback).
  - Loading spinner swaps Play / Shuffle icons for LoaderCircle while
    the enqueue + track load is in flight — covers the noticeable
    delay on large collections.
  - Canonical scroll pattern (width/height/overflow-y auto).
  - Detail-view header Play / Shuffle / More buttons now use the
    global .action-btn-circle family instead of bespoke pill styles.

Item row chrome
  - Source indicators: canonical monochrome mask pattern
    (plex-mono.svg / hdd.svg / qobuz-logo.svg) tinted --accent-primary.
  - Quality column uses the full QualityBadge component.
  - Live-resolve per item: fetch v2_library_get_albums +
    v2_plex_cache_get_albums once on load so each row knows its true
    kind (plex vs qobuz_download vs qobuz_purchase vs user) and can
    show Plex album art via buildPlexArtworkUrl.
  - Qobuz items fetch v2_get_album in parallel to populate quality
    data (Qobuz-streaming items don't persist bit-depth / sample-rate
    at add-time).
  - Clickable title → onOpenItem; clickable artist subtitle (Qobuz
    only) → onOpenArtist runtime-resolves via search.
  - Row hover reveals a play overlay on the artwork.

Row context menu (⋯)
  - Play / Play Next / Add to queue entries.
  - Change release type → nested submenu with Album / EP / Single /
    Live / Compilation and "Use auto-detected" reset. Uses the
    shared releaseTypeOverridesStore so the override also shows in
    DiscographyBuilder and vice-versa.
  - Type column shows the effective release type for album items.

Controls row
  - Search (album title / subtitle + track titles when expanded).
  - Sort (Position / Name / Year / Tracks, asc/desc toggle).
  - Filter with Type + Source sections (multi-select Source).
  - Reset clears every filter + sort.
  - Select mode toggle (SquareCheckBig).
  - View-mode segmented group (List / Grid / Expanded).

View modes
  - List: canonical row listing (no chevron, no inline tracks).
  - Grid: AlbumCard-like tiles with corner-checkbox selection.
  - Expanded: auto-loads every album's tracks via v2_get_album
    (Qobuz), v2_library_get_album_tracks (local — with title+artist
    re-resolve fallback for re-indexed libraries) or
    v2_plex_cache_get_album_tracks (Plex album_key prefix). Tracks
    render as real TrackRow instances.

Selection + BulkActionBar
  - Selected positions tracked separately from view-mode.
  - BulkActionBar below the list with Play Next, Add to Queue, Add
    to Playlist, Add to Mixtape/Collection, Remove from Collection.

Custom cover + header actions
  - Hero mosaic + grid tiles honor the user-uploaded cover.
  - Header ⋯ menu: Upload cover / Clear custom cover.

i18n
  - collectionDetail.* keys across all 5 locales: itemActions,
    changeReleaseType, removeItem, cover{Uploaded,UploadFailed,
    Removed,RemoveFailed}, selectItem, sort, filter, sortBy*,
    filterAll, viewMode, view{List,Grid,Expanded}, searchPlaceholder.

cc
2026-04-19 22:47:05 -06:00
vicrodh 921d5b455c feat(mixtape): wire Mixtape/Collection + DiscographyBuilder navigation
Handlers + callback wiring in the root view layer:

DiscographyBuilder
  - onOpenAlbum → handleAlbumClick (Qobuz) or selectLocalAlbum (local)
    so clicking a candidate album navigates to its detail.

Mixtape / Collection detail
  - onOpenItem for album / track / playlist rows.
  - onOpenArtist runs handleOpenArtistByName: v2_search_artists(name)
    and navigates to the top match — collection items only store an
    artist name, not an id.
  - onPlayItem / onPlayItemNext / onAddItemToQueueLater wired to a
    new handleMixtapeItemAction that fetches the item's tracks
    (Qobuz album path) and sets / appends the queue. Non-Qobuz
    item types toast a "not available yet" message.
  - Bulk variants (onBulkPlayNext / onBulkPlayLater /
    onBulkAddToPlaylist) iterate through selected items.
  - onPlayTrackFromItem (expanded-view TrackRow Play): fetches the
    parent album and jumps to the picked track's index.
  - onPlayTrackNext / onPlayTrackLater: fetch via v2_get_track and
    call v2_add_tracks_to_queue_next / v2_add_tracks_to_queue for a
    single Qobuz track.

Adds selectLocalAlbum + MixtapeCollectionItem to the existing
imports.

cc
2026-04-19 22:45:16 -06:00
vicrodh 4e618dd5b7 fix(ui): back-to-top z-index + AddToMixtapeModal items prop
- back-to-top-global button z-index 50 → 200 so no view's sticky
  footer (Collection detail BulkActionBar, DiscographyBuilder footer,
  etc.) can park on top of it.
- AddToMixtapeModal now receives items={} (array) instead of
  item={} (single) after the store + modal signature moved to the
  bulk-capable shape.

cc
2026-04-19 22:36:15 -06:00
vicrodh 7d2340a978 fix(queue): clear stale now-playing after Clear + natural end
Two related UX fixes in handleClearQueue + the setOnTrackEnded branch:

- handleClearQueue now passes includeCurrent=!isPlaying. When the
  user hits Clear while nothing is actively playing, the call flows
  down to v2_clear_queue, which stops + wipes the current slot too —
  no more stale track lingering in NOW PLAYING across restarts.
- setOnTrackEnded's "queue ran out + no repeat" branch now also
  calls clearQueue({includeCurrent: true}) after stopPlayback(). The
  track that just finished is already off; wiping the current index
  stops it from being re-parked by any subsequent queue snapshot.

cc
2026-04-19 22:35:00 -06:00
vicrodh 578a934c20 i18n: DiscographyBuilder column labels + release types + track count
Keys added to all 5 locales (en/es/de/fr/pt):
- discographyBuilder.col{Year,Type,Album,Tracks,Source,Quality}
- discographyBuilder.releaseType.{album,ep,single,live,compilation}
- discographyBuilder.{checkAll,uncheckAll,typeOverrideHint,typeOverrideReset}
- common.trackCount (reused across DiscographyBuilder + Collection
  detail tracks column tooltip)

Mexican Spanish convention for es.json.

cc
2026-04-19 22:31:24 -06:00
vicrodh 0c49f7153f feat(library): expose Add to Mixtape for albums in LocalLibrary
Both AlbumCard call sites (artist-albums column + VirtualizedAlbumList)
were rendering AlbumCard without albumId, so its built-in
handleAddToMixtape never fired and AlbumMenu never rendered the entry.
Pass albumId (+ year + trackCount for modal metadata).

Album detail hero gains an Add to Mixtape/Collection action-btn-circle
(CassetteTape icon) next to Play / Shuffle / Select, firing
openAddToMixtape for the selected album.

cc
2026-04-19 22:23:40 -06:00
vicrodh 5974276bea feat(mixtape): bulk Add to Mixtape + kind restriction in picker
BulkActionBar gains onAddToMixtape + onRemoveFromCollection props
(CassetteTape + Trash2 icons, reusing existing common.* i18n keys).

AddToMixtapeModal now takes items: AddToMixtapeItem[] instead of a
single item. Single-item callers pass a 1-element array; bulk callers
(BulkActionBar in the Collection detail) pass many. Modal loops
over all items on pick and shows a bulk-count toast when more than
one was added.

Track / playlist items can only be added to Mixtapes, not Collections
(Collections hold whole albums by design). When any incoming item is
a track or playlist, the picker filters the visible target list to
mixtapes only AND hides the + Collection footer button so the user
can't land in an invalid destination.

cc
2026-04-19 22:23:28 -06:00
vicrodh 40fa372611 feat(collections): CollectionMosaic honors user-uploaded covers
New customCoverUrl prop — when set, renders a single full-size image
instead of the 2x2/3x3 collage. CollectionsView + MixtapesView
compute it via convertFileSrc(col.custom_artwork_path) so the grid
tiles show the user's uploaded cover in the list as well as in the
detail view.

cc
2026-04-19 22:23:14 -06:00
vicrodh 1a223c2a85 feat(mixtape): custom-cover upload + remove commands
Lets users pick any image (png/jpg/jpeg/webp) as a Mixtape's or
Collection's cover. Mirrors v2_library_set_custom_album_cover:
source → artwork cache dir → resize to 1000x1000 via image crate →
store path in mixtape_collections.custom_artwork_path.

- v2_mixtape_upload_custom_cover(id, source_path): validates extension,
  copies + resizes, stamps the resulting path, deletes the previous
  cover file after the DB write succeeds.
- v2_mixtape_remove_custom_cover(id): nulls the column + deletes the
  on-disk file.
- Both registered in lib.rs.
- Frontend store: uploadCustomCover / removeCustomCover wrappers that
  also patch collectionsStore optimistically so UIs update without a
  full reload.

Uses mixtape::repo::get_custom_artwork (added in the previous commit)
to find the previous path before overwriting.

cc
2026-04-19 22:22:14 -06:00
vicrodh 32e4eff504 feat(discography): builder overhaul — scroll, columns, selection, type override
Major rework of the Discography Builder:

- Local library tracks finally show up: fix camelCase args for
  v2_library_get_albums (includeHidden / excludeNetworkFolders) and
  serialize the Qobuz fetch before the local one so artistName is
  populated before filtering.
- Include Plex-cache albums too (v2_plex_cache_get_albums with a
  2-second retry after cold-cache) so Plex collections show in the
  candidate list.
- Album titles + artist subtitles are now clickable (onOpenAlbum
  callback routes Qobuz→handleAlbumClick, local→selectLocalAlbum).
- New Tracks + Type columns; Type shows Album / EP / Single / Live /
  Compilation (color-tinted). Classifier uses Qobuz release_type +
  group_type when present, falls back to track-count heuristic.
- User can override the release type per row via a popover on the
  Type cell; overrides persist in per-user localStorage via the new
  releaseTypeOverridesStore (sidecar — never written to Qobuz or
  the library DB).
- Canonical source indicators (plex-mono.svg / hdd.svg / qobuz-logo.svg
  as CSS masks tinted with --accent-primary).
- Full QualityBadge component (bit-depth + sample-rate + format),
  dropping the compact + overrides experiment.
- Header check/uncheck-all with indeterminate state.
- Footer clears the back-to-top gap; scroll via the canonical
  width/height/overflow-y pattern from ArtistDetailView.
- Alternate rows keep the sub-item connector next to the checkbox
  (no indent), matching the visual signal without shifting columns.

cc
2026-04-19 21:20:11 -06:00
vicrodh ee9b695e32 feat(mixtape): wire Add to Mixtape across missing menu sites
TrackMenu / AlbumMenu already expose onAddToMixtape; the following
sites just never passed it through:

- ArtistDetailView popular-tracks TrackMenu
- SearchView track results TrackMenu
- LabelView track-list TrackMenu
- PlaylistDetailView hero AlbumMenu (add the whole playlist)

Also refactors ArtistDetailView's follow button icon to use a CSS
mask (background-color: currentColor) instead of a hardcoded invert +
hue-rotate filter chain that only produced purple — so it adapts to
whatever accent color the current theme sets.

cc
2026-04-19 21:18:51 -06:00