Repository navigation
feat: Sonner toast integration - #397
Conversation
|
Cursor Agent can help with this pull request. Just |
|
Caution Review failedThe pull request is closed. ℹ️ Recent review infoConfiguration used: defaults Review profile: CHILL Plan: Pro 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughReplaces hook-based toasts with Sonner across examples and the UI package: components now import Changes
Sequence DiagramsequenceDiagram
participant Component as Example Component
participant Sonner as Sonner.toast
participant Toaster as UI Toaster
participant Theme as Theme Provider
participant DOM as Rendered UI
Component->>Sonner: toast.success(title, {description})
Sonner->>Toaster: enqueue notification
Toaster->>Theme: get current theme
Theme-->>Toaster: return theme
Toaster->>DOM: render themed notification
DOM-->>Component: notification visible
Estimated Code Review Effort🎯 3 (Moderate) | ⏱️ ~20 minutes Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 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 |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
docs/upgrade-guide.md (1)
11-54: Consider documenting TypeScript types for toast options.The migration guide clearly explains the API changes and provides helpful examples. For TypeScript users who need to type their toast options, consider adding a brief note about the
ExternalToasttype that's exported from@sqlrooms/ui(mentioned in the AI summary).Example addition:
import {toast, type ExternalToast} from '@sqlrooms/ui'; const options: ExternalToast = { description: 'File loaded', }; toast.success('Table created', options);🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@docs/upgrade-guide.md` around lines 11 - 54, Add a short TypeScript note to the migration section describing the exported ExternalToast type from `@sqlrooms/ui` and show how to import it alongside toast (e.g., import { toast, type ExternalToast } from '@sqlrooms/ui') and use it to type an options object passed to toast.success; also mention that legacyToast continues to accept the old object shape so users can type legacy usages with ExternalToast as well.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In `@docs/upgrade-guide.md`:
- Around line 11-54: Add a short TypeScript note to the migration section
describing the exported ExternalToast type from `@sqlrooms/ui` and show how to
import it alongside toast (e.g., import { toast, type ExternalToast } from
'@sqlrooms/ui') and use it to type an options object passed to toast.success;
also mention that legacyToast continues to accept the old object shape so users
can type legacy usages with ExternalToast as well.
Integrate Sonner from shadcn into
@sqlrooms/uiand migrate examples fromuseToastto Sonner.Summary by CodeRabbit
Chores
New Features
Documentation