From fc5cf70e4c1be3d3f1545c140db5202601a08109 Mon Sep 17 00:00:00 2001 From: Caleb Allen Date: Tue, 17 Mar 2026 21:04:57 -0400 Subject: [PATCH] feat(17-01): add TrackMetadataChanged handler and remove selection gate on Track Details - LibraryStore now listens for TrackMetadataChanged and invalidates all caches - Track Details context menu item visible for any right-clicked track in all 4 views - Removed selectionCount === 1 gate from track-list, queue-panel, cover-grid, playlist-details --- .../src/components/cover-grid/cover-grid.ts | 4 +-- .../playlist-details/playlist-details.ts | 36 ++++++++----------- .../src/components/queue-panel/queue-panel.ts | 35 ++++++++---------- .../src/components/track-list/track-list.ts | 32 ++++++++--------- frontend/src/store/library-store.ts | 3 ++ 5 files changed, 48 insertions(+), 62 deletions(-) diff --git a/frontend/src/components/cover-grid/cover-grid.ts b/frontend/src/components/cover-grid/cover-grid.ts index 882fa0a..b59fb72 100644 --- a/frontend/src/components/cover-grid/cover-grid.ts +++ b/frontend/src/components/cover-grid/cover-grid.ts @@ -2049,9 +2049,7 @@ export class CoverGrid ${this.contextMenuTarget .kind === - 'track' && - this.selectedTracks - .size === 1 + 'track' ? html` diff --git a/frontend/src/components/playlist-details/playlist-details.ts b/frontend/src/components/playlist-details/playlist-details.ts index a56769c..63b6378 100644 --- a/frontend/src/components/playlist-details/playlist-details.ts +++ b/frontend/src/components/playlist-details/playlist-details.ts @@ -1489,27 +1489,21 @@ export class PlaylistDetails ? `Remove from ${this.favCtrl.playlistName}` : `Add to ${this.favCtrl.playlistName}`} - ${this.selection - .selectionCount === - 1 - ? html` - - this.onContextMenuAction( - 'track-details', - )} - @mouseenter=${() => - this.ctxMenu.closePlaylistSubmenu()} - > - - Track - Details - - ` - : nothing} + + this.onContextMenuAction( + 'track-details', + )} + @mouseenter=${() => + this.ctxMenu.closePlaylistSubmenu()} + > + + Track + Details + ` : nothing} diff --git a/frontend/src/components/queue-panel/queue-panel.ts b/frontend/src/components/queue-panel/queue-panel.ts index bfb311d..843ca0c 100644 --- a/frontend/src/components/queue-panel/queue-panel.ts +++ b/frontend/src/components/queue-panel/queue-panel.ts @@ -1549,26 +1549,21 @@ export class QueuePanel > ${this.favCtrl.allFavorited(this.getSelectedFilePaths()) ? `Remove from ${this.favCtrl.playlistName}` : `Add to ${this.favCtrl.playlistName}`} - ${this.selection - .selectionCount === 1 - ? html` - - this.onContextMenuAction( - 'track-details', - )} - @mouseenter=${() => - this.ctxMenu.closePlaylistSubmenu()} - > - - Track - Details - - ` - : nothing} + + this.onContextMenuAction( + 'track-details', + )} + @mouseenter=${() => + this.ctxMenu.closePlaylistSubmenu()} + > + + Track + Details + ` : nothing} diff --git a/frontend/src/components/track-list/track-list.ts b/frontend/src/components/track-list/track-list.ts index aeb2ae6..432e136 100644 --- a/frontend/src/components/track-list/track-list.ts +++ b/frontend/src/components/track-list/track-list.ts @@ -1963,24 +1963,20 @@ export class TrackList extends LitElement implements SelectionHost, ContextMenuH > ${this.favCtrl.allFavorited(this.selection.getSelectedKeysOrdered()) ? `Remove from ${this.favCtrl.playlistName}` : `Add to ${this.favCtrl.playlistName}`} - ${this.selection.selectionCount === 1 - ? html` - - this.onContextMenuAction( - 'track-details', - )} - @mouseenter=${() => - this.ctxMenu.closePlaylistSubmenu()} - > - - Track Details - - ` - : nothing} + + this.onContextMenuAction( + 'track-details', + )} + @mouseenter=${() => + this.ctxMenu.closePlaylistSubmenu()} + > + + Track Details + ` : nothing} diff --git a/frontend/src/store/library-store.ts b/frontend/src/store/library-store.ts index f251f21..7c9d16a 100644 --- a/frontend/src/store/library-store.ts +++ b/frontend/src/store/library-store.ts @@ -82,6 +82,9 @@ class LibraryStore { this.changeGen++; this.notify(); }); + EventsOn(Events.TrackMetadataChanged, () => { + this.invalidate(); + }); this.loadCoverSize(); this.deferEagerFetch();