From 4066cbc6f0b65cfb9f0fce62b7849498cbe1c823 Mon Sep 17 00:00:00 2001 From: SohamBhattacharjee2003 <125297948+SohamBhattacharjee2003@users.noreply.github.com> Date: Wed, 8 Apr 2026 04:39:39 +0530 Subject: [PATCH] fix: remove unnecessary 'use client' directives to reduce client bundle - Remove 'use client' from connector-document-mapping.ts (only exports constants and pure functions) - Remove 'use client' from sidebar-separator.tsx (purely presentational component) - Remove 'use client' and Framer Motion from logs/loading.tsx, replace with Tailwind animations - Reduces client bundle size by moving server-compatible code to server components --- .../[search_space_id]/logs/loading.tsx | 64 ++++--------------- surfsense_web/app/docs/sidebar-separator.tsx | 2 - .../utils/connector-document-mapping.ts | 2 - 3 files changed, 14 insertions(+), 54 deletions(-) diff --git a/surfsense_web/app/dashboard/[search_space_id]/logs/loading.tsx b/surfsense_web/app/dashboard/[search_space_id]/logs/loading.tsx index 961ca468e..e8ea64890 100644 --- a/surfsense_web/app/dashboard/[search_space_id]/logs/loading.tsx +++ b/surfsense_web/app/dashboard/[search_space_id]/logs/loading.tsx @@ -1,22 +1,10 @@ -"use client"; - -import { motion } from "motion/react"; import { Skeleton } from "@/components/ui/skeleton"; export default function Loading() { return ( - +
{/* Summary Dashboard Skeleton */} - +
{[...Array(4)].map((_, i) => (
@@ -29,44 +17,29 @@ export default function Loading() {
))} - +
{/* Header Section Skeleton */} - +
- +
{/* Filters Skeleton */} - +
- +
{/* Table Skeleton */} - +
{/* Table Header */}
@@ -99,27 +72,18 @@ export default function Loading() {
))} - +
{/* Pagination Skeleton */}
- +
- +
- +
- +
@@ -128,6 +92,6 @@ export default function Loading() {
-
+
); } diff --git a/surfsense_web/app/docs/sidebar-separator.tsx b/surfsense_web/app/docs/sidebar-separator.tsx index 36fff09a4..ceb56b160 100644 --- a/surfsense_web/app/docs/sidebar-separator.tsx +++ b/surfsense_web/app/docs/sidebar-separator.tsx @@ -1,5 +1,3 @@ -"use client"; - import type { Separator } from "fumadocs-core/page-tree"; export function SidebarSeparator({ item }: { item: Separator }) { diff --git a/surfsense_web/components/assistant-ui/connector-popup/utils/connector-document-mapping.ts b/surfsense_web/components/assistant-ui/connector-popup/utils/connector-document-mapping.ts index f924bb15f..d194fd0ed 100644 --- a/surfsense_web/components/assistant-ui/connector-popup/utils/connector-document-mapping.ts +++ b/surfsense_web/components/assistant-ui/connector-popup/utils/connector-document-mapping.ts @@ -1,5 +1,3 @@ -"use client"; - /** * Maps SearchSourceConnectorType to DocumentType for fetching document counts *