Skip to content

fix(collection): stop double-toast on add-to-playlist (mobile + web)#14423

Merged
dylanjeffers merged 1 commit into
mainfrom
claude/fix-double-toast-add-track
May 29, 2026
Merged

fix(collection): stop double-toast on add-to-playlist (mobile + web)#14423
dylanjeffers merged 1 commit into
mainfrom
claude/fix-double-toast-add-track

Conversation

@dylanjeffers
Copy link
Copy Markdown
Contributor

Summary

Adding a track via the Add-to-Collection drawer (mobile) or modal (web), or via the Duplicate-Add confirmation drawer/modal, showed two toasts in a row.

Root cause: the addTrackToPlaylist saga ends with if (!action.silent) put(toast(...)) — the silent gate added in #14393 lets callers suppress the saga's default toast when they want to show their own. Four callers ignored the gate: they dispatched addTrackToPlaylist without silent and fired their own UI toast (some richer than the saga's, e.g. the duplicate-add-confirmation modal's toast with a "View" link). Both the UI toasts and the saga's toast funnel through the same Redux toast slice — ToastContext.toast and useToast().toast both ultimately dispatch the same toast action — so there is no implicit dedup. Mobile users saw two toasts; desktop users got the same bug but the two were timed close enough that they often didn't notice.

The fix is a one-line { silent: true } in each of the four call sites so the saga keeps quiet and the caller's richer toast wins. Other callers (track menu, sidebar drag-drop, suggested-tracks "Add") don't fire their own toast and keep getting the saga's default — unchanged.

Files

  • packages/mobile/src/components/add-to-collection-drawer/AddToCollectionDrawer.tsx
  • packages/mobile/src/components/duplicate-add-confirmation-drawer/DuplicateAddConfirmationDrawer.tsx
  • packages/web/src/components/add-to-collection/desktop/AddToCollectionModal.tsx
  • packages/web/src/components/duplicate-add-confirmation-modal/DuplicateAddConfirmationModal.tsx

Test plan

  • Mobile: Open a track menu → Add to playlist → pick a playlist → exactly one toast appears.
  • Mobile: Add a track that's already in the playlist → confirm "Add Anyway" → exactly one toast appears.
  • Web: Same two flows via desktop modal → exactly one toast appears, and the toast still includes the "View" link where it did before.
  • Web: Drag a track from the sidebar onto a playlist library entry → still get the saga's default "Added track to playlist" toast (no regression).
  • Web: Click "+" on a suggested track on the playlist page → still get the saga's default toast.
  • Web: Paste-URL bulk add → no per-track toasts, only the modal's summary toast (no regression — already used silent: true).

🤖 Generated with Claude Code

…re their own

The addTrackToPlaylist saga ends with `if (!action.silent) put(toast(...))`,
the silent gate added in #14393. Four callers ignored it: they dispatched
addTrackToPlaylist without silent AND fired their own UI toast (some with
richer content — e.g. the duplicate-add-confirmation modal's "View" link).
Result: two toasts in a row for the same add.

Both web's ToastContext.toast and mobile's useToast().toast funnel through
the same Redux toast slice as the saga's toast action, so there's no
implicit dedup — the duplicate was just timed close enough on desktop that
users didn't always notice. Mobile users did.

Pass { silent: true } in all four sites so the callers' richer toasts win
and the saga's default toast is suppressed. Other callers (track menu,
sidebar drag-drop, suggested-tracks "Add") don't fire their own toast and
still get the saga's default — unchanged.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented May 29, 2026

⚠️ No Changeset found

Latest commit: 6fedea5

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

@github-actions
Copy link
Copy Markdown
Contributor

🌐 Web preview ready

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

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

@dylanjeffers dylanjeffers merged commit a6b738b into main May 29, 2026
13 checks passed
@dylanjeffers dylanjeffers deleted the claude/fix-double-toast-add-track branch May 29, 2026 19:43
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