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
+6
View File
@@ -1640,6 +1640,7 @@ export const usePlayerStoreBase = createWithEqualityFn<PlayerState>()(
const excludedPlayerKeys = ['playerNum', 'seekToTimestamp', 'status'];
// If we're not restoring the play queue, we don't need the index property
// (it is meaningless without the queue)
if (!shouldRestorePlayQueue) {
excludedPlayerKeys.push('index');
}
@@ -2076,6 +2077,7 @@ export const updateQueueSong = (songId: string, updatedSong: Song) => {
const uniqueId = song._uniqueId;
state.queue.songs[song._uniqueId] = {
...updatedSong,
_contextPlaylistId: song._contextPlaylistId,
_uniqueId: uniqueId,
};
}
@@ -2083,6 +2085,10 @@ export const updateQueueSong = (songId: string, updatedSong: Song) => {
});
};
export const useCurrentPlaylistContextId = () => {
return usePlayerStoreBase((state) => state.getCurrentSong()?._contextPlaylistId ?? null);
};
export const usePlayerMuted = () => {
return usePlayerStoreBase((state) => state.player.muted);
};