- {/* Header */}
-
-
-
Notifications
-
- {unreadCount > 0 && (
-
- )}
-
-
- {/* Filter Pills */}
-
- {(
- Object.entries(NOTIFICATION_FILTERS) as [
- NotificationTypeEnum,
- (typeof NOTIFICATION_FILTERS)[keyof typeof NOTIFICATION_FILTERS],
- ][]
- ).map(([key, { label, icon: Icon }]) => {
- const isActive = activeFilter === key;
- return (
-
- );
- })}
-
-
- {/* Notifications List */}
-
- {loading ? (
-
-
-
- ) : notifications.length === 0 ? (
-
- ) : (
-
- {notifications.map((notification, index) => (
-
-
- {index < notifications.length - 1 &&
}
-
- ))}
-
- )}
-
-
- );
-}
diff --git a/surfsense_web/content/docs/how-to/electric-sql.mdx b/surfsense_web/content/docs/how-to/electric-sql.mdx
index 54244c19b..288745850 100644
--- a/surfsense_web/content/docs/how-to/electric-sql.mdx
+++ b/surfsense_web/content/docs/how-to/electric-sql.mdx
@@ -5,11 +5,11 @@ description: Setting up Electric SQL for real-time data synchronization in SurfS
# Electric SQL
-[Electric SQL](https://electric-sql.com/) enables real-time data synchronization in SurfSense, providing instant updates for notifications, document indexing status, and connector sync progress without manual refresh. The frontend uses [PGlite](https://pglite.dev/) (a lightweight PostgreSQL in the browser) to maintain a local database that syncs with the backend via Electric SQL.
+[Electric SQL](https://electric-sql.com/) enables real-time data synchronization in SurfSense, providing instant updates for inbox items, document indexing status, and connector sync progress without manual refresh. The frontend uses [PGlite](https://pglite.dev/) (a lightweight PostgreSQL in the browser) to maintain a local database that syncs with the backend via Electric SQL.
## What Does Electric SQL Do?
-When you index documents or receive notifications, Electric SQL pushes updates to your browser in real-time. The data flows like this:
+When you index documents or receive inbox updates, Electric SQL pushes updates to your browser in real-time. The data flows like this:
1. Backend writes data to PostgreSQL
2. Electric SQL detects changes and streams them to the frontend
@@ -18,7 +18,7 @@ When you index documents or receive notifications, Electric SQL pushes updates t
This means:
-- **Notifications appear instantly** - No need to refresh the page
+- **Inbox updates appear instantly** - No need to refresh the page
- **Document indexing progress updates live** - Watch your documents get processed
- **Connector status syncs automatically** - See when connectors finish syncing
- **Offline support** - PGlite caches data locally, so previously loaded data remains accessible
diff --git a/surfsense_web/contracts/types/notification.types.ts b/surfsense_web/contracts/types/inbox.types.ts
similarity index 62%
rename from surfsense_web/contracts/types/notification.types.ts
rename to surfsense_web/contracts/types/inbox.types.ts
index b2b39d26e..515ba5864 100644
--- a/surfsense_web/contracts/types/notification.types.ts
+++ b/surfsense_web/contracts/types/inbox.types.ts
@@ -3,18 +3,18 @@ import { searchSourceConnectorTypeEnum } from "./connector.types";
import { documentTypeEnum } from "./document.types";
/**
- * Notification type enum - matches backend notification types
+ * Inbox item type enum - matches backend notification types
*/
-export const notificationTypeEnum = z.enum([
+export const inboxItemTypeEnum = z.enum([
"connector_indexing",
"document_processing",
"new_mention",
]);
/**
- * Notification status enum - used in metadata
+ * Inbox item status enum - used in metadata
*/
-export const notificationStatusEnum = z.enum(["in_progress", "completed", "failed"]);
+export const inboxItemStatusEnum = z.enum(["in_progress", "completed", "failed"]);
/**
* Document processing stage enum
@@ -30,11 +30,11 @@ export const documentProcessingStageEnum = z.enum([
]);
/**
- * Base metadata schema shared across notification types
+ * Base metadata schema shared across inbox item types
*/
-export const baseNotificationMetadata = z.object({
+export const baseInboxItemMetadata = z.object({
operation_id: z.string().optional(),
- status: notificationStatusEnum.optional(),
+ status: inboxItemStatusEnum.optional(),
started_at: z.string().optional(),
completed_at: z.string().optional(),
});
@@ -42,7 +42,7 @@ export const baseNotificationMetadata = z.object({
/**
* Connector indexing metadata schema
*/
-export const connectorIndexingMetadata = baseNotificationMetadata.extend({
+export const connectorIndexingMetadata = baseInboxItemMetadata.extend({
connector_id: z.number(),
connector_name: z.string(),
connector_type: searchSourceConnectorTypeEnum,
@@ -62,7 +62,7 @@ export const connectorIndexingMetadata = baseNotificationMetadata.extend({
/**
* Document processing metadata schema
*/
-export const documentProcessingMetadata = baseNotificationMetadata.extend({
+export const documentProcessingMetadata = baseInboxItemMetadata.extend({
document_type: documentTypeEnum,
document_name: z.string(),
processing_stage: documentProcessingStageEnum,
@@ -89,24 +89,24 @@ export const newMentionMetadata = z.object({
});
/**
- * Union of all notification metadata types
- * Use this when the notification type is unknown
+ * Union of all inbox item metadata types
+ * Use this when the inbox item type is unknown
*/
-export const notificationMetadata = z.union([
+export const inboxItemMetadata = z.union([
connectorIndexingMetadata,
documentProcessingMetadata,
newMentionMetadata,
- baseNotificationMetadata,
+ baseInboxItemMetadata,
]);
/**
- * Main notification schema
+ * Main inbox item schema
*/
-export const notification = z.object({
+export const inboxItem = z.object({
id: z.number(),
user_id: z.string(),
search_space_id: z.number().nullable(),
- type: notificationTypeEnum,
+ type: inboxItemTypeEnum,
title: z.string(),
message: z.string(),
read: z.boolean(),
@@ -116,33 +116,34 @@ export const notification = z.object({
});
/**
- * Typed notification schemas for specific notification types
+ * Typed inbox item schemas for specific types
*/
-export const connectorIndexingNotification = notification.extend({
+export const connectorIndexingInboxItem = inboxItem.extend({
type: z.literal("connector_indexing"),
metadata: connectorIndexingMetadata,
});
-export const documentProcessingNotification = notification.extend({
+export const documentProcessingInboxItem = inboxItem.extend({
type: z.literal("document_processing"),
metadata: documentProcessingMetadata,
});
-export const newMentionNotification = notification.extend({
+export const newMentionInboxItem = inboxItem.extend({
type: z.literal("new_mention"),
metadata: newMentionMetadata,
});
// Inferred types
-export type NotificationTypeEnum = z.infer