Commit Graph
5632 Commits
Author SHA1 Message Date
vicrodh 4f0e4e6c81 fix(commandRouter): rewire audio invokes to actual v2 command names
cmdUpdateAudioSettings was invoking four v2 commands that do not exist:
- v2_set_audio_backend       -> v2_set_audio_backend_type
- v2_set_audio_device        -> v2_set_audio_output_device
- v2_set_exclusive_mode      -> v2_set_audio_exclusive_mode
- v2_set_dac_passthrough     -> v2_set_audio_dac_passthrough

Also corrects the parameter for set_audio_output_device, which expects
'device' (not 'deviceName'). The other three already use the correct
parameter names. The function currently has no callers, but keeping the
shape correct prevents a future caller from hitting silent failures.

cc
2026-04-25 18:23:01 -06:00
vicrodh 404296f49f fix(diagnostics): rename v2_qconnect_get_status to v2_qconnect_status
The frontend was invoking 'v2_qconnect_get_status', but the backend
command is registered as 'v2_qconnect_status' under qconnect_service.
This caused two callsites in the diagnostics path to fail at runtime:
- src/lib/services/diagnosticsSnapshot.ts
- src/lib/components/DiagnosticsPanel.svelte

cc
2026-04-25 18:22:22 -06:00
vicrodh 58443b020e fix(scripts): audit-frontend-invokes recognizes commands from any namespace
The previous regex only matched commands registered under commands_v2::,
missing 50+ legitimate v2_qconnect_* commands registered under
qconnect_service::. This produced 64 false-positive "missing_v2" callsites
that obscured real audit signal.

Generalize the registration regex to match any module prefix ending in
::v2_* or ::runtime_*, so future modules that follow the v2_ naming
convention are picked up automatically without script changes. The inner
alternation still excludes legacy commands, which never carry the v2_ or
runtime_ prefix on the function name.

After the fix, missing_v2_callsites drops from 64 to 6 (the remaining 6
are real frontend typos, not audit-script bugs); legacy_callsites stays
at 0; unknown_callsites stays at 16.

cc
2026-04-25 18:07:06 -06:00
vicrodh 9cfaf755f5 Merge feature/internal/track-shuffle-mix into pre-release 2026-04-25 17:46:36 -06:00
vicrodh 13bd95a663 fix(playlist): rebuild custom order from visible state on every move
Custom-sort reordering inside a playlist (arrow buttons + drag and
drop) silently no-op'd or shifted by the wrong amount. Investigation
on a 15-track playlist showed customOrderMap with duplicate positions
(two tracks at position 6) and the moved track at map-position 10
while displayed at index 11 — the in-place shift algorithm assumed
display-index and map-position lived in the same number space, which
is only true when positions are unique 0..N-1.

Once any duplicate sneaked in, every subsequent click hit the no-op
path: target newPosition equalled current map-position, the per-key
shift loop's `pos > fromIndex && pos <= toIndex` window collapsed to
empty, and the backend's move_playlist_track saw current==new and
returned without writing. The user had to toggle sort mode to force
loadOrInitCustomOrder to re-fetch backend state — which masked the
fact that the local algorithm itself was wedged.

This rewrites moveTrack to ignore the existing map values and instead
splice the visible displayTracks order, then renumber 0..N-1. The new
order is shipped to v2_playlist_set_custom_order, whose backend impl
is a DELETE + INSERT for the playlist, so any pre-existing corruption
self-heals on the first move.

Concurrent clicks are serialized through a Promise chain so backend
writes land in click order even though tokio's mutex isn't strictly
FIFO. The optimistic local update happens synchronously before the
chain dispatch, so subsequent clicks see the post-move displayTracks
state without waiting for the round-trip.

Note: the latent bug in database.rs::move_playlist_track that lets
duplicate positions exist in the first place (the INSERT branch on
line 3354 doesn't shift existing rows) is not addressed here — the
new flow simply doesn't use that code path. Backend cleanup is a
separate fix.

cc
2026-04-25 13:06:21 -06:00
vicrodh 603c78cadd fix(ui): rebuild TrackMixModal on shared Modal + Dropdown + .btn classes
Replaces the first-pass implementation that rolled its own backdrop and
pill-style size buttons. The pills had two problems: pills are forbidden
by the project design rules (qbz-nix-docs/design/FIGMA_PROMPT.md), and
the custom modal centered itself with `transform: translate(-50%, -50%)`
which created a containing block for `position: fixed` descendants —
that broke `Dropdown.svelte`'s portaled menu, which landed in the
bottom-right corner of the screen instead of below the trigger.

Now wraps `Modal.svelte` (portaled to body, flexbox-centered, ESC
built in), uses `Dropdown.svelte` for the size picker, and follows
the project convention of `<div class="modal-actions">` + the global
`.btn .btn-primary` / `.btn .btn-secondary` classes for the footer.

Copy is reworked to read like a sentence: title "Random queue", body
"Create a random queue with songs from this collection. How many songs
do you want?", confirm button "Add to queue". Synced across en/es/de/fr/pt.
Drops the now-unused `mixModal.subtitle` key.

Also removes the duplicated mixModalOpen entry from the view's
keydown ESC chain — `Modal.svelte` already handles ESC.

cc
2026-04-25 13:05:42 -06:00
vicrodh 656b40cd13 chore(deps): refresh Cargo.lock for strsim direct dep
Side effect of promoting strsim from transitive to direct in commit
f048ee76 (feat(mixtape): add shuffle module with normalize +
token_set_ratio).

cc
2026-04-25 06:30:21 -06:00
vicrodh 83c276dc43 feat(ui): wire DJ Mix button into collection/mixtape detail view
Adds a third circular header action between Shuffle and More that
opens TrackMixModal, then delegates the resolved sampleSize to
v2_collection_shuffle_tracks. Replaces the queue, starts playback,
and surfaces a toast when actualCount < requestedCount (dedup or
per-album cap shrunk the pool).

ESC chain extended to dismiss the mix modal before closing other UI.
collection.play_mode is left untouched.

cc
2026-04-25 06:26:22 -06:00
vicrodh 48f4d130e4 feat(ui): add TrackMixModal with size picker + i18n keys
- TrackMixModal.svelte renders a centered radiogroup of queue sizes
  (50, 100, 150, …, "All (N)") backed by buildSizeOptions. Fetches the
  unique track count via v2_collection_unique_track_count when first
  opened for a collection and caches it for subsequent opens of the
  same collection.
- buildSizeOptions is a pure helper extracted to a separate file so it
  can be unit-tested cleanly. 8 vitest cases cover the empty/null,
  small, exact-50, multiple-of-50, and irregular paths.
- Adds 8 new i18n keys (common.shuffleTracksMix, mixModal.title /
  computing / subtitle / allOption / confirm / loadFailed,
  toast.mixTrimmed) across all 5 locale files.
- z-index 3000/3001 per ADR-003.

cc
2026-04-25 06:24:09 -06:00
vicrodh 404d6f431b feat(v2): add v2_collection_shuffle_tracks command
End-to-end DJ-mix command. Loads the collection, resolves its natural
in-order track list, dedupes near-duplicate versions, samples up to
sample_size tracks under the per-album cap, replaces the queue, and
starts playback from index 0. Stamps queue_source_collection and bumps
the play counter (mirroring v2_enqueue_collection's replace mode), but
does not modify the collection's persistent play_mode.

Returns ShuffleTracksResult { requestedCount, actualCount } so the
frontend can show the trimmed-mix toast when the cap or dedup shrinks
the pool.

ThreadRng is not Send, so dedup + sample run inside a sync scope that
ends before the bridge awaits.

cc
2026-04-25 06:18:24 -06:00
vicrodh da33e43257 feat(v2): add v2_collection_unique_track_count command
Resolves the collection's natural in-order track list and returns the
count of distinct songs after similarity-based deduplication. Used by
the upcoming track-mix modal to size the slider of pickable queue
sizes. Auth gated; deterministic output.

cc
2026-04-25 06:12:02 -06:00
vicrodh 26b39495d8 feat(mixtape): add hybrid_sample with per-album cap
Round-robin sampling that picks up to `requested` tracks from a
deduped track list. Each album bucket is shuffled in place and
truncated to cap = max(2, ceil(requested * 0.30)); rounds permute
the album order so cross-album distribution is randomized too. May
return fewer than `requested` when the per-album cap and bucket
sizes do not add up — callers report this gap to the user.

7 new tests (37 total) including a 200-seed statistical test
confirming the cap is never exceeded.

cc
2026-04-25 06:05:18 -06:00
vicrodh 6649ee0759 feat(mixtape): add dedup_by_similarity and unique_track_count
- unique_track_count returns the count of distinct songs after grouping
  near-duplicate versions; deterministic, no RNG.
- dedup_by_similarity collapses each duplicate group to one survivor
  picked at random via the supplied RNG. Output preserves input order
  of survivors.

Both share a single bucketed Union-Find pass: tracks are first grouped
by exact normalized artist, then unioned within each artist bucket
when their normalized titles score >= 0.80 on token_set_ratio. Cross-
artist comparisons are skipped to avoid false positives like "Yesterday"
by different artists.

12 new tests (30 total in this module) including a 200-seed statistical
test confirming every duplicate version can be selected as the winner.

cc
2026-04-25 05:34:11 -06:00
vicrodh f048ee7645 feat(mixtape): add shuffle module with normalize + token_set_ratio
Pure-function helpers used by the upcoming track-mix sampler:
- normalize_title strips parens/brackets, dash suffixes, feat patterns,
  punctuation, and diacritics.
- normalize_artist keeps parens (band suffixes carry meaning) and just
  lowercases + strips diacritics.
- token_set_ratio implements the RapidFuzz-style token-set similarity in
  [0.0, 1.0] using strsim's normalized Levenshtein.

Promotes strsim from transitive to direct dep. 18 unit tests cover the
core normalization and similarity behaviors.

cc
2026-04-25 05:22:02 -06:00
vicrodh 75efe7f8e9 feat(ui): add DjIcon component
Inlined SVG component for the upcoming track-shuffle mix button.
Uses fill="currentColor" so it inherits theme color. The source
SVG (static/dj-1.svg) is kept as a reference asset.

cc
2026-04-25 05:08:05 -06:00
vicrodh 828f63dc22 Merge branch 'feat/internal/low-memory-auto-detect' into pre-release
Memory mitigations for issue #331 (Pi 3B / 1 GB hosts):

- qbz-core::system_capabilities reads /proc/meminfo at startup and
  derives a MemoryProfile (Normal vs LowMemory). Cached in OnceLock.
- V2 prefetch (commands_v2/playback.rs) caps prefetch_count and
  max_concurrent_prefetch from the profile, downgrades HiRes to
  Lossless when allow_hires_prefetch is false.
- StreamingConfig::from_speed_mbps clamps the dynamic initial
  buffer to a process-wide cap configured from the profile (256 KB
  on LowMemory vs 2 MB historical max).
- AudioCache L1 cap also scales (50 MB on LowMemory vs 400 MB).
- Tokio watchdog spawned on LowMemory hosts polls MemAvailable
  every 10 s; flushes audio caches when below 5 % to break the
  swap-thrash loop codehd7 reported.

Includes the rodio 0.22 NonZero test fix (also in the bugfix
merge above) so the branch validates standalone.

cc
2026-04-24 19:51:30 -06:00
vicrodh c471c03eba Merge branch 'bugfix/internal/issue-331-fallback-gate' into pre-release
Fixes the iec958: -> hw:CARD=...,DEV=... fallback gate that was
silently disabled for non-USB sound cards (HifiBerry, intel-hda,
etc.) because the previous gate required /proc/asound/cardN/stream0,
which only USB-audio drivers emit. The HifiBerry Digi2 Pro on
Raspberry Pi OS reported in #331 hits exactly this case.

Also bumps the visualizer test fixtures to rodio 0.22's
NonZero<u16>/NonZero<u32> SamplesBuffer::new signature so
cargo test -p qbz-audio compiles.

cc
2026-04-24 19:51:17 -06:00
vicrodh d98cc569b0 test(visualizer): wrap SamplesBuffer args in NonZero for rodio 0.22
rodio 0.22 tightened SamplesBuffer::new to require NonZero<u16> for
channels and NonZero<u32> for sample_rate, but the visualizer test
fixtures still passed bare integer literals — so the qbz-audio test
binary stopped building. Wrap both call sites in NonZero::new(...)
.unwrap() so cargo test -p qbz-audio compiles again.

Pure test-only change; runtime visualizer code was already migrated.

cc
2026-04-24 19:46:05 -06:00
vicrodh 89c0d65285 feat(memory): scale L1 audio cache cap to host memory profile (#331)
Add audio_cache_l1_max_bytes to MemoryProfile and wire it into
AppState's AudioCache constructor. Normal hosts keep the historical
400 MB cap; LowMemory hosts drop to 50 MB.

Without this, a Pi 3B (1 GB total) starts with the L1 cache cap set
at ~40 % of physical RAM. Even with the Feature #3 prefetch caps
already in place, the runtime watchdog from the previous commit
ends up firing more often than necessary because nothing prevents
a single L1 fill cycle from claiming 400 MB. Capping at 50 MB caps
how much the cache can grow before either: (a) eviction picks up
naturally, or (b) the watchdog steps in if the rest of the system
is also under pressure.

Pure refactor in lib.rs — replaces a hard-coded 400 * 1024 * 1024
with a profile field read. The default-constructed AudioCache
fallback (when disk-spillover init fails) keeps its own crate
default; no need to thread the profile there since the failure
path is rare.

Two tests added: a presence-bound assertion in the existing Pi 3B
case, and an explicit comparison that LowMemory's cap is strictly
smaller than Normal's.

cc
2026-04-24 19:45:38 -06:00
vicrodh c6fc01961f feat(memory): spawn audio-cache eviction watchdog on low-memory hosts (#331)
Tauri setup() now spawns a tokio task that polls
qbz_core::system_capabilities::read_memory_pressure() every 10 s
when the resolved MemoryProfile classifies the host as LowMemory.
On Normal-class machines the task is never spawned, so polling cost
is zero where it isn't needed.

Behavior:
- pressure.is_critical (< 5 % MemAvailable) triggers
  audio_cache.clear() once per critical episode and logs at warn.
  Both L1 (in-memory tracks) and L2 (disk spillover) are flushed —
  the disk hit on subsequent playback is far cheaper than letting
  the OS swap-thrash through the audio thread.
- pressure.is_low (< 15 %) is logged once at info as an early
  warning but does not evict.
- Recovery (back above 15 %) logs once and arms the next critical
  episode.

The was_critical edge guard prevents log spam when pressure
oscillates near the threshold during heavy prefetch.

For codehd7's Pi 3B scenario (issue #331): when QBZ pushes
MemAvailable below ~47 MB (5 % of 938 MB), the watchdog flushes
the cache, frees memory back to the kernel, and the network stack
recovers from the swap thrash that was killing playback.

cc
2026-04-24 19:43:45 -06:00
vicrodh e8128b813a feat(core): add MemoryPressure snapshot for runtime watchdog
Extend qbz-core's system_capabilities with a parse_meminfo_available_kb
helper plus a small MemoryPressure value object that classifies the
host's current available memory against thresholds derived from
MemoryProfile. The watchdog (src-tauri side, next commit) polls this
to decide when to evict caches.

Thresholds intentionally simple for v1: is_low triggers under 15 %
available, is_critical under 5 %. Both are strict-inequality so the
exact-percent boundaries don't flap.

The pure pressure_from_figures(avail_kb, total_kb) factors out the
math from the /proc read so threshold behavior is tested without
touching the filesystem. Refactors the existing
parse_meminfo_total_kb to share a parse_meminfo_field_kb helper with
the new available-memory parser.

Adds 9 tests covering the parser, the threshold boundaries, the zero-
total divide-safety guard, and the codehd7 issue #331 scenario
(Pi 3B, ~25 MB available out of 938 MB → critical).

cc
2026-04-24 19:41:12 -06:00
vicrodh b38065a033 feat(streaming): cap StreamingConfig initial buffer per memory profile (#331)
StreamingConfig::from_speed_mbps inflates the initial buffer to 2 MB
on slow connections (< 1 MB/s) to absorb network jitter. On a healthy
desktop that's fine, but on a memory-constrained host the slow link
is itself a symptom: when QBZ on a Pi 3B starts allocating ~300 MB
of Hi-Res prefetch the kernel swaps, networking stalls, the speed
detector reports < 1 MB/s, and the buffer code reacts by allocating
ANOTHER 2 MB — exactly the wrong direction.

Add a process-wide AtomicUsize cap (defaults to usize::MAX, i.e.
no-op) plus a small public set_max_initial_buffer_bytes setter.
Refactor from_speed_mbps to clamp through the cap; extract the
speed-to-bytes ladder into a pure raw_initial_buffer_for_speed
helper plus a from_speed_mbps_with_cap variant that exposes the
clamping for unit tests without touching global state.

src-tauri/lib.rs's run() wires the cap into qbz-player from
qbz-core's MemoryProfile right after logging the profile. Effective
on Pi 3B (issue #331): all StreamingConfig::from_speed_mbps results
pin to 256 KB regardless of detected speed.

Re-export max_initial_buffer_bytes / set_max_initial_buffer_bytes
from qbz_player::player so external callers don't need to reach
into the private streaming_source module.

Adds 5 unit tests: ladder behavior, pass-through when cap is loose,
clamp at the LowMemory cap (the issue #331 case), no-op at the
Normal cap, and that max_buffer_bytes stays unchanged.

cc
2026-04-24 19:32:51 -06:00
vicrodh d616a0796a feat(playback): apply MemoryProfile to V2 prefetch (#331)
Wire qbz-core's detected MemoryProfile into the V2 prefetch loop so
memory-constrained hosts (Pi 3B and similar, < 2 GB RAM) cap their
in-memory footprint:

- V2_PREFETCH_COUNT becomes a function reading profile.prefetch_count
  (5 on Normal, 1 on LowMemory). Reading it once per loop call is
  cheap — OnceLock-cached behind the scenes.
- V2_MAX_CONCURRENT_PREFETCH likewise becomes a function; the
  semaphore lazy_static initializes from it once at process start.
- Effective prefetch quality gets a low-memory cap before the
  hardware-rate ladder runs. When profile.allow_hires_prefetch is
  false we drop UltraHiRes/HiRes to Lossless so each cached track
  stays under ~15 MB instead of ~60 MB. The hardware downgrade
  still runs after, so a low-memory + 48 kHz-only DAC still gets
  the right rate.
- lib.rs forces an early call to memory_profile() in run() so the
  resolved profile is logged at boot rather than at first prefetch.

For codehd7's reported case (Pi 3B, 1 GB, HifiBerry Digi2 Pro,
issue #331): the active profile becomes prefetch_count=1,
max_concurrent_prefetch=1, allow_hires_prefetch=false. Cached
prefetch footprint drops from ~5 × 60 MB = 300 MB to a single
~15 MB Lossless track — well within the headroom that 1 GB minus
WebView (~150 MB) leaves.

cc
2026-04-24 19:26:21 -06:00
vicrodh 0a4b4095f5 feat(core): add system_capabilities::MemoryProfile auto-detect
New module in qbz-core that probes /proc/meminfo at startup and
classifies the host into Normal (>= 2 GB RAM) or LowMemory (< 2 GB)
buckets, then derives runtime caps for memory-sensitive subsystems:
prefetch_count, max_initial_buffer_bytes, max_concurrent_prefetch,
allow_hires_prefetch.

Detection is split into a pure parse_meminfo_total_kb +
detect_profile_from_meminfo pair (testable with synthetic input)
and a thin detect_profile wrapper that reads the file. The
process-wide profile is cached in a OnceLock and logged once at
first access, so subsequent callers pay zero filesystem cost.

The Normal-fallback path covers macOS, Windows, and any Linux where
/proc/meminfo is missing or unparseable — we never accidentally
throttle a system whose memory we couldn't measure.

This commit only ships the module; wiring into the prefetch loop
and streaming buffer follows in the next commits.

Adds 10 unit tests covering the parser, the threshold boundary
(exactly 2 GB → Normal, just under → LowMemory), the Pi 3B and
Pi Zero 2W cases that motivated this work (#331), and the
unparseable-input fallback.

cc
2026-04-24 19:22:08 -06:00
vicrodh 18d8bc3572 fix(alsa): gate hw fallback on card presence, not stream0 rates (#331)
The hw:CARD=…,DEV=… fallback added in 1.2.8 (commit 927fabbd7) only
fired when the helper chain
  extract_card_name_from_device(device_id)
      .and_then(|card| get_hw_supported_rates(&card))
      .is_some()
returned Some — but get_hw_supported_rates parses
/proc/asound/cardN/stream0, which is only emitted by the USB-audio
driver. I2S, PCI and built-in cards (HifiBerry HATs, intel-hda, etc.)
don't have a stream0 file at all, so the gate evaluated to false for
the very devices that needed the fallback the most. The reporter's
HifiBerry Digi2 Pro on Raspberry Pi OS hit this exactly: 1.2.8's
ALSA Direct path logged "Looking for device: iec958:CARD=…", failed
the lookup, and dropped straight to the proc_found=false error
branch without ever attempting hw:CARD=sndrpihifiberry,DEV=0.

Extract a small is_card_present_in_proc helper that uses
find_card_number_by_name (which reads /proc/asound/cards — present
for every registered card regardless of bus) and use it for both
gate checks: the fallback trigger and the proc_found error message
selector. get_hw_supported_rates keeps its three legitimate uses
(actual rate validation in create_output_stream, and the two public
device_supports_sample_rate / get_device_supported_rates queries).

Adds 8 unit tests covering build_hw_fallback_id, the alias-prefix
branches of extract_card_name_from_device, the short-circuit cases
of is_card_present_in_proc, and the existing is_known_pcm_id filter.
The /proc-touching branches stay covered by hardware testing on the
reporter's Pi when v1.2.9-rc ships.

cc
2026-04-24 19:17:59 -06:00
vicrodh ec1bf38791 test(visualizer): wrap SamplesBuffer args in NonZero for rodio 0.22
rodio 0.22 tightened SamplesBuffer::new to require NonZero<u16> for
channels and NonZero<u32> for sample_rate, but the visualizer test
fixtures still passed bare integer literals — so the qbz-audio test
binary stopped building. Wrap both call sites in NonZero::new(...)
.unwrap() so cargo test -p qbz-audio compiles again.

Pure test-only change; runtime visualizer code was already migrated.

cc
2026-04-24 19:17:40 -06:00
vicrodh 4105d597a8 fix(i18n): add missing toast.playingAlbum key across all locales
Two $t('toast.playingAlbum', { values: { count } }) call sites in
+page.svelte (collection/mixtape detail play paths) were printing the
raw key because the translation was never added. The `|| fallback`
idiom after each call never fired either — $t() returns the key
itself on miss, which is truthy.

Add an ICU plural entry covering both callers: count=1 (detail-view
play button on an album) reads as "Playing album", count>1 (bulk
play-all) reads as "Playing {count} tracks". Mirrored across en, es,
de, fr, pt.

cc
2026-04-24 16:22:09 -06:00
vicrodh e05ed48d60 fix(views): close titlebar gap on pinned sticky headers
Both PlaylistDetailView's .tracks-sticky-header and ArtistDetailView's
.jump-nav opened a visible gap between the titlebar and the sticky
bar once pinned — scrolled content bled through as a blurred strip.
Two causes, both hit here:

- Subpixel/compositing rounding in WebKitGTK 2.50+ left a few px
  transparent at the pinned top edge. Promoting each bar to its own
  compositing layer via `will-change: transform; transform: translateZ(0)`
  mirrors the same workaround imageCacheService applies to <img>.

- Even with a compositing layer, the scroll container above the pin
  can briefly expose bg before the bar's fill kicks in. Add a solid
  `box-shadow: 0 -32px 0 0 var(--bg-primary)` so the bg extends
  upward and stays covered regardless of any remaining offset. For
  .jump-nav this composes with the existing downward drop shadow.

Also set `background: var(--bg-primary)` on .playlist-detail and
.artist-detail (the scroll containers) and bump .track-controls'
padding-top to -2px (CSS clamps to 0 but documents the intent), so
the toolbar sits flush against the bar border without the 8px
breathing-room the unpinned state had.

cc
2026-04-24 16:19:39 -06:00
vicrodh 580bdaf6bc perf(sidebar): warm playlist tile cache after initial load
cachedSrc gives each playlist row's tiles the backend disk cache on
the first scroll that reveals them — good on cold runs but still
visibly staggered if the user scrolls quickly after launch.

Fire a preloadImages batch from a $effect keyed on userPlaylists and
the collage toggle: as soon as the list lands (from SWR cache, a fresh
v2_get_user_playlists, or an offline refresh), every playlist's first
four Qobuz images get routed through the same _50.jpg downscale used
at render time and queued into the shared in-memory resolvedUrls map.
Fire-and-forget, dedupes against already-resolved URLs, skipped when
the user opted out. The net effect is that cachedSrc hits a warm map
by the time the <img> elements mount, so the sidebar scrolls without
the loading-placeholder flash that used to bridge the first backend
round-trip.

cc
2026-04-24 15:55:46 -06:00
vicrodh 11edb2b05d perf(sidebar): route collage tiles through the shared image cache
PlaylistCoverCollage rendered tiles with plain <img src={url}>, which
bypassed v2_get_cached_image (the backend disk cache used everywhere
else for Qobuz imagery) and the in-memory dedup map in
imageCacheService. Second-launch tile fetches hit the Qobuz CDN over
the wire when they should have been served from disk, and playlists
that happen to share a cover each paid for their own invoke round-trip.

Switch the two <img> sites to use:cachedSrc so tiles go through the
same pipeline the larger PlaylistCollage uses:
- on-disk cache persists across sessions
- resolved URLs are memoised per-session; duplicate covers fold to one
  backend call
- the action also applies the will-change/translateZ compositing hint
  that works around WebKitGTK 2.50+ texture eviction during scroll,
  removing the occasional placeholder flash on long sidebar scrolls

asset:// custom-cover URLs short-circuit inside cachedSrc so local
thumbs keep their existing path.

cc
2026-04-24 14:57:35 -06:00
vicrodh 7ac5c7e8a0 perf(audio): skip CPAL probe of virtual ALSA PCMs during enumeration
build_cpal_device_map iterated every PCM that cpal's ALSA host exposes
(dmix:, route:, surround51:, pulse, null, …) but only five name shapes
are ever looked up downstream: default, sysdefault:CARD=*, and
{front,hdmi,iec958}:CARD=*,DEV=*. Dropping the rest avoids holding
Device handles we never query and, combined with the new error
handler, removes another source of spurious libasound probes on
systems where PipeWire owns the hardware exclusively.

cc
2026-04-24 13:40:42 -06:00
vicrodh 134808c880 feat(audio): route libasound errors through log::debug
libasound's default error handler prints directly to stderr. During
device enumeration probes, PCMs that wrap dmix or surround routes emit
benign errors ("unable to open slave", "no matching channel map") that
cluttered the app log without indicating a real problem.

Install a process-wide snd_lib_error_set_handler shim from
AudioBackendFactory::create_backend (idempotent via std::sync::Once)
that forwards the file/line/function/err/fmt tuple to log::debug. The
messages stay available with RUST_LOG=debug and disappear during
normal runs.

Adds alsa-sys 0.3 as a direct Linux-only dependency on qbz-audio
(previously transitive via alsa/cpal). The handler is declared
non-variadic and transmuted into libasound's variadic function pointer;
ignoring the unused varargs is ABI-compatible on every platform we
support.

cc
2026-04-24 13:40:09 -06:00
vicrodh 7e74d9f9cd Merge branch 'chore/internal/typescript-6' into pre-release
Bumps typescript from 5.9.3 to 6.0.3. Validated on the feature branch
via svelte-check (0 errors), vite production build, and vitest
(no new regressions vs 5.9.3).

cc
2026-04-24 12:54:13 -06:00
vicrodh 1e77642d7a chore(deps-dev): bump typescript from 5.9.3 to 6.0.3
Validated on this branch:
- npm run check (svelte-check): 0 errors, 41 warnings (identical to 5.9.3)
- npm run build (vite production): succeeds in ~57s
- npm run test:run (vitest): same 2 pre-existing failures as pre-release,
  no new regressions

Replaces closed dependabot PR #347.

cc
2026-04-24 12:48:53 -06:00
vicrodh a569833daf fix(titlebar): accept full-height-rounded in controlsShape prop
The windowControlsStore ButtonShape union and the TitleBar CSS already
support full-height-rounded (Klassy default), but the TitleBar prop
type was narrower, causing a type error at the one call site in
+page.svelte. Widen the prop union to match.

cc
2026-04-24 12:28:44 -06:00
vicrodh 5395fd79bb fix(awards): rename loadingMore prop to isLoadingMore for grid
VirtualizedFavoritesAlbumGrid expects isLoadingMore; AwardAlbumsView
was passing {loadingMore} shorthand, triggering a svelte-check error.

cc
2026-04-24 12:28:44 -06:00
vicrodh 14b72b0582 chore(deps): bump rand from 0.8.5 to 0.8.6
Fixes GHSA-cq8v-f236-94qc (low: rand unsound with custom logger using
rand::rng()). Transitively bumped across both src-tauri and crates
workspaces via cargo update.

cc
2026-04-24 12:05:04 -06:00
vicrodh 19344c9037 chore(deps-dev): bump vitest from 4.1.4 to 4.1.5
cc
2026-04-24 11:43:59 -06:00
vicrodh 110ecf11cc chore(deps-dev): bump vite from 8.0.8 to 8.0.10
cc
2026-04-24 11:43:02 -06:00
vicrodh 674771b216 chore(deps): bump notify-rust from 4.14.0 to 4.16.0 in /src-tauri
cc
2026-04-24 11:40:51 -06:00
vicrodh d871d924aa chore(deps): bump rustls-webpki from 0.103.12 to 0.103.13 in /crates
cc
2026-04-24 11:38:52 -06:00
vicrodh 40189baade chore(deps): bump tauri-plugin-single-instance from 2.4.0 to 2.4.1 in /src-tauri
cc
2026-04-24 11:38:42 -06:00
vicrodh 592c70928f chore(deps): bump uuid from 1.23.0 to 1.23.1 in /src-tauri
cc
2026-04-24 11:38:32 -06:00
vicrodh 777a060fd5 chore(deps): bump ashpd from 0.13.8 to 0.13.10 in /src-tauri
cc
2026-04-24 11:38:24 -06:00
vicrodh a2e5f8567a chore(deps): bump open from 5.3.3 to 5.3.4 in /src-tauri
cc
2026-04-24 11:38:15 -06:00
vicrodh 60283f0a2a chore(deps): bump openssl from 0.10.75 to 0.10.78 in /src-tauri
cc
2026-04-24 11:37:51 -06:00
vicrodh c0ab9f54cb feat(multiselect): dock BulkActionBar at list end via IntersectionObserver
Replaces the always-fixed positioning with a sentinel-driven dock/float
mechanism. A zero-height sentinel rendered before the bar marks the
bar's natural flow position at the end of the selectable list. An
IntersectionObserver flips the bar between two states:

- Floating: position fixed, bottom: var(--player-bar-height), with
  left/width tracked from the sentinel's bounding rect so the bar
  matches the column width (no longer overlaps the album sidebar).
- Docked: in-flow static position right below the last item once the
  sentinel scrolls into view, so the bar settles below the list
  instead of covering content below.

Also removes the 8px gap between the floating bar and the player bar.

cc
2026-04-24 11:37:19 -06:00
vicrodh a6eefae6b3 feat(multiselect): float BulkActionBar above player bar
Switch .bulk-bar from sticky to fixed positioning so it sits above the
player bar (bottom: player-bar-height + 8px) instead of clipping against
the scroll container. Matching adjustments for placement-top and a
higher z-index (40) to clear other overlays.

cc
2026-04-24 11:37:19 -06:00
vicrodh 1ee9cf8f80 feat(multiselect): albums tab select-all, shift-range, Ctrl/Cmd+A
Finish out #342 by giving the Albums tab the same treatment as the
Tracks tab. The plumbing mirrors what VirtualizedTrackList got:

- VirtualizedAlbumList now owns the shift-click anchor. Its
  onAlbumToggleSelect widens to accept the MouseEvent/KeyboardEvent,
  and a new onAlbumToggleSelectRange callback fires with every
  album id between the previous click and the shift-click. The
  ordered id list is derived from the same groups input the grid
  renders from, so the range matches what the user sees.
- LocalLibraryView gets addAlbumsToSelection (merge helper) plus
  albumSelectAllState / toggleAlbumSelectAll, the tri-state
  select-all checkbox shown next to the SquareCheckBig toggle
  while albumSelectMode is active, and a Ctrl/Cmd+A listener
  scoped to that mode. Reuses the .select-all-checkbox styles
  added for the Tracks tab.

Range selection in the Albums tab grid is the last piece the issue
called out, so #342 is fully addressed on the app side now.

cc
2026-04-24 11:37:19 -06:00
vicrodh fdfa02fe08 feat(multiselect): tracks tab select-all, shift-range, Ctrl/Cmd+A
LocalLibraryView's Tracks tab runs through VirtualizedTrackList,
so the shift-click anchor lives in the list component. Here we
only have to wire the batch-add callback:

- addTracksToSelection(ids) merges a range into selectedTrackIds
  and is passed to VirtualizedTrackList as onToggleSelectRange.
  The per-track onToggleSelect path stays as it was.
- Add the select-all checkbox NorinB asked for in #342: it shows
  up in .track-controls only while trackSelectMode is active, uses
  the familiar none/partial/all tri-state, and toggles between
  "clear selection" and "select every track in the library". The
  checkbox operates on the full `tracks` array rather than what's
  visible in the virtualized viewport, which is the behaviour he
  wanted (one click = everything).
- Ctrl/Cmd+A while in select mode does the same as clicking the
  checkbox when it's empty. Listener is scoped to the select-mode
  lifecycle and skipped when focus is in an input (search bar).

Small CSS for the new inline checkbox so it sits in the controls
row without looking out of place.

cc
2026-04-24 11:37:19 -06:00