From ed6470525a5db427a27ee0fb2431cc7d3e1b350f Mon Sep 17 00:00:00 2001
From: Anish Sarkar <104695310+AnishSarkar22@users.noreply.github.com>
Date: Mon, 29 Dec 2025 00:24:49 +0530
Subject: [PATCH] feat: Enhance mobile navbar animations and responsiveness
across various components
---
.../components/DocumentsTableShell.tsx | 10 +-
.../components/ProcessingIndicator.tsx | 4 +-
.../documents/(manage)/page.tsx | 9 +-
.../editor/[documentId]/page.tsx | 46 +++--
.../[search_space_id]/sources/add/page.tsx | 4 +-
.../dashboard/[search_space_id]/team/page.tsx | 28 ++-
surfsense_web/app/dashboard/page.tsx | 13 +-
surfsense_web/app/globals.css | 1 +
surfsense_web/components/BlockNoteEditor.tsx | 49 +++++-
surfsense_web/components/UserDropdown.tsx | 9 +-
surfsense_web/components/homepage/navbar.tsx | 165 +++++++++---------
.../components/json-metadata-viewer.tsx | 8 +-
.../new-chat/document-mention-picker.tsx | 2 +-
.../components/new-chat/model-selector.tsx | 5 +-
.../components/shared/llm-config-form.tsx | 14 +-
.../components/sidebar/all-chats-sidebar.tsx | 7 +-
.../components/sources/DocumentUploadTab.tsx | 4 +-
17 files changed, 245 insertions(+), 133 deletions(-)
diff --git a/surfsense_web/app/dashboard/[search_space_id]/documents/(manage)/components/DocumentsTableShell.tsx b/surfsense_web/app/dashboard/[search_space_id]/documents/(manage)/components/DocumentsTableShell.tsx
index c437b6cee..11e862944 100644
--- a/surfsense_web/app/dashboard/[search_space_id]/documents/(manage)/components/DocumentsTableShell.tsx
+++ b/surfsense_web/app/dashboard/[search_space_id]/documents/(manage)/components/DocumentsTableShell.tsx
@@ -83,8 +83,14 @@ export function DocumentsTableShell({
const toggleAll = (checked: boolean) => {
const next = new Set(selectedIds);
- if (checked) sorted.forEach((d) => { next.add(d.id); });
- else sorted.forEach((d) => { next.delete(d.id); });
+ if (checked)
+ sorted.forEach((d) => {
+ next.add(d.id);
+ });
+ else
+ sorted.forEach((d) => {
+ next.delete(d.id);
+ });
setSelectedIds(next);
};
diff --git a/surfsense_web/app/dashboard/[search_space_id]/documents/(manage)/components/ProcessingIndicator.tsx b/surfsense_web/app/dashboard/[search_space_id]/documents/(manage)/components/ProcessingIndicator.tsx
index cf7692a41..4ee966e1e 100644
--- a/surfsense_web/app/dashboard/[search_space_id]/documents/(manage)/components/ProcessingIndicator.tsx
+++ b/surfsense_web/app/dashboard/[search_space_id]/documents/(manage)/components/ProcessingIndicator.tsx
@@ -9,9 +9,7 @@ interface ProcessingIndicatorProps {
documentProcessorTasksCount: number;
}
-export function ProcessingIndicator({
- documentProcessorTasksCount
-}: ProcessingIndicatorProps) {
+export function ProcessingIndicator({ documentProcessorTasksCount }: ProcessingIndicatorProps) {
const t = useTranslations("documents");
// Only show when there are document_processor tasks (uploads), not connector_indexing_task (periodic reindexing)
diff --git a/surfsense_web/app/dashboard/[search_space_id]/documents/(manage)/page.tsx b/surfsense_web/app/dashboard/[search_space_id]/documents/(manage)/page.tsx
index 457a81a6f..e0b566d3d 100644
--- a/surfsense_web/app/dashboard/[search_space_id]/documents/(manage)/page.tsx
+++ b/surfsense_web/app/dashboard/[search_space_id]/documents/(manage)/page.tsx
@@ -136,14 +136,13 @@ export default function DocumentsTable() {
// Set up polling for active tasks
const { summary } = useLogsSummary(searchSpaceId, 24, { refetchInterval: 5000 });
-
+
// Filter active tasks to only include document_processor tasks (uploads via "add sources")
// Exclude connector_indexing_task tasks (periodic reindexing)
- const documentProcessorTasks = summary?.active_tasks.filter(
- task => task.source === "document_processor"
- ) || [];
+ const documentProcessorTasks =
+ summary?.active_tasks.filter((task) => task.source === "document_processor") || [];
const documentProcessorTasksCount = documentProcessorTasks.length;
-
+
const activeTasksCount = summary?.active_tasks.length || 0;
const prevActiveTasksCount = useRef(activeTasksCount);
diff --git a/surfsense_web/app/dashboard/[search_space_id]/editor/[documentId]/page.tsx b/surfsense_web/app/dashboard/[search_space_id]/editor/[documentId]/page.tsx
index 1f51d9975..239fdc5c1 100644
--- a/surfsense_web/app/dashboard/[search_space_id]/editor/[documentId]/page.tsx
+++ b/surfsense_web/app/dashboard/[search_space_id]/editor/[documentId]/page.tsx
@@ -21,7 +21,6 @@ import {
} from "@/components/ui/alert-dialog";
import { Button } from "@/components/ui/button";
import { Card, CardContent, CardDescription, CardHeader, CardTitle } from "@/components/ui/card";
-import { Separator } from "@/components/ui/separator";
import { notesApiService } from "@/lib/apis/notes-api.service";
import { authenticatedFetch, getBearerToken, redirectToLogin } from "@/lib/auth-utils";
@@ -130,7 +129,7 @@ export default function EditorPage() {
setError(null);
setHasUnsavedChanges(false);
setLoading(true);
- }, [documentId]);
+ }, []);
// Fetch document content - DIRECT CALL TO FASTAPI
// Skip fetching if this is a new note
@@ -427,30 +426,43 @@ export default function EditorPage() {
className="flex flex-col min-h-screen w-full"
>
{/* Toolbar */}
-
-
-
+
+
+
-
{displayTitle}
- {hasUnsavedChanges &&
Unsaved changes
}
+
{displayTitle}
+ {hasUnsavedChanges && (
+
Unsaved changes
+ )}
-
+
-
-
{/* Summary Cards */}
@@ -418,21 +422,30 @@ export default function TeamManagementPage() {
-
+
Members
{members.length}
-
+
Roles
{roles.length}
-
+
Invites
@@ -637,7 +650,10 @@ function MembersTab({
) : (
-
+
{member.role?.name || "No role"}
diff --git a/surfsense_web/app/dashboard/page.tsx b/surfsense_web/app/dashboard/page.tsx
index 77a74a7e7..e241428d1 100644
--- a/surfsense_web/app/dashboard/page.tsx
+++ b/surfsense_web/app/dashboard/page.tsx
@@ -295,7 +295,10 @@ const DashboardPage = () => {
{space.name}
{!space.is_owner && (
-
+
{t("shared")}
)}
@@ -333,7 +336,9 @@ const DashboardPage = () => {
{t("no_spaces_found")}
- {t("create_first_space")}
+
+ {t("create_first_space")}
+
@@ -358,7 +363,9 @@ const DashboardPage = () => {
-
{t("add_new_search_space")}
+
+ {t("add_new_search_space")}
+
diff --git a/surfsense_web/app/globals.css b/surfsense_web/app/globals.css
index 4f4ab6de1..c78c074fb 100644
--- a/surfsense_web/app/globals.css
+++ b/surfsense_web/app/globals.css
@@ -159,3 +159,4 @@ button {
@source '../node_modules/@llamaindex/chat-ui/**/*.{ts,tsx}';
@source '../node_modules/streamdown/dist/*.js';
+
diff --git a/surfsense_web/components/BlockNoteEditor.tsx b/surfsense_web/components/BlockNoteEditor.tsx
index dc033bc5a..440c63625 100644
--- a/surfsense_web/components/BlockNoteEditor.tsx
+++ b/surfsense_web/components/BlockNoteEditor.tsx
@@ -162,5 +162,52 @@ export default function BlockNoteEditor({
}, [resolvedTheme]);
// Renders the editor instance
- return ;
+ return (
+
+
+
+
+ );
}
diff --git a/surfsense_web/components/UserDropdown.tsx b/surfsense_web/components/UserDropdown.tsx
index baa939d8b..ffdb9a31b 100644
--- a/surfsense_web/components/UserDropdown.tsx
+++ b/surfsense_web/components/UserDropdown.tsx
@@ -55,12 +55,17 @@ export function UserDropdown({
{user.name}
-
{user.email}
+
+ {user.email}
+
- router.push(`/dashboard/api-key`)} className="text-xs md:text-sm">
+ router.push(`/dashboard/api-key`)}
+ className="text-xs md:text-sm"
+ >
API Key
diff --git a/surfsense_web/components/homepage/navbar.tsx b/surfsense_web/components/homepage/navbar.tsx
index 8d5b63f7b..0b060e548 100644
--- a/surfsense_web/components/homepage/navbar.tsx
+++ b/surfsense_web/components/homepage/navbar.tsx
@@ -2,7 +2,7 @@
import { IconBrandDiscord, IconBrandGithub, IconMenu2, IconX } from "@tabler/icons-react";
import { AnimatePresence, motion } from "motion/react";
import Link from "next/link";
-import React, { useEffect, useState } from "react";
+import { useEffect, useState } from "react";
import { Logo } from "@/components/Logo";
import { ThemeTogglerComponent } from "@/components/theme/theme-toggle";
import { useGithubStars } from "@/hooks/use-github-stars";
@@ -118,89 +118,88 @@ const MobileNav = ({ navItems, isScrolled }: any) => {
const { compactFormat: githubStars, loading: loadingGithubStars } = useGithubStars();
return (
- <>
-
-
-
-
- SurfSense
-
-
setOpen(!open)}
- className="relative z-50 flex items-center justify-center p-2 -mr-2 rounded-lg hover:bg-gray-100 dark:hover:bg-neutral-800 transition-colors touch-manipulation"
- aria-label={open ? "Close menu" : "Open menu"}
- >
- {open ? (
-
- ) : (
-
- )}
-
+
+
+
+
+ SurfSense
-
-
- {open && (
-
- {navItems.map((navItem: any, idx: number) => (
-
- {navItem.name}
-
- ))}
-
-
-
-
-
-
- {loadingGithubStars ? (
-
- ) : (
-
- {githubStars}
-
- )}
-
-
-
-
- Sign In
-
-
+ setOpen(!open)}
+ className="relative z-50 flex items-center justify-center p-2 -mr-2 rounded-lg hover:bg-gray-100 dark:hover:bg-neutral-800 transition-colors touch-manipulation"
+ aria-label={open ? "Close menu" : "Open menu"}
+ >
+ {open ? (
+
+ ) : (
+
)}
-
-
- >
+
+
+
+
+ {open && (
+
+ {navItems.map((navItem: any, idx: number) => (
+
+ {navItem.name}
+
+ ))}
+
+
+
+
+
+
+ {loadingGithubStars ? (
+
+ ) : (
+
+ {githubStars}
+
+ )}
+
+
+
+
+ Sign In
+
+
+ )}
+
+
);
};
diff --git a/surfsense_web/components/json-metadata-viewer.tsx b/surfsense_web/components/json-metadata-viewer.tsx
index 338c0273b..982d16786 100644
--- a/surfsense_web/components/json-metadata-viewer.tsx
+++ b/surfsense_web/components/json-metadata-viewer.tsx
@@ -49,7 +49,9 @@ export function JsonMetadataViewer({