From 460dc0dec8a0359af2aa027013666809d8e41156 Mon Sep 17 00:00:00 2001
From: Anish Sarkar <104695310+AnishSarkar22@users.noreply.github.com>
Date: Wed, 14 Jan 2026 04:35:59 +0530
Subject: [PATCH] feat: Enhance notification model and UI components
- Added an `updated_at` timestamp field to the Notification model for better tracking of notification updates.
- Updated the NotificationButton component to change the unread notification badge color for improved visibility.
- Adjusted the NotificationPopup component's layout and text handling for better responsiveness and readability.
---
surfsense_backend/app/db.py | 7 +++++++
.../components/notifications/NotificationButton.tsx | 10 +++++-----
.../components/notifications/NotificationPopup.tsx | 10 +++++-----
3 files changed, 17 insertions(+), 10 deletions(-)
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() {
{notification.title}
+
{notification.message}