Merge pull request #191 from kveld9/feat/search-context-menu

added context menu to search panel songs
This commit is contained in:
Psychotoxical
2026-04-15 18:27:06 +02:00
committed by GitHub
4 changed files with 75 additions and 17 deletions
+13 -7
View File
@@ -897,6 +897,7 @@ export default function PlaylistDetail() {
savePlaylist(next);
setSuggestions(prev => prev.filter(s => s.id !== song.id));
setSearchResults(prev => prev.filter(s => s.id !== song.id));
showToast(t('playlists.addSuccess', { count: 1, playlist: playlist?.name }));
};
// ── Rating / Star ─────────────────────────────────────────────
@@ -1328,13 +1329,18 @@ export default function PlaylistDetail() {
)}
{searchResults.map(song => {
const isSelected = selectedSearchIds.has(song.id);
return (
<div
key={song.id}
className={`playlist-search-row${isSelected ? ' playlist-search-row--selected' : ''}`}
style={{ cursor: 'pointer' }}
onClick={() => addSong(song)}
>
return (
<div
key={song.id}
className={`playlist-search-row${isSelected ? ' playlist-search-row--selected' : ''}${contextMenuSongId === song.id ? ' context-active' : ''}`}
style={{ cursor: 'pointer' }}
onClick={() => addSong(song)}
onContextMenu={e => {
e.preventDefault();
setContextMenuSongId(song.id);
openContextMenu(e.clientX, e.clientY, songToTrack(song), 'album-song');
}}
>
<input
type="checkbox"
className="playlist-search-checkbox"