feat(discover): add "queue" + "create playlist" buttons to Weekly rows

Add two title-adjacent icon buttons to the external-reco Weekly
Exploration and Weekly Jams rows: add the whole backing track list to the
queue, or create a playlist from it (reusing the add-to-playlist picker
from the queue save-as-playlist work, P6). SlimCarousel gains an opt-in
show-list-actions + list-action callback (default off, so the shared
recent/popular rows are unchanged); external_reco::list_track_ids reads
the row's backing ids; playback::enqueue_track_ids resolves + enqueues
them; a new ("ext-reco-list", _) media-action routes both.

cc
This commit is contained in:
vicrodh committed 2026-06-27 14:22:01 -06:00
1 parent f51380f4f8
commit 2d7232d4e7
5 files changed
+112 -1

No files matched your search

@@ -90,6 +90,10 @@ export component ExternalRecoView inherits VerticalLayout {
if ExternalRecoState.weekly-exploration.length > 0: SlimCarousel {
title: @tr("Weekly Exploration");
items: ExternalRecoState.weekly-exploration;
show-list-actions: true;
list-action(action) => {
root.media-action("ext-reco-list", "weekly-exploration", action);
}
item-clicked(id) => {
root.play-track(id);
}
@@ -99,6 +103,10 @@ export component ExternalRecoView inherits VerticalLayout {
if ExternalRecoState.weekly-jams.length > 0: SlimCarousel {
title: @tr("Weekly Jams");
items: ExternalRecoState.weekly-jams;
show-list-actions: true;
list-action(action) => {
root.media-action("ext-reco-list", "weekly-jams", action);
}
item-clicked(id) => {
root.play-track(id);
}
@@ -47,6 +47,11 @@ export component SlimCarousel inherits VerticalLayout {
in property <string> title;
in property <[SlimItem]> items;
callback item-clicked(string);
// P7: optional title-adjacent list actions ("add to queue" / "create
// playlist from this list"). Off by default so the shared SlimCarousel rows
// (recent, popular) are unchanged; only the Weekly rows opt in.
in property <bool> show-list-actions: false;
callback list-action(string);
property <int> columns: 4;
property <int> rows: 3;
@@ -71,6 +76,29 @@ export component SlimCarousel inherits VerticalLayout {
vertical-alignment: center;
horizontal-stretch: 1;
}
// Title-adjacent list actions (P7): add the whole backing list to the
// queue / create a playlist from it. Icon buttons (ADR-008, no pills).
if root.show-list-actions: HorizontalLayout {
spacing: 4px;
VerticalLayout {
alignment: center;
NavButton {
icon: @image-url("../assets/icons/list-end.svg");
clicked => {
root.list-action("queue");
}
}
}
VerticalLayout {
alignment: center;
NavButton {
icon: @image-url("../assets/icons/list-music.svg");
clicked => {
root.list-action("create-playlist");
}
}
}
}
// Only when there is a second page.
if root.total > root.per-page: HorizontalLayout {
spacing: 4px;