[PULSE-55] In-app notification center, settings tab, and notifications page #28
@@ -11,6 +11,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
|
|||||||
### Added
|
### Added
|
||||||
|
|
||||||
- **In-app notification center.** Bell icon in the header with dropdown of recent notifications. Uptime monitor status changes (down, degraded, recovered) create in-app notifications with links to the uptime page.
|
- **In-app notification center.** Bell icon in the header with dropdown of recent notifications. Uptime monitor status changes (down, degraded, recovered) create in-app notifications with links to the uptime page.
|
||||||
|
- **Payment failed notifications.** When Stripe sends `invoice.payment_failed`, owners and admins receive an in-app notification with a link to update payment method. Members do not see billing notifications.
|
||||||
|
|
||||||
## [0.5.1-alpha] - 2026-02-12
|
## [0.5.1-alpha] - 2026-02-12
|
||||||
|
|
||||||
|
|||||||
@@ -46,7 +46,7 @@ function formatTimeAgo(dateStr: string): string {
|
|||||||
}
|
}
|
||||||
|
|
|||||||
|
|
||||||
function getTypeIcon(type: string) {
|
function getTypeIcon(type: string) {
|
||||||
if (type.includes('down') || type.includes('degraded')) {
|
if (type.includes('down') || type.includes('degraded') || type.startsWith('billing_')) {
|
||||||
return <AlertTriangleIcon className="w-4 h-4 shrink-0 text-amber-500" />
|
return <AlertTriangleIcon className="w-4 h-4 shrink-0 text-amber-500" />
|
||||||
}
|
}
|
||||||
return <CheckCircleIcon className="w-4 h-4 shrink-0 text-emerald-500" />
|
return <CheckCircleIcon className="w-4 h-4 shrink-0 text-emerald-500" />
|
||||||
|
|||||||
Reference in New Issue
Block a user
Duplicated
formatTimeAgoandgetTypeIconutilitiesformatTimeAgoandgetTypeIconare identical copies between this file andapp/notifications/page.tsx. Consider extracting them into a shared utility (e.g.,lib/utils/notifications.ts) to avoid maintaining the same logic in two places.Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
Prompt To Fix With AI
Issue: formatTimeAgo and getTypeIcon were duplicated in NotificationCenter.tsx and app/notifications/page.tsx, so both need updates when the behavior changes.
Fix: Moved both helpers to lib/utils/notifications.tsx and switched both consumers to import from the shared utility.
Why: Centralizes logic in one place so future changes are consistent across the notification center and notifications page.