Commit Graph
5631 Commits
Author SHA1 Message Date
vicrodh 2eb60c16a7 fix(artist): make Build Artist Collection button match sibling icon-circle style
The button shipped as a rounded-rectangle pill with icon + text,
visually inconsistent with the circular icon-only siblings (favorite,
radio, network). The brief was "zero pills, reuse existing
conventions"; this swaps to a 44x44 circle matching .favorite-btn
exactly, with a lucide LibraryBig icon and the title attribute
carrying the "Build Artist Collection" label for hover.

cc
2026-04-19 02:28:01 -06:00
vicrodh 7c58425d6c fix(mixtape): remove effect-update-depth loop in MixtapeCollectionDetailView
The view had two $effects — one of them read $collectionsStore AND the
local `collection` state AND wrote `collection` via object spread on
every run. Svelte 5 detected the self-re-triggering cycle and threw
effect_update_depth_exceeded, which froze every interaction on the
detail view after a collection was created.

The store-sync effect was redundant: every mutation handler in this
component already calls loadCollection() after success, so the local
`collection` state stays current without that effect. Removing it
eliminates the loop without losing any behavior. collectionsStore
import dropped accordingly.

cc
2026-04-19 02:24:45 -06:00
vicrodh 2460467e48 feat(mixtape): DiscographyBuilderView for Artist Collections
Cross-source artist discography builder. Fetches the artist's Qobuz
releases (via v2_get_artist_page) and LocalLibrary albums by artist
name (via v2_library_get_albums filtered client-side), normalizes
titles to group variants of the same album, ranks each group by
quality_score (bit_depth × 10M + sample_rate_hz + format_bonus), and
renders a primary row + indented alternate rows per group.

Compilations detected heuristically (best of / greatest hits /
anthology / ...) and unchecked by default. Default selection: primary
of each non-compilation group. User can check alternates to include
them too. Order by release date / title / manual (preserves input
order). Submit creates an artist_collection with
source_type='artist_discography' + source_ref=artistId and enqueues
items in display order.

ArtistDetailView gains a "Build Artist Collection" action button
(LibraryBig icon, secondary style, rendered only when callback prop is
present). Entry point from CollectionsView left as-is (artist picker
deferred). Added 'discography-builder' to ViewType union.

Toast keys toast.collectionCreated / toast.collectionCreateFailed
added to all five locale files (en, es, de, fr, pt).

cc
2026-04-18 20:57:02 -06:00
vicrodh b7458522b3 feat(mixtape): Add to Mixtape/Collection on TrackRow and playlist rows
Two more entry points, wired to the same global modal trigger store.
TrackRow's context menu gains the action for both Qobuz and local
tracks. Playlist rows expose it only for Qobuz playlists — local
playlists are narrowed by the backend resolver (spec §3.1) and
would fail at enqueue time.

cc
2026-04-18 20:43:17 -06:00
vicrodh 6615f6bbe3 feat(mixtape): "Add to Mixtape/Collection" on AlbumCard and AlbumDetailView
Adds a shared modal-trigger store + mounts AddToMixtapeModal once at
the page level. AlbumCard exposes the action via its overflow menu;
AlbumDetailView exposes it as a secondary action button in the top
action row. Both build an AddToMixtapeItem from the album's source /
id / title / artist / artwork / year / track count and invoke
openAddToMixtape(), which the global modal consumes.

cc
2026-04-18 20:38:22 -06:00
vicrodh 9068b2bf14 feat(mixtape): MixtapeCollectionDetailView
Full detail page with a CollectionMosaic header, title, kind tag,
description, item count, and three primary actions (Play / Shuffle /
overflow). Overflow menu exposes Rename, Edit description, Toggle
play mode, Convert kind (disabled for artist_collection), and Delete
with a confirmation dialog.

Item table columns: # | Item (artwork + title + subtitle) | Type |
Source | Quality | Tracks | Year | ⋯. Type column uses a lucide icon
+ uppercase letter-spaced label (no pill). Source reuses <SourceBadge>.
Quality reuses the shared QualityBadge compact component.

Inline per-row overflow menu offers Remove. "Play next" and full
item drag-reorder are stubbed for future work.

+page.svelte's Task 5.3 placeholder is replaced with this component;
onBack returns the user to the matching grid view (Mixtapes or
Collections) based on the collection's kind. getCollection import
removed from +page.svelte (now only used inside the detail component).

cc
2026-04-18 20:33:36 -06:00
vicrodh 9d699ffe41 feat(mixtape): AddToMixtapeModal picker
Shared modal for "Add to Mixtape/Collection" entry points. Lists the
user's collections sorted by recency, with a kind icon + name + item
count + kind tag per row. Clicking a row calls addItem; dedup toast
when backend returns false. "+ Mixtape" / "+ Collection" footer opens
an inline create-panel that creates then adds the current item in one
shot. Search filters by name (case-insensitive substring). ESC closes
the create-panel first, then the modal.

Adds a single new i18n key (common.addedToMixtapeOrCollection) across
5 locales for the success toast.

cc
2026-04-18 20:25:19 -06:00
vicrodh 8f5c05d3cb feat(mixtape): wire MixtapesView and CollectionsView into the page router
Replaces the pre-5.B "Coming soon" placeholders with the real grid
views. Adds an inline create-modal (name + kind toggle) that calls
createCollection and navigates straight to the new collection's
detail placeholder — which itself stays minimal until Phase 6
ships MixtapeCollectionDetailView. Collections' "Build Artist
Collection" secondary CTA is wired to a TODO comment pending
Phase 8 DiscographyBuilderView. Drops dead .coming-soon CSS.

cc
2026-04-18 20:20:36 -06:00
vicrodh 5b3afa882b feat(mixtape): MixtapesView and CollectionsView grid pages
Near-identical grid layouts for the two sections under My QBZ. Both
subscribe to collectionsStore, filter by kind, and render cards with
CollectionMosaic covers. Empty states center the mosaic placeholder
with kind-specific lucide icons and CTAs.

CollectionsView also exposes a "Build Artist Collection" secondary
CTA alongside the regular "+ New Collection" primary. The label
"ARTIST · <name>" is used on artist_collection cards so they are
distinguishable at a glance from plain Collections.

cc
2026-04-18 20:15:26 -06:00
vicrodh dd40263e6b feat(mixtape): CollectionMosaic shared component
Renders a 2x2 or 3x3 grid of album artwork thumbnails as a single
collection cover. 3x3 layout only for Collections with >= 9 items
(dense "shelf" look); 2x2 otherwise. Artist-collection kind gets a
circular avatar overlay at the bottom-right. Empty state centers a
kind-specific lucide icon. Lazy-loaded thumbnails.

cc
2026-04-18 20:08:50 -06:00
vicrodh 45ad331de5 feat(mixtape): frontend store wrapping the 13 v2_* backend commands
Svelte writable holds the flat collection list for sidebar / grid
subscribers. Thin typed wrappers over Tauri invoke map camelCase arg
keys into snake_case response shapes. addItem returns the backend's
dedup boolean so callers can toast "Already in X" when false.

Covered by vitest (mock invoke): load/get/create/rename/description/
play_mode/kind/custom_artwork/delete/addItem/removeItem/reorderItems/
enqueue with default-mode behavior.

cc
2026-04-18 20:06:24 -06:00
vicrodh a4efbf5cea chore(assets): add my-qbz.svg default icon
Referenced by the new My QBZ collapsible nav section (commit 8466a619)
but the asset file itself was untracked — this ensures it ships with
the feature branch for clean builds.

cc
2026-04-18 20:01:13 -06:00
vicrodh c2eabdcb51 fix(sidebar): use CSS mask for Library nav icon with correct monochrome SVG
Replaces /music-library.svg references in Sidebar and TitleBarNav with
/music-library-2.svg (the corrected all-black monochrome asset the user
provided) and swaps the <img> rendering for a <span> with CSS mask so the
icon inherits the theme's text color — same pattern now used for My QBZ,
cassette, collection, and the existing plex-mono icons.

cc
2026-04-18 20:00:59 -06:00
vicrodh bcfd3ab16b fix(sidebar): tint My QBZ nav icons with theme via CSS mask
The previous implementation used <img src="/my-qbz.svg"> etc., which
browsers won't recolor via CSS — so the icons rendered black on
dark themes. Switch the three default SVGs (my-qbz, cassette,
collection) to CSS mask, same pattern TrackRow already uses for
plex-mono.svg: the SVG becomes a silhouette painted with
currentColor, inheriting the theme's text color.

Custom user-uploaded icons for the My QBZ parent still render via
<img> so their colors show as chosen.

cc
2026-04-18 19:59:56 -06:00
vicrodh 8466a61967 feat(ui): My QBZ collapsible nav wrapper with Mixtapes and Collections children
Adds a top-level collapsible nav section "My QBZ" in the sidebar
containing two children — Mixtapes and Collections — that route to
"Coming soon" placeholder views until the full views land in Phase 5.

The parent's display is user-customizable:
- Label (default "My QBZ") via right-click -> Rename
- Icon (default /static/my-qbz.svg) via right-click -> Change icon,
  which opens a native file dialog; selected path is stored as an
  absolute filesystem path, rendered through convertFileSrc() at
  display time.

Both preferences are per-user localStorage via the existing
userStorage.ts wrapper. Collapsed/expanded state also persists.
reloadMyQbzNav() is invoked post-login alongside the other per-user
store resync calls.

No command or internal identifier changes — the nav children identify
as 'mixtapes' / 'collections' in currentView, matching what the
Phase 5 views will expect.

cc
2026-04-18 19:57:35 -06:00
vicrodh 17e2f711e3 refactor(ui): rename user-facing "Favorites" to "Library"
Aligns with Qobuz's own Library rename in their mobile and desktop
beta apps. Command names, store names, i18n keys, file names, and
internal route identifiers are all unchanged — this is strictly a
user-visible text + icon rewrite.

- Sidebar / TitleBar nav Favorites entry uses /static/music-library.svg
  instead of the lucide Heart
- Artist and label favorite buttons use /static/user-add.svg (albums
  and tracks keep the Heart affordance)
- 5 locale files: all values containing "Favorites" / "Favoritos" /
  "Favoriten" / "Favoris" / "Favoritos" rewritten to "Library" and
  locale-appropriate equivalents (Biblioteca / Bibliothek /
  Bibliothèque / biblioteca)
- "Add to Favorites" / "Remove from Favorites" buttons and toasts
  renamed to "Add to Library" / "Remove from Library"
- Hardcoded title= tooltip strings on track Heart buttons replaced
  with $t() calls

cc
2026-04-18 19:50:28 -06:00
vicrodh bcd07cf084 feat(i18n): Mixtapes and Collections keys across 5 locales
Adds mixtapes / collections / itemType / discographyBuilder /
collectionDetail namespaces, plus 6 common.* entries. Mexican
Spanish per project convention for es.json.

cc
2026-04-18 19:00:26 -06:00
vicrodh 2daff794a8 feat(mixtape): queue_source_collection_id session tracking
In-memory Option<String> tracks which Mixtape/Collection the current
queue was built from. Set by v2_enqueue_collection, cleared by any
non-Mixtape queue replacement (set_queue / clear_queue). Append-style
ops (add/add_next/bulk) preserve the context.

Persistence across restart is deferred — the session_queue_state
table does not exist yet; when it arrives, the ALTER in
mixtape::schema will add the source_collection_id column automatically,
and this state just needs a read+write on the appropriate bootstrap
and commit points.

cc
2026-04-18 18:47:07 -06:00
vicrodh a13de3b369 feat(mixtape): v2_skip_to_next_item and v2_skip_to_previous_item
Two commands that read the current queue + index + elapsed time from
the runtime and call next_item_index / previous_item_index helpers
(already tested in mixtape::enqueue) to compute the target seek
position. Boundary detection uses source_item_id_hint with album_id
fallback, so these also work for queues built via "play album"
outside the Mixtape flow.

Commands are registered and invocable from Tauri but not wired to
any frontend control — per spec §4.5, NowPlayingBar changes are
deferred to a future spec.

cc
2026-04-18 18:41:02 -06:00
vicrodh c6b256470a feat(mixtape): enqueue resolver and v2_enqueue_collection
Polymorphic resolver handles album / track / playlist x qobuz / local
variants; each maps to the canonical QueueTrack the existing "play
album" paths use. Album shuffle applied at enqueue time, tracks
within each item stay in their native order. source_item_id_hint
stamped centrally so skip-to-item boundary detection (next task)
works consistently.

Includes next_item_index / previous_item_index helpers with unit
tests for both the exact-hint and album_id-fallback cases.
local_track_to_queue_track converts LocalTrack sample_rate from Hz
to kHz and wraps artwork_path as a file:// URL.

cc
2026-04-18 18:33:53 -06:00
vicrodh b539f67b7c feat(mixtape): Tauri command layer for CRUD
Twelve v2_* commands wrap mixtape::repo with the standard app state
pattern used by commands_v2/playlists.rs. Enum values travel as
strings across the Tauri boundary; camelCase for frontend, snake_case
for Rust.

Also adds LibraryDatabase::with_connection_mut for the reorder command,
which needs a transaction (&mut Connection).

cc
2026-04-18 18:04:08 -06:00
vicrodh c55a208215 feat(mixtape): CRUD repository for collections and items
Full surface for create/get/list/rename/description/play_mode/kind/
delete/touch_play on collections and add/list/remove/reorder on items.
Dedup on exact (source, source_item_id) within a collection. Artist
collection kind is locked (cannot be converted to/from). Cascade
delete covers items. Position compaction on remove; atomic transaction
on reorder.

Covered by 10 unit tests using in-memory SQLite.

cc
2026-04-18 17:57:41 -06:00
vicrodh cf74dae4c5 feat(mixtape): qbz-models types for collections and items
Polymorphic item_type (album | track | playlist) via enum.
Two-value AlbumSource (Qobuz | Local) — LocalLibrary resolves
providers internally. Serde snake_case for JSON interop.

cc
2026-04-18 17:48:20 -06:00
vicrodh 357650300d feat(mixtape): schema migrations for collections and items
Two new tables (mixtape_collections, mixtape_collection_items) with
CASCADE on delete and indexes for the two common query patterns. One
additive column on session_queue_state for queue-source tracking.

Idempotent (CREATE TABLE IF NOT EXISTS, ALTER only when missing),
safe on every app start. The ALTER is skipped gracefully if
session_queue_state hasn't been created yet.

Adds LibraryDatabase::with_connection() helper (qbz-library) so
src-tauri can run external DDL on the shared Connection without
exposing it as a field. Migration is wired in session_lifecycle
immediately after library.init_at() in both the online and offline
activation paths.

cc
2026-04-18 17:46:13 -06:00
vicrodh b2fb251783 feat(queue): add source_item_id_hint to QueueTrack
Reserved for upcoming Mixtape/Collection enqueue paths to mark item
boundaries. Existing enqueue paths populate it with the track's
album_id as a safe fallback so skip-to-item commands behave
correctly even for queues built via "play album" today.

cc
2026-04-18 17:23:59 -06:00
vicrodh c2da9512ff refactor(ui): extract SourceBadge component from AlbumCard
Zero visual change. The Mixtape/Collection detail view will import the
same component. Adds qobuz_streaming as a new value alongside the four
existing LocalLibrary values; AlbumCard's own prop type is unchanged.

cc
2026-04-18 17:13:29 -06:00
vicrodh b62ffc730a refactor(home): rename yourMixes to qobuzMixes
Disambiguates Qobuz's auto-generated "Your Mixes" section from the
upcoming user-owned Mixtapes feature (spec
qbz-nix-docs/specs/2026-04-18-mixtapes-collections-design.md).

- Renamed HomeSectionId type union entry from 'yourMixes' to 'qobuzMixes'
- Updated DEFAULT_SECTIONS in homeSettingsStore.ts
- Renamed translation keys in all 5 locale files (en, es, de, fr, pt)
- Updated section labels to "Qobuz Mixes", "Mixes de Qobuz", etc.
- Updated all component references in HomeView, DynamicSuggestView, FavQView,
  ForYouTab, TopQView, and WeeklySuggestView

cc
2026-04-18 16:53:06 -06:00
vicrodh e5fbdc19fe chore(assets): add cassette and collection SVG icons
Provided by user for the upcoming Mixtapes & Collections feature (spec
qbz-nix-docs/specs/2026-04-18-mixtapes-collections-design.md, §5.5).
Used for sidebar nav items and detail-view headers.

cc
2026-04-18 16:37:36 -06:00
vicrodh eeb1f4b85c Merge branch 'bugfix/issue-329-keyring-defensive' into pre-release
Defensive keyring handling for credentials/mod.rs to fix issue #329:
- 2.5s wall-clock timeout on every Secret Service call
- Session-wide atomic latch so a broken keyring prompts at most once per process
- File-first semantics everywhere (save_oauth_token inverted from keyring-first)

qbz-secrets (offline-cache master key) deliberately left untouched to avoid
breaking existing BACKEND_MARKER_KEYRING blobs. Phase 2.

Fixes #329.

cc
2026-04-18 13:23:57 -06:00
vicrodh 8314b955c4 fix(credentials): defensive keyring handling with timeout and session latch
Linux Secret Service (GNOME Keyring / KWallet) can block indefinitely on
an unlock dialog when the user's login keyring is out of sync with their
session password. Each credential touch (load at bootstrap, save after
login, save-credentials on password path) used to produce its own dialog,
so every login triggered 3-4 prompts the user had to dismiss before the
app could continue (issue #329).

Make credentials/mod.rs defensive:

- Every keyring operation runs on a worker thread with a 2.5 s wall-clock
  timeout (run_with_keyring_timeout). If the user is staring at an
  unlock dialog they can't satisfy, control flow continues after the
  timeout while the worker stays blocked in the background.

- A process-wide atomic (KEYRING_STATE) latches to BROKEN on the first
  failure or timeout. Subsequent keyring_get / keyring_set /
  keyring_delete calls short-circuit and the app falls back to the
  encrypted file path for the rest of the session. One prompt max per
  process. NoEntry does not count as a failure.

- The encrypted file in the config directory is the single source of
  truth for every credential. save_qobuz_credentials already worked this
  way; save_oauth_token was inverted from keyring-first to file-first so
  the keyring is no longer on the success path of OAuth login.

- Load paths try the keyring first (cheap when it works) and fall back
  to the file; the obsolete "migrate file to keyring" branches are gone.

Public API is unchanged. All existing callers compile unmodified. Existing
encrypted files and keyring entries remain readable; no file-format
changes.

qbz-secrets (offline-cache master key) is deliberately untouched — adding
a KDF fallback there without a migration plan would make existing
BACKEND_MARKER_KEYRING blobs undecipherable. Filed as Phase 2 in the
analysis doc at qbz-nix-docs/bugfix/2026-04-18-issue-329-keyring-unlock-dialog.md.

Fixes #329.

cc
2026-04-18 13:18:48 -06:00
vicrodh 9b0b4d62e8 Merge branch 'feature/lyrics-sidebar-controls' into pre-release
Sidebar lyrics display controls per issue #328:
- Popover with Auto-follow, Font, Size (S/M/L/XL), Dimming, Active color,
  Uppercase toggle, Copy to clipboard, Reset
- Per-user persisted preferences via userStorage
- Font select uses the app Dropdown for style consistency
- Reload hook in +page.svelte so scoped storage is read after login
- Active color overrides the karaoke gradient and glow via a new
  --lyrics-active-color CSS custom property, falling back to the theme
  accent when unset
- Immersive lyrics and the standalone lyrics-only view are untouched

cc
2026-04-18 12:43:08 -06:00
vicrodh 6b91bd3872 feat(lyrics): active-line color picker, uppercase toggle, bigger L/XL
Add two persisted prefs to the lyrics sidebar display controls:

- activeColor: hex color override for the karaoke/active-line accent.
  Empty string means follow the theme's --accent-primary. Rendered via
  a new --lyrics-active-color CSS custom property set inline on the
  LyricsLines container; all four references to --accent-primary in
  the active-line gradient and glow shadows now fall back through it.
  Popover row shows a native color input plus a 'Theme' clear button
  that appears only when a custom color is set.

- uppercase: render all lines as uppercase in the sidebar. Applied via
  text-transform on .lyrics-lines.compact.uppercase. Switch toggle in
  the popover.

Bump L and XL sidebar sizes by the requested amount:
- L: 17/20 -> 18/21
- XL: 20/24 -> 22/26
(small and medium are unchanged.)

Both new prefs persist per-user in the same localStorage payload via
the existing sanitize/reload flow, and the hex validator rejects
malformed values on read.

cc
2026-04-18 12:41:34 -06:00
vicrodh 7480df9ede fix(lyrics): move copy button into popover and reload prefs after login
Move the copy-lyrics action from the sidebar header into the controls
popover footer, alongside Reset. The sidebar header is back to a single
Settings trigger. Footer layout uses space-between so Copy sits on the
left and Reset on the right, both sharing the same button style.

Add reloadLyricsDisplay() to the store and call it from +page.svelte
right after resyncPersistedVolume. The store is initialized at module
load time (before login), so the first read falls back to the unscoped
storage key. Without this reload, the logged-in user's saved
preferences — including auto-follow — were never picked up after an
app restart, leaving the sidebar stuck on defaults.

cc
2026-04-18 12:25:08 -06:00
vicrodh 539bc72d85 feat(lyrics): add copy-to-clipboard button in sidebar header
A Copy icon button to the left of the Display settings trigger writes
the current track's lyrics (joined with newlines) to the clipboard via
the Tauri clipboard-manager plugin. The icon briefly swaps to a Check
for 1.5s on success, and a success/error toast is shown. The button is
disabled while lyrics are loading, when an error is displayed, or when
no lyrics are available.

cc
2026-04-18 12:18:13 -06:00
vicrodh 6ee3b5c8cd feat(lyrics): use app Dropdown for font select and add XL size option
Swap the native <select> in LyricsControlsPopover for the shared Dropdown
component so the font picker matches the app's settings style. Widen the
popover to fit the Dropdown trigger and shrink its chrome to keep the
overall scale compact.

Add an XL font size (20/24 px) alongside S/M/L, extending the
LyricsFontSize type, the sanitize validator, the size class in
LyricsLines, and the i18n entry across all five locales.

cc
2026-04-18 08:54:22 -06:00
vicrodh 54d5cde924 feat(lyrics): wire display controls popover into LyricsSidebar
cc
2026-04-18 08:20:15 -06:00
vicrodh a2514289d2 feat(lyrics): add LyricsControlsPopover component
cc
2026-04-18 08:17:46 -06:00
vicrodh b73776d2e6 feat(lyrics): accept optional font/size/dimming props in LyricsLines
cc
2026-04-18 08:15:29 -06:00
vicrodh 6275c43fc2 feat(lyrics): add per-user lyrics display preferences store
cc
2026-04-18 08:04:16 -06:00
vicrodh d84d9a9836 feat(lyrics): add i18n keys for sidebar display controls
cc
2026-04-18 08:00:43 -06:00
vicrodh 260e5c499c feat(login): show MIT-license-aware trademark disclaimer on loading screen
Pin the API-usage + trademark disclaimer to the bottom of the initializing
state of LoginView so the legal notice is visible during startup, not only
on the login screen proper. Update legal.trademarkNotice in all five locales
to mention the MIT license explicitly.

cc
2026-04-18 00:15:17 -06:00
vicrodh 2a9f90e3e7 fix(build): scope x86_64 rustflags so aarch64 builds don't break
The .cargo/config.toml used [build] rustflags which applies globally
to every target. On aarch64-apple-darwin this injects
target-cpu=x86-64-v3 and +ssse3 as "ignored features", but the ring
crate's static CPU feature assertions detect the perturbed feature
set and fail to compile with:

    error[E0080]: evaluation panicked:
    assertion failed: CAPS_STATIC == MIN_STATIC_FEATURES
    at ring-0.17.14/src/cpu/arm/darwin.rs:51

Move the flags under [target.'cfg(target_arch = "x86_64")'] so only
x86_64 builds see them. ARM/Apple Silicon targets get their own AES
hardware path automatically via the aes crate's armv8 dispatch — no
explicit flags needed.

cc
2026-04-17 16:31:33 -06:00
vicrodh 3ce384ad76 Merge branch 'feature/offline-cache-cmaf-hardening' into pre-release
cc
2026-04-17 16:22:50 -06:00
vicrodh e95e07d4a4 style(buttons): homologate circular action-btn primary across the app
Collapse .action-btn-circle.primary to a single size override in
app.css (44x44) so it inherits the same transparent fill + muted
ring as the secondaries. Size is now the only visual differentiator.
The previous accent-hover fill + white ring combination looked
cut-off on some themes and demanded per-theme babysitting — a
consistent, theme-independent visual language is worth more than the
"main action" color cue, which is reinforced already by the larger
glyph (size 20 vs 18).

Also drop LabelView's local scoped override of .action-btn-circle
(bg-tertiary fill + accent-primary primary). It predated the global
rule and drifted. Now everything cascades from app.css.

cc
2026-04-17 16:22:28 -06:00
vicrodh 27483e57e3 fix(gapless): keep one-shot guard engaged after backend rejects
Logs showed play_next_gapless firing every ~1s for the entire end of a
track when the backend answered "not in any cache, gapless not
possible". The .finally() block was clearing gaplessAttemptTrackId,
which defeated the one-shot guard it was supposed to implement: the
guard check gaplessAttemptTrackId !== currentTrack.id flipped back to
true on every event, so each gapless_ready signal re-fired the invoke.

The event handler at line ~634 already clears the guard when the
event reports a different track_id (a real transition), so pinning
the attempt to currentTrack.id and leaving it alone until then is
the correct lifecycle.

cc
2026-04-17 16:22:19 -06:00
vicrodh 71c9d2a39f feat(offline-cache): unlock-aware UI feedback on decrypt
Two polish beats on top of the existing offline:unlock_start/end
signal so the user can tell encrypted-at-rest playback apart from a
slow network:

1. TrackRow gains a "recently unlocked" state: the store holds each
   id in recentlyUnlockedIds for 600ms after unlock_end, and the row
   flashes an opened-padlock (LockOpen) glyph before the equalizer
   takes over. Failure end-events skip the flash so broken decrypts
   don't look celebratory.

2. Toast.svelte subscribes to isAnyUnlocking() and, while any track
   is being decrypted, swaps the spinner for a jiggling Lock icon
   and cycles the shimmer label through Unlocking / Decrypting /
   Loading / Validating. Plain network buffering still shows
   "Buffering" as before.

cc
2026-04-17 15:12:12 -06:00
vicrodh 83427ea400 fix(search): drop chunky QualityBadge from Most Popular card
The rough compact QualityBadge was overflowing the Most Popular card
on narrow layouts (visible on tracks like Mini World). Every other
place in the app already uses formatQuality() text for this density;
the Most Popular card was the last holdout. Now matches ArtistDetail /
Purchases / Label views.

cc
2026-04-17 15:12:03 -06:00
vicrodh a7e2a8e911 feat(ui): animated padlock on track row while offline CMAF decrypt runs
User feedback from live testing: even with gapless working correctly,
the cold first-play of an offline CMAF bundle takes ~500ms to decrypt
on AES-NI hardware, 5-6s on the software fallback. No visible
indicator of what was happening — UX felt like the app was stalling.

Solution: when a track is being decrypted, replace its play glyph in
the track row with an animated padlock (lucide-svelte Lock icon +
CSS keyframe shake/scale). Tells the user "we're unlocking your
content", which is literally what's happening.

Implementation:

- Backend: new helper `load_cmaf_bundle_with_ui_events` wraps the
  spawn_blocking decrypt with two Tauri events:
  - `offline:unlock_start { trackId }`
  - `offline:unlock_end   { trackId, success }`
  The helper takes two ids: `display_track_id` (what the frontend
  knows this track as — Qobuz id or library row id depending on
  flow) and `cmaf_track_id` (the Qobuz id used to key the bundle
  inside load_cmaf_bundle itself). Same track shows the animation
  whether clicked from Qobuz view or Local Library.
- All three v2 decrypt call sites now route through the helper:
  v2_play_track offline branch, v2_play_next_gapless (both the
  Qobuz-id and Library-qobuz_download branches), and
  v2_library_play_track.
- Frontend: new store `unlockingStore` maintains a `Set<trackId>`
  updated from the events, with subscribe/isUnlocking API. Started
  from +page.svelte alongside the existing player/queue pollers.
- TrackRow.svelte: new `isUnlocking` reactive state derived from
  the store, a new branch in the play-number template that renders
  the Lock icon with `lock-shake` animation, scoped CSS keyframes
  (qbz-unlocking — slight rotate + scale + opacity pulse at 1.2s
  loop, accent-primary colour, cursor: progress).

The animation fires on cold decrypt only; warm L1/L2 hits bypass the
decrypt entirely and don't emit the events, so the user never sees
the padlock for a cached track — correct behavior.

cc
2026-04-17 14:11:44 -06:00
vicrodh 38390db408 fix(offline-cache): persist artwork_path so library UI shows cover art
Qobuz-cached tracks (both v1 legacy and new v2 bundles) weren't
showing album art in Local Library. Root cause was a pair of bugs:

1. Legacy v1 path DID download cover.jpg to the organized album
   directory (via save_album_artwork) but passed None as artwork_path
   when inserting into the library index. So the file existed on
   disk but the DB row didn't point at it — the UI had no way to
   find it. Pre-existing bug, not introduced by the v2 work.

2. v2 CMAF bundle path didn't save artwork at all. Worked fine for
   encrypted playback but the tracks-cmaf/<id>/ directory had no
   cover.jpg for the UI to fall back to.

Fix: in both paths, call save_album_artwork next to the cached
content (organized FLAC parent for v1, tracks-cmaf/<id>/ for v2),
then pass the cover.jpg path to insert_qobuz_cached_track_with_
grouping's artwork_path parameter. Library rows now carry the
on-disk path to the artwork and the UI picks it up just like for
user-owned local FLACs.

New downloads will have artwork immediately. Tracks already in the
cache from before this commit will remain artwork-less until
re-downloaded — acceptable since the user can just re-trigger
download per track if they want the art back, and the 30-day
subscription wipe refreshes everything eventually anyway.

cc
2026-04-17 13:35:57 -06:00
vicrodh 82781d3e55 perf(player): bump gapless lead time from 5s to 10s
Offline-cache v2 bundles need runway for the decrypt pipeline. At 10
MB/s (software AES fallback) a 58 MB track needs 6 seconds, which
blew past the old 5s pre-emptive window and missed the gapless handoff
entirely. With AES-NI active the decrypt is ~500ms, so 10s is
harmless overkill — the decrypted bytes just sit in L1 a few seconds
earlier.

Design note: this is complementary to the AES-NI target-feature fix,
not a substitute. A too-small lead time makes gapless brittle even on
fast hardware (any hiccup blows the window); a too-large one is
wasted memory but otherwise fine. 10s is comfortable for every
realistic hardware/track-size combo we'll see.

If we ever want user-visible control, plumb a `gapless_lead_secs`
through AudioSettings and read it at the hot site.

cc
2026-04-17 13:12:08 -06:00