44 - Toast Notifications System
Overview
Architecture
┌─────────────────────────────────────────────────────────────────────────────┐
│ Toast Notification Flow │
└─────────────────────────────────────────────────────────────────────────────┘
┌──────────────┐ ┌──────────────────┐ ┌──────────────┐ ┌────────────┐
│ Component │───▶│ showToast │───▶│ alertStore │───▶│ sonner │
│ (Feature) │ │ (utils/toast) │ │ (check) │ │ (UI) │
└──────────────┘ └──────────────────┘ └──────────────┘ └────────────┘
│ │
│ ▼
│ ┌──────────────────┐
│ │ User Preferences │
│ │ (localStorage) │
│ └──────────────────┘
│
▼
Category Check:
- Is master toggle ON?
- Is category enabled?
────────────────────
If YES → Show toast
If NO → SuppressKey Files
File
Purpose
Available Categories
Category
Description
Use Cases
Developer Guidelines
1. Always Use the showToast Utility
2. Always Include a Category
3. Choose the Right Category
4. When to Show Toasts
5. Toast Options
6. Validation Errors
Adding a New Category
1. Update alertStore.ts
2. Update Profile.tsx Alerts Tab
3. Use the New Category
Socket.IO Real-Time Toasts
User Settings
Master Controls
Category Toggles
Display Settings
Actions
Testing
Common Patterns
CRUD Operations
Copy to Clipboard
Toggle Operations
Migration Guide
Summary
Last updated