The drag payload was an untyped Vec<u64>, so dropping a LOCAL album row
onto a local playlist stored its library row id as a qobuz_track_id - the
D11 resolver could not resolve the fake id and hid the row (the
empty-playlist report). New DragTrack {Qobuz|LocalRow|Plex} typed per
originating view; the drop arm stores source-aware refs (qobuz_download
rows keep their real Qobuz ref, plex rows their key, local rows their
path) for both local and Qobuz playlist targets.
Add-to-playlist had collapsed to play-track in LocalAlbumView (entry
rendered, action ignored) and was an unhandled arm in the Tracks tab; both
now route to the source-aware picker, Plex rows gain the entry everywhere
(gate was excluding them), folder-detail rows route through the shared
track-action arm, and bulk arms stop skipping Plex.
D11 nuance: a local-path row missing from the library index but present on
disk renders with a filename fallback instead of hiding; only genuinely
missing files stay hidden (logged distinctly). main.rs also carries the
recovery handler hunks for the sign-in flow fix (Login screen first,
browser OAuth after, no unlocked-empty shell).
cc
120 lines
4.7 KiB
Plaintext
120 lines
4.7 KiB
Plaintext
// Track-row "more" context menu — flat, ported 1:1 from the Tauri
|
|
// TrackMenu component. Items that have no Slint wiring yet emit a
|
|
// media-action with an action string the runtime currently ignores
|
|
// (no-op until backend wiring lands).
|
|
|
|
import { ContextMenu } from "ContextMenu.slint";
|
|
import { ContextMenuItem } from "ContextMenuItem.slint";
|
|
|
|
export component TrackContextMenu inherits PopupWindow {
|
|
in property <string> track-id;
|
|
// Per-source applicability (the surrounding row sets these from the track's
|
|
// source). `qobuz-actions` = the Qobuz-backed block (favorite, radio,
|
|
// mixtape, share, make-offline, go-to album/artist, track info) — on for
|
|
// Qobuz + offline, off for local / Plex / ephemeral. `playlist-action` =
|
|
// Add to playlist — on for Qobuz + offline + local + Plex (local playlists
|
|
// store each source's own ref), off for ephemeral. The transient actions
|
|
// (play / next / queue) always show.
|
|
in property <bool> qobuz-actions: true;
|
|
in property <bool> playlist-action: true;
|
|
callback media-action(string, string, string);
|
|
|
|
width: 224px;
|
|
// 3 transient + optional add-to-playlist + the 9-item Qobuz block.
|
|
height: (3 + (root.playlist-action ? 1 : 0) + (root.qobuz-actions ? 9 : 0)) * 30px;
|
|
|
|
ContextMenu {
|
|
ContextMenuItem {
|
|
icon: @image-url("../assets/icons/play.svg");
|
|
label: @tr("Play now");
|
|
clicked => {
|
|
root.media-action("track", root.track-id, "play");
|
|
}
|
|
}
|
|
ContextMenuItem {
|
|
icon: @image-url("../assets/icons/list-plus.svg");
|
|
label: @tr("Play next");
|
|
clicked => {
|
|
root.media-action("track", root.track-id, "play-next");
|
|
}
|
|
}
|
|
ContextMenuItem {
|
|
icon: @image-url("../assets/icons/list-end.svg");
|
|
label: @tr("Add to queue");
|
|
clicked => {
|
|
root.media-action("track", root.track-id, "queue");
|
|
}
|
|
}
|
|
if root.qobuz-actions: ContextMenuItem {
|
|
icon: @image-url("../assets/icons/radio.svg");
|
|
label: @tr("Create radio");
|
|
clicked => {
|
|
root.media-action("track", root.track-id, "create-radio");
|
|
}
|
|
}
|
|
if root.qobuz-actions: ContextMenuItem {
|
|
icon: @image-url("../assets/icons/heart.svg");
|
|
label: @tr("Add to library");
|
|
clicked => {
|
|
root.media-action("track", root.track-id, "favorite");
|
|
}
|
|
}
|
|
if root.qobuz-actions: ContextMenuItem {
|
|
icon: @image-url("../assets/icons/cassette-tape.svg");
|
|
label: @tr("Add to mixtape");
|
|
clicked => {
|
|
root.media-action("track", root.track-id, "add-to-mixtape");
|
|
}
|
|
}
|
|
if root.playlist-action: ContextMenuItem {
|
|
icon: @image-url("../assets/icons/list-music.svg");
|
|
label: @tr("Add to playlist");
|
|
clicked => {
|
|
root.media-action("track", root.track-id, "add-to-playlist");
|
|
}
|
|
}
|
|
if root.qobuz-actions: ContextMenuItem {
|
|
icon: @image-url("../assets/icons/link.svg");
|
|
label: @tr("Share Qobuz link");
|
|
clicked => {
|
|
root.media-action("track", root.track-id, "share-qobuz");
|
|
}
|
|
}
|
|
if root.qobuz-actions: ContextMenuItem {
|
|
icon: @image-url("../assets/icons/link.svg");
|
|
label: @tr("Share Song.link");
|
|
clicked => {
|
|
root.media-action("track", root.track-id, "share-songlink");
|
|
}
|
|
}
|
|
if root.qobuz-actions: ContextMenuItem {
|
|
icon: @image-url("../assets/icons/cloud-download.svg");
|
|
label: @tr("Make available offline");
|
|
clicked => {
|
|
root.media-action("track", root.track-id, "download");
|
|
}
|
|
}
|
|
if root.qobuz-actions: ContextMenuItem {
|
|
icon: @image-url("../assets/icons/disc-3.svg");
|
|
label: @tr("Go to album");
|
|
clicked => {
|
|
root.media-action("track", root.track-id, "go-to-album");
|
|
}
|
|
}
|
|
if root.qobuz-actions: ContextMenuItem {
|
|
icon: @image-url("../assets/icons/user.svg");
|
|
label: @tr("Go to artist");
|
|
clicked => {
|
|
root.media-action("track", root.track-id, "go-to-artist");
|
|
}
|
|
}
|
|
if root.qobuz-actions: ContextMenuItem {
|
|
icon: @image-url("../assets/icons/info.svg");
|
|
label: @tr("Track info");
|
|
clicked => {
|
|
root.media-action("track", root.track-id, "track-info");
|
|
}
|
|
}
|
|
}
|
|
}
|