You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
refactor(components/ToastProvider): remove 'durationMs' and numeric 'id' left from Sonner - #1625
Removes options from ToastOptions that were left from Sonner:
durationMs: no caller passes it, so add() always received timeout: undefined and Base UI fell back to the provider's timeout={2500}. The Infinity mapping was dead code.
id is narrowed from number | string to string and the .toString() call is dropped; every caller passes a string literal or template string.
Behavior doesn't change.
Verification
Checked all 64 notify calls across 21 files: none pass durationMs, and the 20 that pass id all pass strings.
tsc, oxlint and pnpm knip pass.
Locally on a docs page, copying a code block shows the "Copied code" toast, clicking again doesn't stack a second toast, and it closes after about 2.5 seconds.
Summary by CodeRabbit
Updates
Toast notifications now follow the provider’s configured timeout instead of accepting individual duration settings.
Toast IDs can be provided as optional strings; numeric IDs are no longer supported.
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.
No actionable comments were generated in the recent review.
Walkthrough
The toast options contract now accepts only an optional string ID. notify passes that ID directly to add and relies on the provider’s timeout configuration.
Changes: Toast options
Layer / File(s)
Summary
Toast options and notify behavior src/components/ToastProvider.tsx
ToastOptions no longer includes durationMs and limits id to strings. notify no longer sets a per-toast timeout or converts IDs to strings.
This change removes unused toast options and keeps toast behavior the same, using the provider's default timeout. No merge-blocking risk was identified.
Pre-merge checks: 4
Check name
Status
Explanation
Description Check
Check skipped - CodeRabbit’s high-level summary is enabled.
Title check
The title matches the change. The PR removes the unused durationMs option from ToastOptions and narrows id from number | string to an optional string in src/components/ToastProvider.tsx. The title nam…
Linked Issues check
Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check
Check skipped because no linked issues were found for this pull request.
Full details: Title check
Explanation
The title matches the change. The PR removes the unused durationMs option from ToastOptions and narrows id from number | string to an optional string in src/components/ToastProvider.tsx. The title names both removals and the Sonner leftover context. The title is 89 characters long, which is longer than ideal but still readable and specific.
Finishing Touches
Generate unit tests (beta)
Commit to this branch
Create a new PR
Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
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.
File: No configuration file from this repository applied
Commit: Unavailable
Layers: defaults
Review profile: CHILL
Plan: Advanced
Run ID: c36bc270-fd9a-4922-9f2a-a9c6aecb5b2d
Commits
Reviewing files that changed from the base of the PR and between 77e721b and 5460395.
Files selected for processing: 1
src/components/ToastProvider.tsx
Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 2 remain after this review.
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
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
Removes options from
ToastOptionsthat were left from Sonner:durationMs: no caller passes it, soadd()always receivedtimeout: undefinedand Base UI fell back to the provider'stimeout={2500}. TheInfinitymapping was dead code.idis narrowed fromnumber | stringtostringand the.toString()call is dropped; every caller passes a string literal or template string.Behavior doesn't change.
Verification
notifycalls across 21 files: none passdurationMs, and the 20 that passidall pass strings.tsc,oxlintandpnpm knippass.Summary by CodeRabbit