Skip to content

Feature/notification preferences 399#413

Merged
Mosas2000 merged 16 commits into
mainfrom
feature/notification-preferences-399
May 21, 2026
Merged

Feature/notification preferences 399#413
Mosas2000 merged 16 commits into
mainfrom
feature/notification-preferences-399

Conversation

@Mosas2000

Copy link
Copy Markdown
Owner

Closes #399

Backend (chainhook)

notification-preferences.js — MemoryNotificationPreferencesStore and PostgresNotificationPreferencesStore with full CRUD, validatePreferencesPayload, mergePreferences, and constants for channels/event types
002_add_notification_preferences.sql
— idempotent table + index migration
server.js — three new routes (GET/PUT/DELETE /api/notifications/preferences/:address), graceful shutdown cleanup, memory fallback when no DATABASE_URL
45 backend tests across unit and HTTP integration levels, all passing
Frontend

notificationPreferences.js
— localStorage persistence, defaults, isEventEnabled, isChannelEnabled helpers
NotificationPreferencesContext.jsx
— NotificationPreferencesProvider + useNotificationPreferences hook with toggleChannel, toggleEvent, setEmail, resetToDefaults, reloadFromStorage
useNotifications.js
— extended with optional preferences param; suppresses notifications when in-app channel or tip_received event is disabled
NotificationPreferences.jsx
— full settings page with accessible toggle switches, email input with validation, reset button, channel and event sections
NotificationBell.jsx
— settings gear icon in dropdown header navigates to preferences page
routes.js
— ROUTE_NOTIFICATION_PREFERENCES constant, labels, titles, and meta
App.jsx / main.jsx — provider wired in, lazy route added, nav item added
149 frontend tests across storage lib, context, component, hook integration, and bell component, all passing

@Mosas2000 Mosas2000 merged commit 89a1cda into main May 21, 2026
4 of 9 checks passed
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.

Add notification preferences

1 participant