- {(chats.length > 0 || sharedChats.length > 0) && (
-
-
-
-
-
- {t("chats")} ({chats.length + sharedChats.length})
-
-
+ {/* Chat sections - fills available space */}
+ {isCollapsed ? (
+
+ {(chats.length > 0 || sharedChats.length > 0) && (
+
+
+
+
+
+ {t("chats")} ({chats.length + sharedChats.length})
+
+
+ )}
+
+ ) : (
+
+ {/* Shared Chats Section - takes half the space */}
+
+
+
+
+
+ {t("view_all_shared_chats") || "View all shared chats"}
+
+
+ ) : undefined
+ }
+ >
+ {sharedChats.length > 0 ? (
+
+
4 ? 'pb-8' : ''}`}>
+ {sharedChats.slice(0, 20).map((chat) => (
+ onChatSelect(chat)}
+ onArchive={() => onChatArchive?.(chat)}
+ onDelete={() => onChatDelete?.(chat)}
+ />
+ ))}
+
+ {/* Gradient fade indicator when more than 4 items */}
+ {sharedChats.length > 4 && (
+
+ )}
+
+ ) : (
+ {t("no_shared_chats")}
)}
-
- ) : (
-
- {/* Shared Chats Section */}
-
-
-
-
-
- {t("view_all_shared_chats") || "View all shared chats"}
-
-
- ) : undefined
- }
- >
- {sharedChats.length > 0 ? (
-
- {sharedChats.map((chat) => (
- onChatSelect(chat)}
- onArchive={() => onChatArchive?.(chat)}
- onDelete={() => onChatDelete?.(chat)}
- />
- ))}
-
- ) : (
- {t("no_shared_chats")}
- )}
-
+
- {/* Private Chats Section */}
-
-
-
-
-
- {t("view_all_private_chats") || "View all private chats"}
-
-
- ) : undefined
- }
- >
- {chats.length > 0 ? (
-
- {chats.map((chat) => (
+ {/* Private Chats Section - takes half the space */}
+
+
+
+
+
+ {t("view_all_private_chats") || "View all private chats"}
+
+
+ ) : undefined
+ }
+ >
+ {chats.length > 0 ? (
+
+
4 ? 'pb-8' : ''}`}>
+ {chats.slice(0, 20).map((chat) => (
))}
- ) : (
-
{t("no_chats")}
- )}
-
-
- )}
-
+ {/* Gradient fade indicator when more than 4 items */}
+ {chats.length > 4 && (
+
+ )}
+
+ ) : (
+ {t("no_chats")}
+ )}
+
+
+ )}
{/* Footer */}
diff --git a/surfsense_web/components/layout/ui/sidebar/SidebarSection.tsx b/surfsense_web/components/layout/ui/sidebar/SidebarSection.tsx
index 0ceafc113..e296ed3d4 100644
--- a/surfsense_web/components/layout/ui/sidebar/SidebarSection.tsx
+++ b/surfsense_web/components/layout/ui/sidebar/SidebarSection.tsx
@@ -11,6 +11,8 @@ interface SidebarSectionProps {
children: React.ReactNode;
action?: React.ReactNode;
persistentAction?: React.ReactNode;
+ className?: string;
+ fillHeight?: boolean;
}
export function SidebarSection({
@@ -19,12 +21,22 @@ export function SidebarSection({
children,
action,
persistentAction,
+ className,
+ fillHeight = false,
}: SidebarSectionProps) {
const [isOpen, setIsOpen] = useState(defaultOpen);
return (
-
-
+
+
-
- {children}
+
+
+ {children}
+
);
From 3604a0bbf3ccfcdf9d6495b79e44c0654369e2eb Mon Sep 17 00:00:00 2001
From: Anish Sarkar <104695310+AnishSarkar22@users.noreply.github.com>
Date: Tue, 27 Jan 2026 16:34:35 +0530
Subject: [PATCH 3/3] chore: ran frontend linting
---
.../components/layout/ui/sidebar/Sidebar.tsx | 8 ++++--
.../layout/ui/sidebar/SidebarSection.tsx | 26 +++++++------------
2 files changed, 16 insertions(+), 18 deletions(-)
diff --git a/surfsense_web/components/layout/ui/sidebar/Sidebar.tsx b/surfsense_web/components/layout/ui/sidebar/Sidebar.tsx
index 6db23a5c5..4a587cd58 100644
--- a/surfsense_web/components/layout/ui/sidebar/Sidebar.tsx
+++ b/surfsense_web/components/layout/ui/sidebar/Sidebar.tsx
@@ -171,7 +171,9 @@ export function Sidebar({
>
{sharedChats.length > 0 ? (
-
4 ? 'pb-8' : ''}`}>
+
4 ? "pb-8" : ""}`}
+ >
{sharedChats.slice(0, 20).map((chat) => (
{chats.length > 0 ? (
-
4 ? 'pb-8' : ''}`}>
+
4 ? "pb-8" : ""}`}
+ >
{chats.slice(0, 20).map((chat) => (
@@ -60,14 +56,12 @@ export function SidebarSection({
)}
-
-