feat(slint): sidebar playlists list + create-playlist modal
- SidebarState/SidebarActions + crate::sidebar: the user's playlists
load into the left-nav list on shell entry; clicking a row opens
the playlist detail view, with the open playlist highlighted
(active-id). Empty state shown when there are none.
- The sidebar "+" opens a CreatePlaylistModal (name field + public
toggle); submit calls create_playlist, refreshes the sidebar, and
navigates to the new playlist.
cc
This commit is contained in:
7 files changed
+429
-9
No files matched your search
@@ -198,6 +198,39 @@ export global AlbumActions {
|
||||
// Which content view the shell shows.
|
||||
export enum ContentView { home, album, artist, settings, search, musician, label, location, favorites, mix, playlist }
|
||||
|
||||
// One row in the sidebar playlists list.
|
||||
export struct SidebarPlaylistItem {
|
||||
id: string,
|
||||
name: string,
|
||||
}
|
||||
|
||||
// The sidebar's playlists list (the user's own playlists). Populated
|
||||
// by crate::sidebar on shell entry and after create/delete.
|
||||
export global SidebarState {
|
||||
in property <[SidebarPlaylistItem]> playlists: [];
|
||||
in property <bool> loading: false;
|
||||
// The currently-open playlist id, for the active-row highlight.
|
||||
in property <string> active-id;
|
||||
}
|
||||
|
||||
export global SidebarActions {
|
||||
callback open-playlist(string /* id */);
|
||||
callback create-playlist();
|
||||
}
|
||||
|
||||
// "Create playlist" modal state.
|
||||
export global CreatePlaylistState {
|
||||
in-out property <bool> open: false;
|
||||
in-out property <string> name;
|
||||
in-out property <bool> is-public: false;
|
||||
in property <bool> creating: false;
|
||||
}
|
||||
|
||||
export global CreatePlaylistActions {
|
||||
callback submit();
|
||||
callback close();
|
||||
}
|
||||
|
||||
// Playlist detail screen state. Rows reuse the shared TrackRow
|
||||
// (show-artwork + show-album); populated by crate::playlist.
|
||||
export global PlaylistState {
|
||||
|
||||
Reference in new issue
Block a user