From 4adea11a930a69347d7d38677a5263d6d5305a2f Mon Sep 17 00:00:00 2001 From: jeffvli Date: Thu, 12 Feb 2026 00:13:32 -0800 Subject: [PATCH] support select all hotkey in detail list view --- .../item-detail-list/item-detail-list.tsx | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/src/renderer/components/item-list/item-detail-list/item-detail-list.tsx b/src/renderer/components/item-list/item-detail-list/item-detail-list.tsx index 09c6e96ac..04730f875 100644 --- a/src/renderer/components/item-list/item-detail-list/item-detail-list.tsx +++ b/src/renderer/components/item-list/item-detail-list/item-detail-list.tsx @@ -40,6 +40,7 @@ import { useItemSelectionState, } from '/@/renderer/components/item-list/helpers/item-list-state'; import { parseTableColumns } from '/@/renderer/components/item-list/helpers/parse-table-columns'; +import { useListHotkeys } from '/@/renderer/components/item-list/helpers/use-list-hotkeys'; import { getDetailListCellComponent } from '/@/renderer/components/item-list/item-detail-list/columns'; import { getTrackColumnFixed, @@ -68,6 +69,8 @@ import { SEPARATOR_STRING } from '/@/shared/api/utils'; import { ExplicitIndicator } from '/@/shared/components/explicit-indicator/explicit-indicator'; import { Skeleton } from '/@/shared/components/skeleton/skeleton'; import { useDoubleClick } from '/@/shared/hooks/use-double-click'; +import { useFocusWithin } from '/@/shared/hooks/use-focus-within'; +import { useMergedRef } from '/@/shared/hooks/use-merged-ref'; import { Album, LibraryItem, Song, SongListSort, SortOrder } from '/@/shared/types/domain-types'; import { dndUtils, DragData, DragOperation, DragTarget } from '/@/shared/types/drag-and-drop'; import { ItemListKey, Play, TableColumn } from '/@/shared/types/types'; @@ -1186,6 +1189,8 @@ export const ItemDetailList = ({ }: ItemDetailListProps) => { const containerRef = useRef(null); const listRef = useListRef(null); + const { focused, ref: focusRef } = useFocusWithin(); + const mergedContainerRef = useMergedRef(containerRef, focusRef); const lastVisibleStartIndexRef = useRef(0); const queryClient = useQueryClient(); @@ -1377,6 +1382,13 @@ export const ItemDetailList = ({ }, }); + useListHotkeys({ + controls, + focused, + internalState, + itemType: LibraryItem.SONG, + }); + useEffect(() => { const { current: container } = containerRef; @@ -1433,7 +1445,7 @@ export const ItemDetailList = ({ trackTableSize={trackTableSize} /> )} -
+