Notification & Message Features - Quick Reference โ
1. Dismiss a Notification (Persisted) โ
Clicking the X button on any notification dismisses it and saves to localStorage, so it won't appear again.
javascript
// Manually dismiss from code
dismissNotification(notificationId)2. Add a New Notification Type โ
To add error/success notifications, expand the color schemes:
javascript
// In Dashboard.jsx addNotification() calls:
addNotification({
text: 'Something went wrong',
type: 'error', // Will auto-use red color scheme
connectionId: null
})
// Or for success:
addNotification({
text: 'Message sent!',
type: 'success', // Will auto-use green color scheme
connectionId: null
})3. Delete a Message โ
Users can hover over their own messages and click the trash icon to delete them.
Implementation:
- Chat component automatically shows delete button for "You" messages
- Deletion triggers confirmation dialog
- Real-time sync updates both users' chats
4. Check Dismissed Notifications โ
Open DevTools > Application > LocalStorage and look for:
Key: lantern_dismissed_notifications
Value: ["id1", "id2", "id3", ...]5. Color-Coded Notifications Reference โ
| Type | Color | Use Case |
|---|---|---|
message | Blue (bg-blue-600/90) | New incoming message |
accepted | Amber (bg-amber-600/90) | Wave was accepted |
error | Red (bg-red-600/90) | Error occurred |
success | Green (bg-green-600/90) | Action succeeded |
default | White (bg-white/80) | General messages |
6. Add New Notification Type Styling โ
Edit notificationStyles object in Dashboard.jsx (~line 1535):
javascript
const notificationStyles = {
message: { ... },
accepted: { ... },
error: { ... },
success: { ... },
customType: { // Add new
bg: 'bg-purple-600/90',
border: 'border-purple-500/50',
icon: 'bg-purple-500/40',
iconColor: 'text-purple-300',
textColor: 'text-white'
},
default: { ... }
}Related Files โ
- NOTIFICATIONS_AND_MESSAGES.md - Full documentation
- src/screens/dashboard/Dashboard.jsx - Notification logic
- src/components/Chat.jsx - Message deletion UI
- src/lib/messageService.js - Backend integration