fix(components): dedupe copy toasts across the remaining copy affordances - #1100
fix(components): dedupe copy toasts across the remaining copy affordances#1100sukvvon wants to merge 9 commits into
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThe change adds stable identifiers to copy success and failure notifications for pages, URLs, SVGs, package names, application-builder values, brand assets, and install prompts. ChangesCopy toast identifiers
Estimated code review effort: 1 (Trivial) | ~5 minutes Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
tanstack-com | 74dedbe | Commit Preview URL Branch Preview URL |
Aug 04 2026, 02:25 AM |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@src/routes/intent/registry/`$packageName.tsx:
- Line 353: Update the failure toast containing the `install-prompt-copy-failed`
symbol to remove its explicit `id` option, allowing each copy failure to create
an independent notification while leaving success-toast deduplication unchanged.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: 812f367b-dcef-4e32-83dc-3f2fa3a85b77
📒 Files selected for processing (2)
src/components/BrandContextMenu.tsxsrc/routes/intent/registry/$packageName.tsx
🚧 Files skipped from review as they are similar to previous changes (1)
- src/components/BrandContextMenu.tsx
| Try again or copy the prompt manually | ||
| </div> | ||
| </div>, | ||
| { id: 'install-prompt-copy-failed' }, |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟠 Major | ⚡ Quick win
Keep the failure toast on its default ID.
The PR objective limits deduplication to success toasts. This explicit ID causes repeated copy failures to replace the existing failure toast instead of creating independent notifications. Remove the id option from this failure toast.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@src/routes/intent/registry/`$packageName.tsx at line 353, Update the failure
toast containing the `install-prompt-copy-failed` symbol to remove its explicit
`id` option, allowing each copy failure to create an independent notification
while leaving success-toast deduplication unchanged.
Follow-up to #1095, which fixed the stacking reported in #960 for the code-block copy button. The same stacking is reachable from every other copy affordance on the site.
ToastProvideralready accepts anid, so this only sets it at the remaining call sites.Changes
CopyPageDropdown×3page-copiedFrameworkCardpackage-name-copiedBrandContextMenusvg-copied/svg-copy-failed$packageNameinstall-prompt-copied/install-prompt-copy-faileduseApplicationBuilderbuilder-copied-${kind}kindbecause the body interpolates it;commandandpromptare different messagesds/BrandAssetsbrand-asset-copied/brand-asset-copy-failedBrandContextMenuFailure toasts are included, and that matters
My first pass left failure toasts alone, reasoning that clipboard failures are too rare to bother with. That was wrong, and the preview deploy showed why:
Failure is precisely the path that produces repeat clicks — the toast itself says "Try again", and a user who follows that advice stacks a new toast each time. A rare event that invites retries stacks more readily than a common one that doesn't.
Success and failure get distinct ids so neither silently overwrites the other.
Verification
Stacking is not observable from static analysis, so each case was exercised in a browser (dev server for the first three, preview deploy for the registry):
The install-prompt case was verified in both directions: three stacked
Copy failedtoasts before the fix, oneCopied install prompttoast after.Note for anyone re-running these checks: the clipboard API rejects with
NotAllowedErrorwhenever the tab loses focus, and the handler throws beforenotifyis reached — so a missing toast in an automated run is usually a focus artefact, not a regression.Scope
Every clipboard call site that raises a toast is now covered. Call sites that copy without notifying (
DsKit,SearchModal,NPMStatsChart,ds.iconography,game/ui/*,LandingCopyPromptButton,account/integrations) use an inline check-mark and need nothing.The ~40 non-copy toasts (account settings, form submissions, uploads, moderation) are untouched — they are not repeat-fire actions and would need a separate judgement.
Note on
FrameworkCardCards on the same page now replace one another's toast instead of stacking. The body includes the package name, so nothing is lost — the latest copy is still identified. Flagging it since it is a behaviour change beyond simple double-click dedupe.
Testing
pnpm test(tsc, oxlint, unit tests) passes, plus the browser checks above.Summary by CodeRabbit