From f8b0e946ce9b7c94f433cc6813e12dd042ac2bc0 Mon Sep 17 00:00:00 2001
From: Anish Sarkar <104695310+AnishSarkar22@users.noreply.github.com>
Date: Sat, 7 Mar 2026 04:46:48 +0530
Subject: [PATCH] chore: ran linting
---
.../app/routes/notifications_routes.py | 51 +-
.../[search_space_id]/client-layout.tsx | 4 +-
.../(manage)/components/DocumentsFilters.tsx | 32 +-
.../components/DocumentsTableShell.tsx | 491 +++++++++---------
.../(manage)/components/RowActions.tsx | 8 +-
.../new-chat/[[...chat_id]]/page.tsx | 4 +-
.../atoms/chat/mentioned-documents.atom.ts | 4 +-
.../announcements/AnnouncementCard.tsx | 11 +-
.../announcements/AnnouncementsEmptyState.tsx | 1 -
.../assistant-ui/inline-mention-editor.tsx | 140 ++---
.../components/assistant-ui/thread.tsx | 93 ++--
.../layout/providers/LayoutDataProvider.tsx | 17 +-
.../layout/ui/shell/LayoutShell.tsx | 6 +-
.../ui/sidebar/AllPrivateChatsSidebar.tsx | 132 +++--
.../ui/sidebar/AllSharedChatsSidebar.tsx | 132 +++--
.../ui/sidebar/AnnouncementsSidebar.tsx | 1 -
.../layout/ui/sidebar/ChatListItem.tsx | 14 +-
.../layout/ui/sidebar/DocumentsSidebar.tsx | 10 +-
.../layout/ui/sidebar/InboxSidebar.tsx | 141 ++---
.../components/new-chat/chat-share-button.tsx | 7 +-
.../new-chat/image-config-dialog.tsx | 45 +-
.../new-chat/model-config-dialog.tsx | 32 +-
.../components/settings/roles-manager.tsx | 4 +-
.../components/shared/llm-config-form.tsx | 31 +-
surfsense_web/components/ui/calendar.tsx | 5 +-
.../components/ui/fixed-toolbar-buttons.tsx | 38 +-
surfsense_web/hooks/use-comments.ts | 4 +-
.../hooks/use-documents-processing.ts | 4 +-
surfsense_web/hooks/use-documents.ts | 7 +-
surfsense_web/hooks/use-inbox.ts | 51 +-
surfsense_web/lib/electric/baseline.ts | 2 +-
31 files changed, 768 insertions(+), 754 deletions(-)
diff --git a/surfsense_backend/app/routes/notifications_routes.py b/surfsense_backend/app/routes/notifications_routes.py
index 1bd186c3e..4fa2026ed 100644
--- a/surfsense_backend/app/routes/notifications_routes.py
+++ b/surfsense_backend/app/routes/notifications_routes.py
@@ -23,15 +23,24 @@ SYNC_WINDOW_DAYS = 14
# Valid notification types - must match frontend InboxItemTypeEnum
NotificationType = Literal[
- "connector_indexing", "connector_deletion", "document_processing",
- "new_mention", "comment_reply", "page_limit_exceeded",
+ "connector_indexing",
+ "connector_deletion",
+ "document_processing",
+ "new_mention",
+ "comment_reply",
+ "page_limit_exceeded",
]
# Category-to-types mapping for filtering by tab
NotificationCategory = Literal["comments", "status"]
CATEGORY_TYPES: dict[str, tuple[str, ...]] = {
"comments": ("new_mention", "comment_reply"),
- "status": ("connector_indexing", "connector_deletion", "document_processing", "page_limit_exceeded"),
+ "status": (
+ "connector_indexing",
+ "connector_deletion",
+ "document_processing",
+ "page_limit_exceeded",
+ ),
}
@@ -152,7 +161,10 @@ async def get_notification_source_types(
document_result = await session.execute(document_query)
sources = []
- for source_type, category, count in [*connector_result.all(), *document_result.all()]:
+ for source_type, category, count in [
+ *connector_result.all(),
+ *document_result.all(),
+ ]:
if not source_type:
continue
sources.append(
@@ -300,24 +312,20 @@ async def list_notifications(
# Filter by source type (connector or document type from JSONB metadata)
if source_type:
if source_type.startswith("connector:"):
- connector_val = source_type[len("connector:"):]
- source_filter = (
- Notification.type.in_(("connector_indexing", "connector_deletion"))
- & (
- Notification.notification_metadata["connector_type"].astext
- == connector_val
- )
+ connector_val = source_type[len("connector:") :]
+ source_filter = Notification.type.in_(
+ ("connector_indexing", "connector_deletion")
+ ) & (
+ Notification.notification_metadata["connector_type"].astext
+ == connector_val
)
query = query.where(source_filter)
count_query = count_query.where(source_filter)
elif source_type.startswith("doctype:"):
- doctype_val = source_type[len("doctype:"):]
- source_filter = (
- Notification.type.in_(("document_processing",))
- & (
- Notification.notification_metadata["document_type"].astext
- == doctype_val
- )
+ doctype_val = source_type[len("doctype:") :]
+ source_filter = Notification.type.in_(("document_processing",)) & (
+ Notification.notification_metadata["document_type"].astext
+ == doctype_val
)
query = query.where(source_filter)
count_query = count_query.where(source_filter)
@@ -328,11 +336,8 @@ async def list_notifications(
query = query.where(unread_filter)
count_query = count_query.where(unread_filter)
elif filter == "errors":
- error_filter = (
- (Notification.type == "page_limit_exceeded")
- | (
- Notification.notification_metadata["status"].astext == "failed"
- )
+ error_filter = (Notification.type == "page_limit_exceeded") | (
+ Notification.notification_metadata["status"].astext == "failed"
)
query = query.where(error_filter)
count_query = count_query.where(error_filter)
diff --git a/surfsense_web/app/dashboard/[search_space_id]/client-layout.tsx b/surfsense_web/app/dashboard/[search_space_id]/client-layout.tsx
index bf9bad321..25e4e990b 100644
--- a/surfsense_web/app/dashboard/[search_space_id]/client-layout.tsx
+++ b/surfsense_web/app/dashboard/[search_space_id]/client-layout.tsx
@@ -186,9 +186,7 @@ export function DashboardClientLayout({
return (
-
- {children}
-
+ {children}
);
}
diff --git a/surfsense_web/app/dashboard/[search_space_id]/documents/(manage)/components/DocumentsFilters.tsx b/surfsense_web/app/dashboard/[search_space_id]/documents/(manage)/components/DocumentsFilters.tsx
index 6743adc42..f75e1d727 100644
--- a/surfsense_web/app/dashboard/[search_space_id]/documents/(manage)/components/DocumentsFilters.tsx
+++ b/surfsense_web/app/dashboard/[search_space_id]/documents/(manage)/components/DocumentsFilters.tsx
@@ -58,9 +58,7 @@ export function DocumentsFilters({
}, [typeCountsRecord]);
return (
-
+
{/* Type Filter */}
@@ -81,15 +79,15 @@ export function DocumentsFilters({
{/* Search input */}
-
-
-
-
setTypeSearchQuery(e.target.value)}
- className="h-6 pl-6 text-sm bg-transparent border-0 shadow-none focus-visible:ring-0"
- />
+
@@ -139,11 +137,11 @@ export function DocumentsFilters({
)}
{activeTypes.length > 0 && (
-
-