Skip to content

fix(notifications): implement persistent notification system with clear functionality#79

Open
aaf2tbz wants to merge 1 commit intomainfrom
averyfelts/notifications-bug-fix
Open

fix(notifications): implement persistent notification system with clear functionality#79
aaf2tbz wants to merge 1 commit intomainfrom
averyfelts/notifications-bug-fix

Conversation

@aaf2tbz
Copy link
Copy Markdown
Collaborator

@aaf2tbz aaf2tbz commented Feb 14, 2026

Summary

Fixes the notifications bug where notifications did not clear from the user's notifications menu when clicking "clear notifications".

What was fixed

  • User notifications now persist in database and clear properly
  • "Clear all" button actually clears notifications (was non-functional placeholder)
  • Cleared notifications stored in "old notifications" view (limited to 10 most recent)
  • State persists across page refreshes

Changes

Database

  • Added notifications table to schema with clearedAt soft-delete field
  • Migration: drizzle/0020_fat_mikhail_rasputin.sql

Server Actions (src/app/actions/notifications.ts)

  • getNotifications() - fetch active (uncleared) notifications
  • getOldNotifications() - fetch cleared notifications (limited to 10)
  • clearAllNotifications() - mark all as cleared, purge old ones beyond limit
  • clearNotification(id) - clear single notification
  • createNotification() - for future use by other features

Components

  • Updated NotificationsPopover to fetch from DB instead of mock data
  • Added "View old" button to access cleared notifications
  • Added useNotificationsSheet() hook for programmatic mobile control

Mobile Header

  • Integrated notifications into profile dropdown menu
  • Removed standalone notification/theme buttons from mobile header pill
  • Added "Notifications" menu item with unread count badge
  • Theme toggle remains in dropdown menu

Desktop Header

  • Notification bell remains in header with popover (unchanged)

Test plan

  • Lint passes
  • Build passes
  • Migration applied to local DB
  • Migration applied to production DB (manual)

…ar functionality

What was fixed:
- User notifications now persist in database and clear properly
- "Clear all" button actually clears notifications (was non-functional)
- Cleared notifications stored in "old notifications" view (limited to 10)
- State persists across page refreshes

Changes:
- Added notifications table to schema with clearedAt soft-delete field
- Created notifications server actions (get, getOld, clear, clearAll, create)
- Updated NotificationsPopover to fetch from DB instead of mock data
- Added "View old" button to access cleared notifications
- Mobile: integrated notifications into profile dropdown menu
  - Removed standalone notification/theme buttons from mobile header
  - Added "Notifications" menu item with unread count badge
  - Theme toggle remains in dropdown
- Desktop: notification bell remains in header with popover

Migration: drizzle/0020_fat_mikhail_rasputin.sql
@cloudflare-workers-and-pages
Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Updated (UTC)
✅ Deployment successful!
View logs
compass b1c851d Feb 14 2026, 02:42 PM

@aaf2tbz
Copy link
Copy Markdown
Collaborator Author

aaf2tbz commented Feb 14, 2026

Screenshot 2026-02-14 at 7 24 21 AM Screenshot 2026-02-14 at 7 22 46 AM Screenshot 2026-02-14 at 7 22 34 AM Screenshot 2026-02-14 at 7 22 11 AM

@NicholaiVogel
Copy link
Copy Markdown
Contributor

@claude check this PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants