From 210808fd3940670a30820d20b22be11e534f93c6 Mon Sep 17 00:00:00 2001 From: vicrodh <103399283+vicrodh@users.noreply.github.com> Date: Wed, 27 May 2026 14:28:32 -0600 Subject: [PATCH] feat(slint): scaffold favorites Artists state + actions Add the FavoritesState fields for the Artists port: the grid toolbar (artists-search / artists-view-mode grid|sidepanel / artists-group-enabled), the search-filtered + A-Z-grouped models (artists-visible / artists-grouped via the new FavArtistSection struct / artists-alpha / artists-shown), and the sidepanel selection state (selected-artist-id/name, loading/error, selected-artist-sections as DiscoverSections + total). Add the FavoritesActions callbacks (search-artists, artists-set-view, artists-set-group, artists-shuffle, select-artist). Controller + view follow. cc --- crates/qbz-slint/ui/state.slint | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/crates/qbz-slint/ui/state.slint b/crates/qbz-slint/ui/state.slint index 66f364f7a..972517ddf 100644 --- a/crates/qbz-slint/ui/state.slint +++ b/crates/qbz-slint/ui/state.slint @@ -1438,6 +1438,14 @@ export struct FavoriteArtistItem { image: image, } +// An A-Z section of favorite artists (grid grouped mode + sidepanel left +// list). `key` is the bucket letter ("#", "A".."Z"); `title` the header. +export struct FavArtistSection { + key: string, + title: string, + artists: [FavoriteArtistItem], +} + // One label card in the Favorites > Labels grid. export struct FavoriteLabelItem { id: string, @@ -1490,6 +1498,21 @@ export global FavoritesState { in property <[FavoriteLabelItem]> labels: []; in property <[FavoriteLabelItem]> labels-visible: []; // after search filter (rendered) in-out property labels-search: ""; + // Artists — toolbar / grid view + in-out property artists-search: ""; + in-out property artists-view-mode: "grid"; // grid | sidepanel + in-out property artists-group-enabled: false; // A-Z grouping (grid) + in property <[FavoriteArtistItem]> artists-visible: []; // after search (flat grid) + in property <[FavArtistSection]> artists-grouped: []; // A-Z sections (grouped grid + sidepanel list) + in property <[AlphaJump]> artists-alpha: []; // A-Z jump strip + in property artists-shown: 0; // count after search + // Artists — sidepanel (the selected artist's albums) + in-out property selected-artist-id: ""; // "" = none selected + in property selected-artist-name: ""; + in property selected-albums-loading: false; + in property selected-albums-error: ""; + in property selected-albums-total: 0; // sum across sections + in property <[DiscoverSection]> selected-artist-sections: []; // release-type sections in property tracks-total: 0; in property albums-total: 0; in property artists-total: 0; @@ -1522,6 +1545,11 @@ export global FavoritesActions { callback search-playlists(string /* query */); callback playlists-set-view(string /* grid | list */); callback playlist-action(string /* playlist id */, string /* play | play-next | queue | share | favorite */); + callback search-artists(string /* query */); + callback artists-set-view(string /* grid | sidepanel */); + callback artists-set-group(string /* off | alpha */); + callback artists-shuffle(); + callback select-artist(string /* artist id */, string /* name */); callback albums-set-view(string /* grid | list */); callback albums-set-sort(string /* sort key */); callback albums-set-group(string /* off | alpha | artist */);