Skip to content

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 โ€‹

TypeColorUse Case
messageBlue (bg-blue-600/90)New incoming message
acceptedAmber (bg-amber-600/90)Wave was accepted
errorRed (bg-red-600/90)Error occurred
successGreen (bg-green-600/90)Action succeeded
defaultWhite (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: { ... }
}

Built with VitePress