diff --git a/frontend/src/components/playlist-view/playlist-view.ts b/frontend/src/components/playlist-view/playlist-view.ts index 47a9c22..25d1fa2 100644 --- a/frontend/src/components/playlist-view/playlist-view.ts +++ b/frontend/src/components/playlist-view/playlist-view.ts @@ -277,6 +277,10 @@ export class PlaylistView this.closePlaylistContextMenu(); }; + private handleSelectAll = (): void => { + this.selection.selectAll(); + }; + private clearSelectionHandler = (e: MouseEvent) => { const path = e.composedPath(); const isTrackClick = path.some( @@ -1196,6 +1200,10 @@ export class PlaylistView 'mousedown', this.sortDropdownCloseHandler, ); + document.addEventListener( + 'shortcut:select-all', + this.handleSelectAll, + ); } override disconnectedCallback() { @@ -1226,6 +1234,10 @@ export class PlaylistView 'mousedown', this.sortDropdownCloseHandler, ); + document.removeEventListener( + 'shortcut:select-all', + this.handleSelectAll, + ); } override updated() { diff --git a/frontend/src/components/queue-panel/queue-panel.ts b/frontend/src/components/queue-panel/queue-panel.ts index 0db5de9..ac3772f 100644 --- a/frontend/src/components/queue-panel/queue-panel.ts +++ b/frontend/src/components/queue-panel/queue-panel.ts @@ -92,6 +92,10 @@ export class QueuePanel @query('track-details') private trackDetailsDialog!: TrackDetails; + private handleSelectAll = (): void => { + this.selection.selectAll(); + }; + private closePickerHandler = (e: MouseEvent) => { const path = e.composedPath(); const popup = this.addToPlaylistPopup; @@ -475,6 +479,10 @@ export class QueuePanel 'dragend', this.onDocumentDragEnd, ); + document.addEventListener( + 'shortcut:select-all', + this.handleSelectAll, + ); } override disconnectedCallback() { @@ -499,6 +507,10 @@ export class QueuePanel 'dragend', this.onDocumentDragEnd, ); + document.removeEventListener( + 'shortcut:select-all', + this.handleSelectAll, + ); } override updated() { diff --git a/frontend/src/components/track-list/track-list.ts b/frontend/src/components/track-list/track-list.ts index a89e5b3..5a71df4 100644 --- a/frontend/src/components/track-list/track-list.ts +++ b/frontend/src/components/track-list/track-list.ts @@ -151,6 +151,10 @@ export class TrackList extends LitElement implements SelectionHost, ContextMenuH private prevSortField: string | null = null; private prevSortDir: SortDirection = 'asc'; + private handleSelectAll = (): void => { + this.selection.selectAll(); + }; + private clearSelectionHandler = (e: MouseEvent) => { const path = e.composedPath(); const isTrackClick = path.some( @@ -1030,6 +1034,7 @@ export class TrackList extends LitElement implements SelectionHost, ContextMenuH } document.addEventListener('mousedown', this.sortDropdownCloseHandler); document.addEventListener('click', this.clearSelectionHandler); + document.addEventListener('shortcut:select-all', this.handleSelectAll); document.addEventListener('mousemove', this.onColResizeMove); document.addEventListener('mouseup', this.onColResizeEnd); @@ -1051,6 +1056,7 @@ export class TrackList extends LitElement implements SelectionHost, ContextMenuH super.disconnectedCallback(); document.removeEventListener('mousedown', this.sortDropdownCloseHandler); document.removeEventListener('click', this.clearSelectionHandler); + document.removeEventListener('shortcut:select-all', this.handleSelectAll); document.removeEventListener('mousemove', this.onColResizeMove); document.removeEventListener('mouseup', this.onColResizeEnd);