fix(myqbz): context menus — z-index, Remove/queue wiring, sidebar + album->collection

- Detail row ⋯ menu (and the hero overflow + filter popups) were PopupWindows
  with no explicit height, so they collapsed and the rows below painted over them.
  Gave each an explicit height (+ close-on-click) like every other app menu, so
  they paint above the rows.
- Row menu Remove now actually removes: it was a no-op ("remove" wasn't a RowMode)
  -> wired to remove the item (repo::remove_item by position, reload). Add-to-queue
  was also silently broken (emitted "play-later", unparsed) -> now "add-to-queue".
- Sidebar playlist right-click menu: added "Add to Mixtape/Collection" (opens the
  picker with the playlist payload).
- Album -> Collection: an album can now be added to ANY collection kind incl.
  artist_collection (removed the ArtistCollection exclusion in load_rows; Tauri
  allows adding an album to an artist discography).

Offline in the row menu is net-new (Tauri's collection row menu has none; it would
be a batch resolve-then-cache) and is NOT added here. Backend crates untouched.
cargo check -p qbz-slint green.

cc
This commit is contained in:
vicrodh committed 2026-06-09 15:17:03 -06:00
1 parent 47fdfe6622
commit 8b0df8325d
6 files changed
+125 -5

No files matched your search

+11
View File
@@ -203,6 +203,17 @@ pub fn playlist_name_desc(id: u64) -> Option<(String, String)> {
NAME_DESC.lock().ok().and_then(|nd| nd.get(&id).cloned())
}
/// Total track count for `id`, from the last loaded playlist cache. Used by the
/// sidebar "Add to Mixtape/Collection" context action to populate the AddItem
/// `track_count` (the SidebarEntry struct doesn't carry it). Returns None when
/// the playlist is unknown.
pub fn playlist_track_count(id: u64) -> Option<u32> {
CACHE
.lock()
.ok()
.and_then(|c| c.playlists.iter().find(|p| p.id == id).map(|p| p.tracks_count))
}
/// Store the freshly-loaded data and render it.
pub fn apply(window: &AppWindow, data: SidebarData) {
if let Ok(mut cache) = CACHE.lock() {