From ab52693092c9c2aafac22a3dcf1b111cdada452e Mon Sep 17 00:00:00 2001 From: jeffvli Date: Mon, 9 Feb 2026 12:51:22 -0800 Subject: [PATCH] add context menu --- .../item-list/item-detail-list/item-detail.tsx | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/src/renderer/components/item-list/item-detail-list/item-detail.tsx b/src/renderer/components/item-list/item-detail-list/item-detail.tsx index 6ac41ec95..2cd5c58d0 100644 --- a/src/renderer/components/item-list/item-detail-list/item-detail.tsx +++ b/src/renderer/components/item-list/item-detail-list/item-detail.tsx @@ -222,6 +222,22 @@ const TrackRow = memo( [internalState, song], ); + const handleContextMenu = useCallback( + (event: React.MouseEvent) => { + if (isSongsLoading || !controls?.onMore) return; + event.preventDefault(); + const index = internalState.findItemIndex(song.id); + controls.onMore({ + event, + index, + internalState, + item: song, + itemType: LibraryItem.SONG, + }); + }, + [controls, internalState, isSongsLoading, song], + ); + return (
0, })} onClick={handleRowClick} + onContextMenu={handleContextMenu} onMouseEnter={() => setIsRowHovered(true)} onMouseLeave={() => setIsRowHovered(false)} ref={dragRef ?? undefined}