Commit Graph
4535 Commits
Author SHA1 Message Date
Afonso Jorge Ramos 4fd85b5b2f fix(ci): suffix macOS .app.tar.gz bundles with arch to fix auto-updater 2026-05-11 16:17:07 +02:00
Afonso Jorge Ramos 1edde8a28a fix(audio): rephrase CoreAudio rate-mismatch errors for end users
The error strings flow up through stream_error and end up in user-
visible logs. Replace the internal-shaped messages ("opened at XHz
while device nominal rate is YHz") with text that names the cause,
the remediation, and the reason the fallback path is refused.
2026-05-11 15:19:30 +02:00
Afonso Jorge Ramos 9e632386b9 fix(audio): retry CoreAudio shared-mode open on rate mismatch
CPAL caches device configs and can briefly return a stale sample rate
right after CoreAudio changes the device nominal rate. Before this
change, opening at the stale rate failed the post-open validation and
returned Err, leaving the user with no audio on the first track after
a rate change.

Drop the bad sink, re-resolve the device, re-query nominal rate and
try once more with a 50ms backoff. Two attempts in total. Turns the
racy window into transparent recovery.
2026-05-11 15:16:46 +02:00
Afonso Jorge Ramos c408ea73cb test(player): cover compute_needs_new_stream decision rule
Extract the boolean decision out of evaluate_stream_recreate into a
pure function so the truth table can be tested without faking a
MixerDeviceSink or AudioSettings mutex. Eight cases cover the matrix:
no stream, unchanged format, format change with and without each
bit-perfect backend, and the CoreAudio shared-mode rate-mismatch path.
2026-05-11 15:15:57 +02:00
Afonso Jorge Ramos ac60113cdd refactor(player): extract StreamRecreateDecision helper
The rate-mismatch detection block was duplicated between the Play and
Stream handlers, and each handler acquired thread_settings.lock() three
times in a row. Extract into one helper that reads settings once and
returns every flag the recreate decision needs.

Also drops a dead else-branch that logged "Creating initial audio
stream" — unreachable inside if stream_opt.is_some() — and the
redundant info-log that re-announced the rate-mismatch reason at
recreate time (the warn-level log inside the helper already says
"Recreating stream to avoid wrong-speed playback").
2026-05-11 15:14:54 +02:00
Afonso Jorge Ramos 3b34a734b4 refactor(player): rename current_sample_rate to current_track_sample_rate
The field tracks the decoded source format, not the output stream's
hardware rate. The names are now explicit so future readers don't
conflate the two — on macOS shared mode these can legitimately differ
since Rodio resamples internally.
2026-05-11 15:13:29 +02:00
Vudgekek 7bad704e21 fix(audio): fix macOS Shared Mode playback from changing speed 2026-05-09 23:43:26 -05:00
vicrodh d44ee7c086 build(flake): bump qbz to v1.2.12
cc
2026-05-09 19:14:45 -06:00
vicrodh e920c350c4 Merge pre-release into main for v1.2.12 hotfix release 2026-05-09 18:14:44 -06:00
vicrodh 19c2912851 chore(snap): bump source-tag to v1.2.12
Was lagging at v1.2.10 since the v1.2.10 release; v1.2.11 missed it.
Snap CI builds from this tag, so it must match the version field.

cc
2026-05-09 18:12:15 -06:00
vicrodh 0c9e4ee5fc chore(release): bump version to 1.2.12
Hotfix release. Reverts titlebar-mode-selector and PR #406 (broken
window chrome on Linux); preserves PR #407 (sticky home header) and
adds PR #408 (macOS native icon and tray variants by @Vudgekek).

cc
2026-05-09 18:11:24 -06:00
vicrodh 2fdec2ca57 Merge pull request #408 from Vudgekek/feature/external/macos-qol
feat(style): add macOS native app icon and tray icon variants
2026-05-09 18:06:27 -06:00
vicrodh f1ef161560 Merge branch 'bugfix/titlebar-rollback-1.2.12' into pre-release
v1.2.12 hotfix: revert the titlebar-mode-selector merge and PR #406
which together caused all titlebar modes to render incorrectly in the
production binary (empty top space, gap above now-playing bar). The
v1.2.10 model (use_system_titlebar + hide_title_bar booleans) is
restored; Plasma mode is dropped pending a less brittle redesign.

PR #407 (sticky home header fix) is preserved.
2026-05-09 18:06:14 -06:00
vicrodh ee54c49aef revert: roll back PR #406 (linux-titlebar-draggable)
Reverts merge f7623154 which built macOS support on top of the variant
rendering infrastructure introduced by titlebar-mode-selector. With the
variant system gone (previous revert), PR #406's changes (class:macos,
stripped strip with traffic-light reservation, macOS-aware drag bands)
reference dead architecture.

Most of PR #406 was already removed by the previous revert via file
checkouts; this commit cleans up the residual macOS-specific cosmetics
in Sidebar.svelte and +page.svelte (padding-top 36→32, drag-region
height 32→28, macos main-content padding restored to generic rule).

PR #407 (sticky home header fix, ac627d43) is preserved — independent
from titlebar work, only touches HomeView.svelte.

cc
2026-05-09 17:49:07 -06:00
vicrodh e3bdbc9ab4 revert: roll back titlebar-mode-selector merge
Reverts merge 1be46f1a which introduced the 4-mode titlebar enum
(qbz/system/plasma/hidden), variant-aware rendering (full/stripped),
GDK_BACKEND=x11 coercion for Plasma, and per-mode mounting in +page.

The "stripped strip mounted alongside Plasma SSD" architecture caused
all titlebar modes to render incorrectly in the production binary —
empty space at top, separation gap above the now-playing bar, controls
visible without a backing strip. Reverting restores v1.2.10 behavior:
two booleans (use_system_titlebar + hide_title_bar), no variants, no
GDK coercion. Plasma support is dropped pending a less brittle redesign.

Conflicts in SettingsView.svelte resolved by taking the pre-merge side
for the four titlebar UI blocks; non-titlebar additions in this cycle
(Discord RPC settings, reserve-DAC, offline cache nav) preserved.

cc
2026-05-09 17:48:37 -06:00
Vudgekek 491807e1f1 Merge branch 'pre-release' into feature/external/macos-qol 2026-05-09 17:50:47 -05:00
vicrodh f65248a917 build(flake): bump qbz to v1.2.11
Update qbzVersion + srcHash + npmHash for the v1.2.11 tag (commit
cc98b7f7). Hashes computed via 'nix-prefetch-url --unpack' and
'prefetch-npm-deps package-lock.json' against the tagged tree.

cc
2026-05-09 16:36:58 -06:00
vicrodh cc98b7f7e6 docs(release-1.2.11): correct PR attribution for sticky home header (#406 → #407)
PR #406 was the macOS titlebar unification (mentioned separately in the
Title bar section); the sticky home header pop-in fix is PR #407. Both
from @afonsojramos in the same merge round.

cc
2026-05-09 15:51:07 -06:00
Vudgekek 855bbdfae1 feature(app-icon): add macOS style .icns pack 2026-05-09 15:36:16 -05:00
Vudgekek b51fbc8209 fix(menu-bar): add macOS support for the "Tray icon variant" setting 2026-05-09 15:35:35 -05:00
vicrodh fd7a6e2f89 docs(release): add 1.2.11 TAG_DETAILS and metainfo entry
cc
2026-05-09 14:33:11 -06:00
vicrodh ea6167babb chore(release): bump version to 1.2.11
cc
2026-05-09 14:33:11 -06:00
vicrodh 667153624f chore(about): bump codename to Exclusive Hardening, add Vudgekek and DoubleGate
cc
2026-05-09 14:33:11 -06:00
Victor RH 08acd304a1 Merge pull request #407 from afonsojramos/fix-glued-top-animation
fix(home): unify sticky tab header to avoid pop-in animation
2026-05-09 12:45:31 -06:00
Victor RH f7623154f4 Merge pull request #406 from afonsojramos/linux-titlebar-draggable
feat(titlebar): unify macOS layout with Linux qbz titlebar
2026-05-09 12:45:28 -06:00
vicrodh a8b5d3e8f5 Merge branch 'feature/internal/discord-rpc-flatpak-symlinks' into pre-release
Discord RPC now reaches Discord-Flatpak's IPC socket without making the
integration opt-out at the sandbox layer. Bridge symlinks are created
lazily on first connect after the user enables the toggle; users who
never enable Discord RPC see no sandbox changes.

* prepare_flatpak_discord_socket_links in discord_rpc.rs runs from the
  lazy connect path, gated on FLATPAK_ID env var
* Manifest gains xdg-run/app/com.discordapp.Discord:create filesystem
  permission, kept alongside the existing static path
2026-05-09 12:38:25 -06:00
vicrodh e2e4fb8cab feat(discord-rpc): lazy Flatpak socket bridge keeps the integration opt-in
Discord-Flatpak writes its IPC socket to
\$XDG_RUNTIME_DIR/app/com.discordapp.Discord/discord-ipc-N rather than
the \$XDG_RUNTIME_DIR/discord-ipc-N path the discord-rich-presence crate
searches by default. The naive way to bridge that gap — a startup
wrapper that unconditionally symlinks every iteration before the binary
launches — works, but it pulls the integration off-script: every other
optional integration in QBZ (Last.fm, ListenBrainz, MusicBrainz, Plex)
is opt-in, with zero telemetry and zero filesystem reach until the user
flips the toggle. A startup wrapper would silently turn Discord RPC
into opt-out at the sandbox layer; the symlinks would exist for users
who never touched the integrations panel.

Move the bridge into the lazy connect path instead. The first time the
user actually connects — i.e. the first track plays after they enabled
the toggle — prepare_flatpak_discord_socket_links runs:

* No-op outside Flatpak (no FLATPAK_ID env var)
* No-op when \$XDG_RUNTIME_DIR/discord-ipc-N already exists (native
  Discord, or a previous lazy run in this Flatpak instance)
* No-op when the Discord-Flatpak source path doesn't exist (Discord
  not running)
* Otherwise, symlinks 0..9 from \$XDG_RUNTIME_DIR/discord-ipc-N to
  \$XDG_RUNTIME_DIR/app/com.discordapp.Discord/discord-ipc-N

Symlinks die with the Flatpak instance — \$XDG_RUNTIME_DIR is per-
instance, so there's no cross-session pollution. Users who never enable
Discord RPC keep the same sandbox surface as before.

Manifest: keep the static xdg-run/discord-ipc-0 permission for native
Discord, add xdg-run/app/com.discordapp.Discord:create so the lazy
symlink path is allowed when the user opts in. The two coexist; the
crate's default search path covers Discord-native, the symlinks cover
Discord-Flatpak.

cc
2026-05-09 12:38:25 -06:00
Afonso Jorge Ramos ac627d432b fix(home): unify sticky tab header to avoid pop-in animation 2026-05-09 17:52:39 +02:00
vicrodh 0274f2b030 chore: clean svelte-check warnings (CSS, a11y, types)
Drains the wiki "23 warnings" baseline back to zero so future regressions
stand out:

* Drop 16 unprefixed \`app-region\` CSS lines across TitleBar, TitleBarNav,
  ImmersiveHeader, ImmersivePlayer, MiniPlayerFooter and MiniPlayerWindowControls.
  Tauri's webview is WebKit / Chromium on every platform we ship to, so
  \`-webkit-app-region\` already covers the chrome-drag region; the
  unprefixed property only existed to keep stylelint quiet but the CSS
  spec doesn't define it and svelte-check warns on every site.
* Remove 2 empty rulesets in AlbumCreditsModal and NowPlayingBar (leftover
  comment-only blocks from earlier refactors).
* Pair \`-moz-appearance: textfield\` with the standard \`appearance: textfield\`
  in LocalLibraryTagEditorModal so the rule no longer trips the
  property-companion warning.
* Delete the unused \`.quality-text\` selector in NowPlayingBar.backup.svelte
  (file is a frozen snapshot of an older NPB iteration; the live NPB
  doesn't use that class).
* Annotate Tooltip.svelte and immersive/panels/VinylPanel.svelte with
  \`svelte-ignore a11y_no_static_element_interactions\` plus a comment
  explaining the context — both are decorative wrappers (a tooltip hit
  area; a 3D tilt effect on artwork) where adding an ARIA role would
  misrepresent the semantics.
* Add \`@types/node\` as a devDependency (^22) so the tsconfig resolution
  for the SvelteKit-extended config stops complaining about the missing
  type definition.

cc
2026-05-09 09:46:43 -06:00
Afonso Jorge Ramos 8ed62676c2 fix(titlebar): tune macos drag band to 32px 2026-05-09 17:45:46 +02:00
Afonso Jorge Ramos ac5fc25944 fix(titlebar): match macos drag band height to sidebar top padding 2026-05-09 17:37:04 +02:00
Afonso Jorge Ramos be67fffb28 feat(titlebar): expose hide-title-bar toggle on macOS 2026-05-09 17:36:28 +02:00
Victor RH 055b76bfbe Merge pull request #403 from vicrodh/dependabot/cargo/src-tauri/tauri-2.11.1
chore(deps): bump tauri from 2.10.3 to 2.11.1 in /src-tauri
2026-05-09 09:25:48 -06:00
Victor RH 55f6acb17a Merge pull request #404 from vicrodh/dependabot/cargo/src-tauri/openssl-0.10.79
chore(deps): bump openssl from 0.10.78 to 0.10.79 in /src-tauri
2026-05-09 09:25:25 -06:00
vicrodh 82173b78c2 Merge branch 'feature/internal/ephemeral-folder' into pre-release
Open Folder — play music ad-hoc without adding to library.

* Backend: ephemeral_library module (in-memory HashMap, synthetic
  high-positive ids, CUE support, format whitelist, artwork cache,
  gapless prefetch).
* Frontend: Open Folder button in Folders > Tree toolbar; pane mirrors
  album-detail layout with cover-art per group + disc sections.
* Persistence: folder path survives restart (rehydrated on mount); the
  ephemeral data itself is rebuilt fresh.
* Lifecycle cleanup: queue + NowPlayingBar wiped on broom click /
  navigation away / inaccessible folder.
* Playback: gapless across virtual track boundaries (CUE-FLAC) with
  position offset translation so the seekbar reads in virtual time.
* Action gating: favorite + playlist + track info disabled (not removed)
  for ephemeral tracks across NowPlayingBar, QueuePanel, immersive.
* Folder-tree sidebar polish: search right-aligned, default 290px width.
2026-05-09 09:24:51 -06:00
vicrodh 2d33d7cb42 feat(player): disable metadata actions for ephemeral tracks
Library-bound actions (favorite, add-to-playlist, track info) require a
DB row to operate; ephemeral tracks live only in memory and would 404
on use. Surface them disabled rather than removed so the affordance
stays discoverable in the chrome — users still see the icon, the
tooltip explains why it's inert.

Surfaces wired
- NowPlayingBar: + and ♥ disabled when active track id >= 2^48.
- QueuePanel: now-playing ♥ + per-track Add to Playlist + Track Info
  in both queue and history menus disabled per-row by id range.
- ImmersiveControls + PlayerControlsCompact: ♥ disabled.
- ImmersivePlayer: passthrough prop to PlayerControlsCompact.
- MiniPlayerFooter / MiniPlayerWindowControls: no metadata actions in
  these surfaces, nothing to gate.

Detection is by id range (>= EPHEMERAL_ID_FLOOR), not by source string.
The setQueueForLocalTracks mapping rewrites `source: 'ephemeral'` to
`'local'` before the track reaches the queue, so a string-equality
check would never fire — id range matches the rest of the ephemeral
codebase (gapless carve-out, CUE boundary, seek offset, queue/now-
playing wipe).

Tooltip on the disabled state uses the new
`actions.unavailableForEphemeral` key, translated for en, es, de, fr, pt.

cc
2026-05-09 09:24:37 -06:00
Afonso Jorge Ramos 61bd1eb940 feat(settings): expose nav and search titlebar toggles on macOS 2026-05-09 17:23:40 +02:00
Afonso Jorge Ramos 3cb54dd06b style(sidebar): drop dead macos no-titlebar padding rule 2026-05-09 17:23:37 +02:00
Afonso Jorge Ramos fd6464fdf3 refactor(macos): drop overlay drag region superseded by qbz titlebar 2026-05-09 17:23:32 +02:00
Afonso Jorge Ramos 0ee2e429c8 feat(titlebar): mount qbz titlebar on macOS with traffic-light reservation 2026-05-09 17:23:23 +02:00
vicrodh 0fe19dd460 fix(player): seekbar + art + quality badge for ephemeral CUE virtual tracks
Three coupled visual bugs that surfaced once the queue advance and
gapless wiring started landing virtual track changes correctly.

Seekbar (case A: manual click / next button)
- PlayingTrack gets cueStartSecs / cueEndSecs fields and a
  patchCurrentTrackCueInfo() setter on playerStore. handlePlaybackEvent
  subtracts cueStartSecs from event.position when computing the
  displayed currentTime, so a virtual track that lives at e.g. offset
  7:26 inside its FLAC reads 0:00 at frame zero instead of 7:26 / 0:00.
- LocalLibraryView keeps an $effect on activeTrackId that looks up the
  matching ephemeral track and patches the cue info into playerStore
  every time the active track flips. Non-CUE / non-ephemeral tracks
  fall through with null/null which clears any prior boundaries.

Seekbar (case B: CUE boundary auto-advance)
- handlePlaybackEvent gains an "underlying CUE" branch: when event.track_id
  is in the ephemeral range AND currentTrack is in the ephemeral range
  AND currentTrack has cueStartSecs, the strict track_id match check is
  bypassed and the same offset translation runs. This keeps the seekbar
  ticking in virtual-track time after the boundary watcher swaps the
  displayed metadata while the audio buffer is unchanged. EPHEMERAL_ID_FLOOR
  is promoted to a module constant so both branches share it.

Album art (manual next button)
- queueArtwork.resolveQueueTrackArtwork was double-converting Tauri
  asset:// URLs through convertFileSrc, producing a 403 path
  (asset://localhost/asset%3A%2F%2F...). Add an asset: passthrough
  alongside http(s) and file:// so URLs already resolved upstream
  (LocalLibraryView's queue setter pre-converts via getArtworkUrl)
  reach the NowPlayingBar intact.

Quality badge ("audio downgrade")
- Boundary advance's setCurrentTrack call was passing LocalTrack.sample_rate
  (Hz) into PlayingTrack.samplingRate (kHz). The badge formatted as
  "FLAC 16/44100" instead of "FLAC 16/44.1", reading as a quality drop
  vs. the album list. Divide by 1000 to match the rest of the
  PlayingTrack contract.

cc
2026-05-09 07:51:47 -06:00
vicrodh 6d958fc659 feat(local-library): ephemeral pane iteration + folder-tree sidebar polish
A consolidated UI commit covering the LocalLibrary pane work from this
session. Backend additions land in earlier commits; this one is the
frontend surface plus the i18n strings.

Folder-tree sidebar polish (Folders > Tree)
- Search input pushed to the right edge via margin-left:auto so the
  action icons stay anchored on the left.
- FOLDER_TREE_SIDEBAR_DEFAULT_WIDTH and *_MIN both bumped to 290px (was
  302/200) — matches the user-tuned width and sets a coherent floor for
  the resize handle.

Ephemeral pane render
- Group tracks by album_group_key and render an album-style block per
  group: 96px cover, title/artist/year/quality/track-count, per-album
  Play button. Discs render as section headers when an album has more
  than one. CUE-derived virtual tracks slot into the same structure
  (they share the underlying FLAC's group key).
- Single-album sessions hide the per-album play button — it's redundant
  with the folder-level "Play all" header. Multi-album sessions surface
  it so each album has its own affordance.
- Loading spinner replaces the empty-pane state during scan; on slow
  NAS folders the wait used to be silent.
- Close button changed to the BrushCleaning icon ("Clear session" /
  "Limpiar sesion") — the X read as "close window" rather than "wipe
  this transient state". Strings updated in en, es, de, fr, pt.

Ephemeral session lifecycle
- Folder path persists to user storage; rehydrateEphemeralFolder reopens
  it on mount as long as the directory still exists. A `rehydrating`
  flag suppresses the auto-close $effect during the rehydration window
  so a delayed result doesn't get clobbered by a concurrent navigation.
- wipeEphemeralPlaybackArtifacts clears the queue + now-playing slot
  when the active or pinned track is ephemeral. Detection consults both
  activeTrackId AND playerStore.currentTrack — sometimes the track is
  visually pinned without playback being active (e.g. after session
  restore). Backend stop+clear doesn't reset current_track_id at the
  player level, so the frontend explicitly nullifies currentTrack to
  flush the NowPlayingBar chrome.
- Closing/replacing an ephemeral session triggers the wipe; navigation
  to a tree folder or album also triggers it via the watch-effect.

Ephemeral playback flow
- Queue scope is now the album the played track belongs to, not the
  whole folder. Folder-level "Play all" still queues everything in
  album-then-disc-then-track order; track-row clicks queue just the
  album. Per-album play button matches.
- Loading toast (buffering type) shows immediately on play to cover the
  multi-second file read off NAS. Dismissed when v2_library_play_track
  resolves.
- CUE virtual-track boundary advance: a raw playback:state listener
  watches absolute FLAC position and, when the displayed CUE track's
  cue_end_secs is crossed, calls v2_next_track + setCurrentTrack(next)
  + syncQueueState. Audio is unchanged (continuous decode of the same
  FLAC); only the chrome flips. Seekbar resets to 0:00 because the
  player's track_id stays pinned to the first virtual track — known
  limitation queued for a follow-up that virtualises position display
  via cue_start_secs offsets.

cc
2026-05-09 05:16:01 -06:00
vicrodh 53edfc3651 feat(player): ephemeral-aware gapless detection + session-restore filter
Two cross-cutting plumbing changes the ephemeral folder pane needs to
behave correctly without touching the rest of the playback paths.

playerStore: gapless transition detection used to require event.is_playing
to be true at the moment the track_id changes. The ephemeral file-data
swap (one buffer of bytes replacing another) briefly reports is_playing
false during the engine restart, and that transient frame arrives BEFORE
the player can flip the flag back. Without a carve-out the event was
mis-classified as an external track change, the queue's current_index
hadn't advanced (it's a separate state machine), and the UI froze on the
previous track. Streaming playback paths don't see this race because
their buffer transition keeps is_playing pinned. Carve-out is scoped to
event.track_id >= EPHEMERAL_ID_FLOOR so Qobuz/Plex/library are untouched.

routes/+page.svelte: session save now strips ephemeral tracks from the
queue snapshot and clears current_index if it pointed at one. Ephemeral
ids aren't stable across processes (the cache rebuilds from scratch on
each launch), and even if they were, the playback path 404s if session
restore fires before the folder rehydrates. The folder-path persistence
already brings the pane back; the queue can come back via re-clicking.

Also: gapless transition handler logs the advance/expected ids and the
match flag, plus runs a defensive syncQueueState on success — that's
belt-and-suspenders for paths where the queue's view of "current" lags
the player's gapless transition by a tick (e.g. ephemeral, where the
queue advance and the player swap are independent state machines).

cc
2026-05-09 05:14:14 -06:00
vicrodh ca17ad4da0 feat(ephemeral): CUE support, format whitelist, artwork cache, gapless prefetch
Backend additions for the ephemeral folder feature, all gated behind the
existing track_id >= EPHEMERAL_ID_FLOOR discriminator so library/Qobuz
paths stay untouched.

CUE handling
- Iterate scan.cue_files alongside audio_files. Parse via CueParser,
  resolve + canonicalize the referenced audio file, extract properties +
  format via MetadataExtractor, expand into virtual tracks via
  cue_to_tracks. The referenced audio file is added to a HashSet so the
  audio_files loop skips it (otherwise we'd list both N CUE-derived
  tracks and a single-row entry for the underlying FLAC).
- Whitelist of decoder-friendly extensions (flac/mp3/m4a/alac/wav/aiff/aif).
  Symphonia can't decode APE or raw BIN — those used to ride through
  silently and produce white noise on play; now they're skipped with a
  warn log and counted in skipped_files.
- v2_library_play_track ephemeral branch now honours track.cue_start_secs
  with a post-play_data seek, mirroring the regular local-file branch.

Artwork perf
- Cache extracted artwork by album_group_key. Most CUE-album folders
  share one cover across every virtual track, so calling extract_artwork
  + generate_thumbnail 155 times for a 155-track album was wasted work
  (the bottleneck behind the prior ~2-minute opens). The folder-level
  cache is kept as a secondary fallback for find_folder_artwork lookups.
- Skip standalone APE files entirely from the ephemeral pane — Symphonia
  can't decode them so showing them as a row that explodes on click is
  worse than not showing them at all. Counted in skipped_files.

Gapless
- v2_play_next_gapless gets an ephemeral branch at the top: track ids
  in the high range resolve through EphemeralLibraryState and feed the
  player.play_next path directly. Without this, gapless prefetch always
  reported "not in any cache" because the lookup keyed off DB rows.
- CUE-derived ephemeral tracks (cue_start_secs is Some) return false
  from the gapless branch — they share an audio file, so a play_next
  swap with no seek would start the next virtual track from the FILE's
  beginning instead of the CUE offset.

cc
2026-05-09 05:13:53 -06:00
vicrodh 9c745e595c fix(local-library): use high-positive ids for ephemeral tracks (queue/context u64 compat)
The original design used negative i64 ids to distinguish ephemeral
tracks from DB rows, but the queue and playback-context commands
serialize ids as Vec<u64> end-to-end (V2QueueTrack, v2_set_playback_context).
serde rejects negative numbers at the boundary, so setQueueForLocalTracks
and setPlaybackContext failed the moment the user clicked an ephemeral
track:

    invalid value: integer `-1`, expected u64

Switch synthetic ids to a high-positive range (EPHEMERAL_ID_FLOOR =
1<<48) instead. Pros over the negative scheme:
* Valid u64 — passes through the queue/context commands untouched
* Below 2^53 so JS Number round-trips without precision loss
* Far above any realistic DB autoincrement id, so the discrimination
  test (`track_id >= EPHEMERAL_ID_FLOOR`) stays unambiguous

Also fixes the snake_case mismatch on EphemeralFolderState — the Rust
struct serializes with its native field names (folder_path,
skipped_files), but the TypeScript type was declared in camelCase, so
ephemeralFolder.folderPath was undefined at render time.

cc
2026-05-09 02:36:55 -06:00
vicrodh aa015829aa feat(local-library): ephemeral folder playback (no DB persistence)
Adds an "Open Folder" button in the LocalLibrary > Folders tree toolbar
that lets the user point QBZ at any folder on disk and play it without
adding anything to local_tracks. Lets the app act as an ad-hoc media
player for downloaded albums, external drives, etc.

Backend:
- New ephemeral_library module: in-memory HashMap<i64, LocalTrack> keyed
  by synthetic negative ids. Reuses LibraryScanner and MetadataExtractor
  to walk the folder and build LocalTrack records.
- Three V2 commands: v2_ephemeral_open_folder (scan + populate, replaces
  any prior session), v2_ephemeral_clear, v2_ephemeral_get_track.
- v2_library_play_track gets a small branch at the top: track_id < 0
  resolves through the ephemeral state and goes straight to the regular
  local-file playback path (read file, hand to player). DB-backed paths
  (Qobuz cache, CUE start positions) are skipped — ephemeral tracks
  can't be any of those.

Frontend:
- "Open Folder" button (FolderOpen icon) next to the collapse-all button
  in the tree toolbar. Click opens the OS file picker, the result lands
  in a new ephemeralFolder $state.
- Right pane gets a new branch above the existing album/folder views:
  when ephemeralFolder is set, render a dedicated pane with header
  (folder name, path, track count, Play All, Close) and a flat track
  list with play-on-click rows.
- Lifecycle per spec: a session survives until (1) a different album or
  tree folder is selected — handled via $effect that watches
  selectedAlbum and selectedFolderPath, (2) the user clicks the Close
  button, or (3) the backend reports the file/directory is gone (caught
  in the play handler and folded into the same close path).
- Translations for en, es, de, fr, pt.

Notes:
- The audio_cache key is `track_id as u64`, which for negative ids wraps
  to a large u64 value — unique and safe (DB ids are positive).
- Edit-metadata gating for ephemeral tracks is deferred: there is no
  edit trigger from the new pane yet, so the sidecar/direct toggle
  behaviour is unchanged. Will gate when an edit path lands.

cc
2026-05-09 02:13:44 -06:00
vicrodh 4454619371 Merge branch 'feature/internal/sleep-timer' into pre-release
Sleep timer for the QueuePanel toolbar (issue #402).

* Frontend-only timer that hard-stops via cmdPause on expiry
* Presets 30 min / 1 / 2 / 3 / 5 hr plus Custom (1-1440 min)
* Green countdown beside the button when active; click to edit/cancel
* Smart-positioned popover (viewport-aware, recomputes on scroll/resize)
* Restrained type scale to keep visual hierarchy harmonized
* Translations for en, es, de, fr, pt
2026-05-09 01:11:54 -06:00
vicrodh 22687e7805 chore(player): lower sleep timer custom minimum to 1 min
15-minute floor was arbitrary; the user wants the lower bound at 1 minute
for short audio-segment workflows. Constant change propagates to both the
store's clamp and the input's min attribute.

cc
2026-05-09 01:11:53 -06:00
vicrodh 4d2b59eb18 fix(player): smart-positioned sleep timer popover with refined typography
Two issues from initial review:

1. The popover was anchored with position: absolute relative to the toolbar
   wrap, so when the queue panel sat near the viewport edge or the user had
   the window short, the popover overflowed and got clipped. Switched to
   position: fixed with a viewport-aware placement helper that prefers
   above the trigger, flips below when there isn't headroom, and shifts
   horizontally to stay inside the viewport. Recomputes on resize and on
   any ancestor scroll (capture-phase) so the popover stays anchored.

2. The Dropdown trigger was the visual peak of the stack — its default
   14px label dwarfed the surrounding eyebrows and made the popover read
   as inconsistent. Restructured the layout to a stacked eyebrow-above-
   control rhythm with one restrained type scale (11px eyebrow / 13px
   control / 12px action) and overrode the Dropdown trigger locally so
   it matches the input field. The countdown stays slightly larger (15px)
   as the deliberate focal point of the active state.

cc
2026-05-09 01:00:06 -06:00
vicrodh 8cde516887 feat(player): sleep timer with hard-stop pause (issue #402)
Adds a frontend-only sleep timer button to the queue panel toolbar. When
the deadline expires the timer invokes cmdPause() — no fade, no DSP, just
a hard stop consistent with QBZ's bit-perfect posture.

UX:
- Clock icon button next to the infinite-play toggle in QueuePanel.
- Click opens a popover with presets (30 min, 1 hr, 2 hr, 3 hr, 5 hr) plus
  a Custom option that reveals a 15-1440 minute number field.
- Once active, the button turns green and a small green countdown label
  appears beside it (no background, no border) showing the remaining time.
- Clicking the button again opens an Edit/Cancel view; Edit pre-fills the
  form with the current duration so the user can re-pick.

Behavior per spec:
- Frontend-only (single setTimeout fires the pause), no backend command.
- Timer does not persist across app restarts.
- Hard pause only; the app stays open so the user can resume where it
  stopped.

Translations added for en, es, de, fr, pt.

cc
2026-05-08 23:21:46 -06:00