feat(web): bulk track actions toolbar with select-all, copy URLs, remove, undo/redo#14323
Open
dylanjeffers wants to merge 1 commit into
Open
feat(web): bulk track actions toolbar with select-all, copy URLs, remove, undo/redo#14323dylanjeffers wants to merge 1 commit into
dylanjeffers wants to merge 1 commit into
Conversation
|
6 tasks
10295c5 to
ba2fa57
Compare
… undo/redo)
Adds the bulk track-curation toolbar to the playlist detail page when
in edit mode, plus keyboard shortcuts for the common operations.
- New `TrackSelectionProvider` + `useTrackSelection` hook: a Set of
selected track IDs with toggle (including shift-range across an
ordered id list), select-all, clear, and a "last clicked index" ref
so range select works in chronological click order.
- New `TrackHistoryProvider` + `useTrackHistoryContext`: undo/redo
stacks for `remove` and `add` operations. Undo of a `remove`
dispatches `addTrackToPlaylist({ silent: true })` (note: the
existing saga appends rather than re-inserting at the original
index — current ordering is a known limitation surfaced as a
follow-up).
- New `TrackBulkActionsBar` sticks to the top of the track table
while in edit mode and shows a count of selected tracks plus the
five bulk actions: Copy URLs (clipboard-writes
`${origin}${permalink}` for each selected track), Remove
(dispatches removeTrackFromPlaylist per id and pushes history
entries so each remove is undoable), Undo, Redo, and Select all /
Clear pair.
- Keyboard shortcuts wired through the same component while in edit
mode: Cmd/Ctrl+A select all, Cmd/Ctrl+Z undo, Cmd/Ctrl+Shift+Z /
Cmd/Ctrl+Y redo, Escape clears selection, Delete/Backspace removes
selected (and skips when focus is in a text input).
- CollectionPage is wrapped in the selection + history providers
alongside the existing edit-mode provider.
Scope notes — per-row checkbox UI and shift-range row-click select
require deeper changes to the existing TracksTable component and are
deferred to a follow-up PR; users can still select-all via the bar
or Cmd/Ctrl+A and operate on the full set.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
46c2b73 to
c539a7b
Compare
Contributor
🌐 Web preview readyPreview URL: https://audius-web-preview-pr-14323.audius.workers.dev Unique preview for this PR (deployed from this branch). |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds a bulk track-curation toolbar to the playlist detail page when in edit mode (added in #14322), with multi-track selection, the bulk operations called out in the spec (copy URLs, remove), and an undo/redo stack for those operations.
Stacked on #14322 → #14321 → #14320 → #14319 → #14318.
Implementation
TrackSelectionProvider+useTrackSelection: a Set of selected track IDs plus a "last clicked index" ref. Toggle takes an{ shift?: boolean }option that fills in the range across an ordered id list — wired through but not yet hooked up to row clicks (see scope notes).TrackHistoryProvider+useTrackHistoryContext: separate undo/redo stacks forremoveandaddoperations. Undoing a remove dispatchesaddTrackToPlaylist(trackId, collectionId, { silent: true })so it doesn't fire the per-track "Added track to playlist" toast; redo re-issuesremoveTrackFromPlaylist.TrackBulkActionsBarsticks to the top of the track table when edit mode is active. Shows the count of selected tracks and five bulk operations:${origin}${permalink}for each selected track to the clipboard vianavigator.clipboard.writeText, with a toast summary ("Copied N track URLs to clipboard").removeTrackFromPlaylistper selected id and pushes aremovehistory entry so each one is undoable.Cmd/Ctrl+A→ Select all tracksCmd/Ctrl+Z→ UndoCmd/Ctrl+Shift+ZorCmd/Ctrl+Y→ RedoEscape→ Clear selectionDelete/Backspace→ Remove selectedCollectionPageis wrapped in both providers alongside the existing edit-mode provider; the bar renders only when there's a selection or when the history stacks are non-empty.Scope notes / follow-ups
TracksTable(react-table) component and are deferred. Users can currently select all via the bar orCmd/Ctrl+Aand operate on the full set; future PR will add row-level selection.removere-adds the track but uses the existingaddTrackToPlaylistsaga, which appends rather than reinserting at the original index. The history entry already captures the original index for when the saga grows the option to slot a track at a specific position.Test plan
Cmd+A→ all tracks select; bar shows "N selected".Cmd+A→ selects text inside the input, does NOT select tracks.Escapeclears selection.Deleteremoves when there's a selection.🤖 Generated with Claude Code