Highlight the playlist in the left panel on play (#2025)

* Fixed bad smart playlist field s

* first try to add playlist highlight

* Simplified calls

* Now works for grids too.

* Derive the playlist highlight from the currently-playing track's origin instead of a stale global field.

* addressed comments
This commit is contained in:
Norman
2026-06-23 20:18:02 -07:00
committed by GitHub
parent b6519e9839
commit 5ddbfcbfee
6 changed files with 89 additions and 10 deletions
@@ -64,6 +64,7 @@ export const useItemDragDropState = <TElement extends HTMLElement = HTMLDivEleme
return draggedItems;
},
itemType,
metadata: { playlistId },
onDragStart: () => {
if (!item || !isDataRow) {
return;
@@ -248,10 +249,15 @@ export const useItemDragDropState = <TElement extends HTMLElement = HTMLDivEleme
case DragTarget.SONG: {
const sourceItems = (args.source.item || []) as Song[];
if (sourceItems.length > 0) {
playerContext.addToQueueByData(sourceItems, {
edge: args.edge,
uniqueId: droppedOnUniqueId,
});
const sourcePlaylistId = args.source.metadata?.playlistId as
| string
| undefined;
playerContext.addToQueueByData(
sourceItems,
{ edge: args.edge, uniqueId: droppedOnUniqueId },
undefined,
sourcePlaylistId ?? null,
);
}
break;
}