diff --git a/surfsense_backend/app/db.py b/surfsense_backend/app/db.py index 699da9c38..00a0c27e6 100644 --- a/surfsense_backend/app/db.py +++ b/surfsense_backend/app/db.py @@ -728,6 +728,13 @@ class Notification(BaseModel, TimestampMixin): Boolean, nullable=False, default=False, server_default=text("false"), index=True ) notification_metadata = Column("metadata", JSONB, nullable=True, default={}) + updated_at = Column( + TIMESTAMP(timezone=True), + nullable=True, + default=lambda: datetime.now(UTC), + onupdate=lambda: datetime.now(UTC), + index=True, + ) user = relationship("User", back_populates="notifications") search_space = relationship("SearchSpace", back_populates="notifications") diff --git a/surfsense_web/components/notifications/NotificationButton.tsx b/surfsense_web/components/notifications/NotificationButton.tsx index a4785af44..fe400d2a8 100644 --- a/surfsense_web/components/notifications/NotificationButton.tsx +++ b/surfsense_web/components/notifications/NotificationButton.tsx @@ -25,11 +25,11 @@ export function NotificationButton() { {unreadCount > 0 && ( 9 && "px-1" - )} - > + className={cn( + "absolute -top-1 -right-1 flex h-5 w-5 items-center justify-center rounded-full bg-black text-[10px] font-medium text-white dark:bg-zinc-800 dark:text-zinc-50", + unreadCount > 9 && "px-1" + )} + > {unreadCount > 99 ? "99+" : unreadCount} )} diff --git a/surfsense_web/components/notifications/NotificationPopup.tsx b/surfsense_web/components/notifications/NotificationPopup.tsx index 3355b62e6..129ff97db 100644 --- a/surfsense_web/components/notifications/NotificationPopup.tsx +++ b/surfsense_web/components/notifications/NotificationPopup.tsx @@ -55,7 +55,7 @@ export function NotificationPopup({ }; return ( -
+
{/* Header */}
@@ -92,20 +92,20 @@ export function NotificationPopup({ !notification.read && "bg-accent/50" )} > -
+
{getStatusIcon(notification)}
-
+

{notification.title}

-

+

{notification.message}