diff --git a/surfsense_web/components/layout/providers/LayoutDataProvider.tsx b/surfsense_web/components/layout/providers/LayoutDataProvider.tsx index 901e9a8ab..639965d38 100644 --- a/surfsense_web/components/layout/providers/LayoutDataProvider.tsx +++ b/surfsense_web/components/layout/providers/LayoutDataProvider.tsx @@ -118,10 +118,10 @@ export function LayoutDataProvider({ workspaceId, children }: LayoutDataProvider enabled: !!workspaceId, }); - // Fetch threads (40 total to allow up to 20 per section - shared/private) + // Fetch recent threads for the sidebar. const { data: threadsData, isPending: isLoadingThreads } = useQuery({ - queryKey: ["threads", workspaceId, { limit: 40 }], - queryFn: () => fetchThreads(Number(workspaceId), 40), + queryKey: ["threads", workspaceId, { limit: 6 }], + queryFn: () => fetchThreads(Number(workspaceId), 6), enabled: !!workspaceId, }); diff --git a/surfsense_web/components/layout/ui/sidebar/AllChatsSidebar.tsx b/surfsense_web/components/layout/ui/sidebar/AllChatsSidebar.tsx index c02fd31ef..3063a9c50 100644 --- a/surfsense_web/components/layout/ui/sidebar/AllChatsSidebar.tsx +++ b/surfsense_web/components/layout/ui/sidebar/AllChatsSidebar.tsx @@ -99,7 +99,7 @@ function AllChatsContent({ workspaceId, className }: AllChatsContentProps) { queryKey: ["all-threads", workspaceId], queryFn: () => fetchThreads(Number(workspaceId)), enabled: !!workspaceId && !isSearchMode, - placeholderData: () => queryClient.getQueryData(["threads", workspaceId, { limit: 40 }]), + placeholderData: () => queryClient.getQueryData(["threads", workspaceId, { limit: 6 }]), }); const { diff --git a/surfsense_web/components/layout/ui/sidebar/ChatListItem.tsx b/surfsense_web/components/layout/ui/sidebar/ChatListItem.tsx index a027cfb9c..e39075443 100644 --- a/surfsense_web/components/layout/ui/sidebar/ChatListItem.tsx +++ b/surfsense_web/components/layout/ui/sidebar/ChatListItem.tsx @@ -19,7 +19,6 @@ import { sidebarListItemClassName } from "./SidebarListItem"; interface ChatListItemProps { name: string; isActive?: boolean; - isShared?: boolean; archived?: boolean; dropdownOpen?: boolean; onDropdownOpenChange?: (open: boolean) => void; diff --git a/surfsense_web/components/layout/ui/sidebar/Sidebar.tsx b/surfsense_web/components/layout/ui/sidebar/Sidebar.tsx index 5927b8e45..35746acf1 100644 --- a/surfsense_web/components/layout/ui/sidebar/Sidebar.tsx +++ b/surfsense_web/components/layout/ui/sidebar/Sidebar.tsx @@ -311,12 +311,11 @@ export function Sidebar({ ) : chats.length > 0 ? (