feat(slint): LocalLibrary ephemeral folders + Folders tree 1:1 port

Ephemeral folders: open / browse / play a folder without indexing it —
album-grouped pane, CUE seek fast-path (no full re-decode per virtual track),
folder-path persistence + rehydrate, "already playing" add-vs-replace choice
dialog (ephemeral-only), and now-playing / queue / menu gating so an ephemeral
track exposes no persistence actions.

Folders tree brought 1:1 with Tauri:
- Rail header: select-mode, collapse-all, open-ephemeral, tree search.
- Resizable rail (default ~20% narrower; drag handle, min 50% default /
  max 50% of the content area).
- Subfolder cover grid + grid/list toggle, recursive track count, name search;
  compact icon bulk bar (folder-check / play-next / queue / playlist / clear).
- Tree is the default mode; circular checkboxes homologated with TrackRow;
  compact rows (smaller type + icon, no ambiguous trailing count).
- Flat/Tree icon toggle (disc-album / folder-tree), floated right.

Per-source TrackRow context menu (logic, not a blanket trim): Qobuz/offline =
full; local = play/next/queue + add-to-playlist; plex/ephemeral = play/next/
queue only.

App-wide standard: Math.round pixel-snap on icon centering across the UI to
kill sub-pixel blur (CircleAction, header back/forward/collapse, and the rest).
NowPlayingBar context icon -> turntable (frees disc-album for the Folders
toggle). New assets: folder-check, folder-tree, turntable.

cc
This commit is contained in:
vicrodh committed 2026-06-07 10:12:59 -06:00
1 parent ee9a3c1c89
commit 82129cff35
74 files changed
+2725 -581

No files matched your search

+18 -15
View File
@@ -16,7 +16,7 @@ import { Radius } from "../foundation/radius.slint";
import { QbzIcon } from "../primitives/QbzIcon.slint";
import { ContextMenu } from "../primitives/ContextMenu.slint";
import { ContextMenuItem } from "../primitives/ContextMenuItem.slint";
import { ShellState, QueueState, QueueItem } from "../state.slint";
import { ShellState, QueueState, QueueItem, NowPlayingState } from "../state.slint";
// Close button — mirrors the X control used by LyricsSidebar.
component CloseButton inherits Rectangle {
@@ -30,8 +30,8 @@ component CloseButton inherits Rectangle {
source: @image-url("../assets/icons/x.svg");
width: 15px;
height: 15px;
x: (parent.width - self.width) / 2;
y: (parent.height - self.height) / 2;
x: Math.round((parent.width - self.width) / 2 / 1px) * 1px;
y: Math.round((parent.height - self.height) / 2 / 1px) * 1px;
tint: ta.has-hover ? Theme.text-primary : Theme.text-secondary;
}
@@ -219,7 +219,7 @@ component QueueRow inherits Rectangle {
border-radius: 4px;
background: Theme.surface-elevated;
clip: true;
y: (parent.height - self.height) / 2;
y: Math.round((parent.height - self.height) / 2 / 1px) * 1px;
if root.item.artwork.width > 0: Image {
source: root.item.artwork;
width: 100%;
@@ -279,8 +279,8 @@ component QueueRow inherits Rectangle {
source: @image-url("../assets/icons/ellipsis.svg");
width: 16px;
height: 16px;
x: (parent.width - self.width) / 2;
y: (parent.height - self.height) / 2;
x: Math.round((parent.width - self.width) / 2 / 1px) * 1px;
y: Math.round((parent.height - self.height) / 2 / 1px) * 1px;
tint: mta.has-hover ? Theme.text-primary : Theme.text-muted;
}
mta := TouchArea {
@@ -299,7 +299,8 @@ component QueueRow inherits Rectangle {
x: root.width - 200px;
y: 44px;
width: 196px;
height: 175px;
// Ephemeral rows drop the persistence items (Add to playlist / Track info).
height: root.item.is-ephemeral ? 105px : 175px;
ContextMenu {
ContextMenuItem {
icon: @image-url("../assets/icons/trash-2.svg");
@@ -316,11 +317,11 @@ component QueueRow inherits Rectangle {
icon: @image-url("../assets/icons/list-x.svg");
label: @tr("Remove all after");
}
ContextMenuItem {
if !root.item.is-ephemeral: ContextMenuItem {
icon: @image-url("../assets/icons/list-plus.svg");
label: @tr("Add to playlist");
}
ContextMenuItem {
if !root.item.is-ephemeral: ContextMenuItem {
icon: @image-url("../assets/icons/info.svg");
label: @tr("Track info");
}
@@ -518,8 +519,9 @@ export component QueueSidebar inherits Rectangle {
overflow: elide;
}
}
// Favorite (heart) toggle.
VerticalLayout {
// Favorite (heart) toggle — hidden for ephemeral
// tracks (no DB row to favorite).
if !NowPlayingState.is-ephemeral: VerticalLayout {
alignment: center;
fav := Rectangle {
width: 28px;
@@ -534,8 +536,8 @@ export component QueueSidebar inherits Rectangle {
: @image-url("../assets/icons/heart.svg");
width: 17px;
height: 17px;
x: (parent.width - self.width) / 2;
y: (parent.height - self.height) / 2;
x: Math.round((parent.width - self.width) / 2 / 1px) * 1px;
y: Math.round((parent.height - self.height) / 2 / 1px) * 1px;
tint: QueueState.now-playing-favorite
? Theme.favorite
: (fav-ta.has-hover
@@ -750,8 +752,9 @@ export component QueueSidebar inherits Rectangle {
}
}
}
// Action 2 — Save the queue as a playlist.
VerticalLayout {
// Action 2 — Save the queue as a playlist. Hidden while an ephemeral
// track is playing (an ephemeral queue can't be persisted).
if !NowPlayingState.is-ephemeral: VerticalLayout {
alignment: center;
IconButton {
icon: @image-url("../assets/icons/add-to-list.svg");