feat(web): add tracks to a playlist by pasting Audius URLs#14320
Open
dylanjeffers wants to merge 1 commit into
Open
feat(web): add tracks to a playlist by pasting Audius URLs#14320dylanjeffers wants to merge 1 commit into
dylanjeffers wants to merge 1 commit into
Conversation
|
This was referenced May 15, 2026
e4e9fe5 to
74f3c41
Compare
Adds a new "Add Tracks by URL" affordance to the owner action row on
playlist detail pages. Clicking it opens a modal where the user pastes
Audius track links — line, comma, or tab separated — and submits to
batch-add them to the current playlist. Albums and DDEX-imported
collections are intentionally excluded.
Implementation details:
- New `AddTracksByUrlModal` Redux modal slice (createModal helper) wired
through types/parentSlice/reducers/index.
- New `AddTracksByUrlModal` component:
- Parses pasted text into a deduped list of permalinks via
`getPathFromTrackUrl`.
- Resolves them in one round-trip via `sdk.tracks.getBulkTracks`.
- Filters out tracks already in the playlist, enforces a 100-track
cap, and reports invalid/unresolved/duplicate/over-limit counts in a
single summary toast.
- Dispatches `addTrackToPlaylist` per track with a 30 ms gap so each
saga's optimistic update reads the previous one's state.
- `addTrackToPlaylist` now accepts `{ silent: true }` so the per-track
"Added track to playlist" toast can be suppressed during batch adds;
default behavior (single-track adds elsewhere) is unchanged.
- New `IconLink` button in `OwnerActionButtons` opens the modal,
prefilled with the current collection id. Hidden for albums and
DDEX-imported collections.
Scope notes:
- Resolution uses the existing `addTrackToPlaylist` saga path
(sequential dispatches with small delay). A future PR could replace
this with a dedicated `addTracksToPlaylistBatch` saga that issues a
single SDK update for cleaner semantics on large pastes.
- Larger track-curation features from the spec (multi-select, range
select, undo/redo, copy selected URLs, multi-row drag) are deferred
to follow-up PRs.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
6116b0b to
2a42659
Compare
Contributor
🌐 Web preview readyPreview URL: https://audius-web-preview-pr-14320.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 an Add Tracks by URL affordance to the owner action row on playlist detail pages. Clicking it opens a modal where the user pastes Audius track links — line-, comma-, or tab-separated — and the modal batch-resolves and adds them to the current playlist. Hidden for albums and DDEX-imported collections.
Stacks on top of #14319 (Duplicate Playlist) → which stacks on #14318 (Create Playlist Modal). Review/merge those first.
Implementation
AddTracksByUrlModalslice viacreateModal, wired into modals types / parent state / reducers / index.AddTracksByUrlModal.tsx):getPathFromTrackUrl(existing util).sdk.tracks.getBulkTracks.addTrackToPlaylistper resolved track with a 30 ms gap so each saga's optimistic update is visible to the next iteration.addTrackToPlaylistaction now accepts{ silent: true }, and the saga skips the per-track "Added track to playlist" toast when set — so a single summary toast wins for batch adds. Default behavior for everywhere else (Add to Playlist menu, etc.) is unchanged.IconLinkbutton inOwnerActionButtonsopens the modal preloaded with the currentcollectionId. Hidden whenis_albumorddex_appis set.Test plan
Follow-ups
addTrackToPlaylistdispatches with a dedicatedaddTracksToPlaylistBatch(trackIds, playlistId)saga that issues one SDK update — cleaner semantics on large pastes and removes the 30 ms gap.🤖 Generated with Claude Code