feat(slint): wire track context-menu actions (favorite/radio/share/playlist/nav)
Connects the previously-inert track context-menu items now that the
backends exist:
- Add to library -> add_favorite("track").
- Go to album / Go to artist -> resolve the track (get_track) to its
album / performer and navigate there.
- Create radio -> Qobuz track radio (new get_radio_track core wrapper
over the existing qbz-qobuz endpoint + playback::play_track_radio).
- Share Qobuz link -> https://www.qobuz.com/track/{id} to clipboard
(new arboard dep + share module).
- Share Song.link -> Odesli (api.song.link) pageUrl resolution to
clipboard.
- Add to playlist -> a global picker modal (PlaylistPickerModal +
PlaylistPickerState/Actions + playlist_picker controller) listing
the user's playlists; picking one calls add_tracks_to_playlist.
Add to mixtape / Make available offline / Track info stay unwired
(no backend yet).
cc
This commit is contained in:
10 files changed
+450
-1
No files matched your search
@@ -10,6 +10,7 @@ export struct AlbumCardItem {
|
||||
id: string,
|
||||
title: string,
|
||||
artist: string,
|
||||
artist-id: string, // for the clickable artist name -> artist page
|
||||
genre: string, // shown in the hover overlay
|
||||
year: string, // shown in the hover overlay
|
||||
quality-tier: string, // "hires" | "cd" | "" — drives the badge icon
|
||||
@@ -712,6 +713,28 @@ export global QueueState {
|
||||
in property <bool> infinite-play: false;
|
||||
}
|
||||
|
||||
// One row in the "Add to playlist" picker.
|
||||
export struct PlaylistPickItem {
|
||||
id: string,
|
||||
name: string,
|
||||
tracks-line: string, // "N tracks"
|
||||
}
|
||||
|
||||
// "Add to playlist" picker — a global overlay opened from the track
|
||||
// context menu. Holds the pending track id while the user picks a
|
||||
// destination playlist. Populated by crate::playlist_picker.
|
||||
export global PlaylistPickerState {
|
||||
in-out property <bool> open: false;
|
||||
in property <string> track-id;
|
||||
in property <[PlaylistPickItem]> playlists: [];
|
||||
in property <bool> loading: false;
|
||||
}
|
||||
|
||||
export global PlaylistPickerActions {
|
||||
callback pick(string /* playlist id */);
|
||||
callback close();
|
||||
}
|
||||
|
||||
// A playlist result in search. Qobuz returns up to four cover URLs per
|
||||
// playlist; the card renders them as a count-based collage.
|
||||
export struct SearchPlaylistItem {
|
||||
|
||||
Reference in new issue
Block a user