mirror of
https://github.com/kilyabin/psysonic.git
synced 2026-07-21 22:15:40 +00:00
fix(playlists): surface bulk-delete button in header while multi-select is active (#290)
Selecting playlists via the header toggle only exposed the delete action through the right-click context menu. Add a visible Delete-selected button next to Cancel that kicks off the same handleDeleteSelected flow, with a tooltip hint when some of the selected playlists aren't deletable (foreign owner). Button is only rendered when selection mode is on and at least one playlist is selected. Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
committed by
GitHub
parent
ef8d83955a
commit
cecc59aead
@@ -734,6 +734,23 @@ export default function Playlists() {
|
||||
)}
|
||||
</>
|
||||
)}
|
||||
{selectionMode && selectedIds.size > 0 && (() => {
|
||||
const deletableCount = selectedPlaylists.filter(isPlaylistDeletable).length;
|
||||
return (
|
||||
<button
|
||||
className="btn btn-danger"
|
||||
onClick={handleDeleteSelected}
|
||||
disabled={deletableCount === 0}
|
||||
data-tooltip={deletableCount === selectedIds.size
|
||||
? undefined
|
||||
: t('playlists.deleteSelectedPartial', { n: deletableCount, total: selectedIds.size })}
|
||||
data-tooltip-pos="bottom"
|
||||
>
|
||||
<Trash2 size={15} />
|
||||
{t('playlists.deleteSelected')}
|
||||
</button>
|
||||
);
|
||||
})()}
|
||||
<button
|
||||
className={`btn btn-surface${selectionMode ? ' btn-sort-active' : ''}`}
|
||||
onClick={toggleSelectionMode}
|
||||
|
||||
Reference in New Issue
Block a user