Skip to content

feat(web): row-click selection on playlist tracks in edit mode#14324

Open
dylanjeffers wants to merge 2 commits into
claude/track-multi-selectfrom
claude/per-row-selection
Open

feat(web): row-click selection on playlist tracks in edit mode#14324
dylanjeffers wants to merge 2 commits into
claude/track-multi-selectfrom
claude/per-row-selection

Conversation

@dylanjeffers
Copy link
Copy Markdown
Contributor

Summary

Wires up row-level selection on the playlist detail page when edit mode is active. Clicking a row toggles its selection in the bulk-actions context (added in #14323) instead of playing the track; holding shift extends the selection over the range between the last click and the new one.

Stacked on #14323#14322#14321#14320#14319#14318.

Implementation

  • New EditAwareTracksTable wraps the standard TracksTable:
    • When edit mode is active for the current collection, intercepts onClickRow(track, index) to call selection.toggle(track.track_id, index, { shift }) instead of the original handler.
    • TracksTable's onClickRow does not receive a MouseEvent, so the wrapper tracks the shift key globally via window keydown/keyup listeners and reads it at click time.
    • Outside of edit mode the wrapper is a transparent pass-through; play-on-click works unchanged.
  • CollectionPage swaps its TracksTable instantiation for the new wrapper and passes the collection id.

With this PR, the full track-curation flow from the spec is wired:

  • Single-click → toggle selection
  • Shift-click → range select
  • Cmd/Ctrl+A → Select all
  • Escape → Clear selection
  • Delete → Remove selected
  • Cmd/Ctrl+Z / Cmd/Ctrl+Y → Undo / Redo
  • Toolbar buttons for Copy URLs and Remove

Notes

  • A per-row visual highlight for selected rows is not yet wired (the count in the bulk-actions bar is the current source of truth). Follow-up will add a selected-row background style once TracksTable exposes a per-row className hook.

Test plan

  • Enter edit mode on your playlist.
  • Click a row → bar shows "1 selected"; play state does not change.
  • Click another row → "2 selected".
  • Shift-click a third row → range from the previous click is added.
  • Click a selected row → it is removed from the selection.
  • Exit edit mode → click a row → playback starts as before.

🤖 Generated with Claude Code

@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented May 15, 2026

⚠️ No Changeset found

Latest commit: 8cc78cc

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@pull-request-size pull-request-size Bot added size/L and removed size/M labels May 15, 2026
@dylanjeffers dylanjeffers force-pushed the claude/track-multi-select branch from 46c2b73 to c539a7b Compare May 15, 2026 18:12
dylanjeffers and others added 2 commits May 15, 2026 11:12
While the playlist detail page is in edit mode, clicking a track row
toggles its selection in the bulk-actions context instead of playing
the track. Holding shift while clicking extends the selection over
the range between the previous click and the new one.

- New `EditAwareTracksTable` wrapper around the standard
  `TracksTable`. It captures the global shift-key state with a
  window listener (TracksTable's onClickRow does not pass a
  MouseEvent) and rewrites `onClickRow` to call
  `selection.toggle(id, index, { shift })` when edit mode is active.
- Outside of edit mode the wrapper is a transparent pass-through and
  the existing play-on-click behavior is preserved.
- Desktop `CollectionPage` swaps its `TracksTable` usage for the new
  edit-aware wrapper.

Combined with the bulk-actions bar from the previous PR, the user
can now: shift-click a range, Cmd/Ctrl+A to select all, Escape to
clear, Delete to remove, Cmd/Ctrl+Z/Y for undo/redo, and the bar's
Copy URLs / Remove buttons for bulk operations.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Builds on the row-click selection from this branch to give the user
visible feedback for which tracks are currently selected.

- `TracksTable` gains an optional `rowClassNameAddition(track, index)`
  prop that's composed with the table's existing per-row className
  (used internally for the locked/disabled states). The hook is
  ref-stable so external state changes don't force a full re-render
  of the table machinery.
- `EditAwareTracksTable` passes a `rowClassNameAddition` that
  returns the new `selected` CSS class when the row's track id is
  in the selection set and the page is in edit mode. The class
  draws a surface-2 background fill and a 3px accent bar on the
  left edge so selected rows are immediately scannable.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@dylanjeffers dylanjeffers force-pushed the claude/per-row-selection branch from 13ec3ba to 8cc78cc Compare May 15, 2026 18:12
@github-actions
Copy link
Copy Markdown
Contributor

🌐 Web preview ready

Preview URL: https://audius-web-preview-pr-14324.audius.workers.dev

Unique preview for this PR (deployed from this branch).
Workflow run

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant