Merge pull request #1579 from AnishSarkar22/hotfix/ci-ui

fix: reduce thread fetch limit
This commit is contained in:
Anish Sarkar 2026-07-07 11:08:09 +05:30 committed by GitHub
commit 261ace58f9
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 7 additions and 9 deletions

View file

@ -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,
});

View file

@ -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 {

View file

@ -19,7 +19,6 @@ import { sidebarListItemClassName } from "./SidebarListItem";
interface ChatListItemProps {
name: string;
isActive?: boolean;
isShared?: boolean;
archived?: boolean;
dropdownOpen?: boolean;
onDropdownOpenChange?: (open: boolean) => void;

View file

@ -311,12 +311,11 @@ export function Sidebar({
) : chats.length > 0 ? (
<div className="relative">
<div className={`flex flex-col gap-0.5 ${chats.length > 4 ? "pb-2" : ""}`}>
{chats.slice(0, 20).map((chat) => (
{chats.slice(0, 6).map((chat) => (
<ChatListItem
key={chat.id}
name={chat.name}
isActive={chat.id === activeChatId}
isShared={chat.visibility === "SEARCH_SPACE"}
archived={chat.archived}
dropdownOpen={openDropdownChatId === chat.id}
onDropdownOpenChange={(open) =>

View file

@ -395,8 +395,8 @@ export function OnboardingTour() {
// Fetch threads data
const { data: threadsData } = useQuery({
queryKey: ["threads", workspaceId, { limit: 40 }], // Same key as layout
queryFn: () => fetchThreads(Number(workspaceId), 40),
queryKey: ["threads", workspaceId, { limit: 6 }], // Same key as layout
queryFn: () => fetchThreads(Number(workspaceId), 6),
enabled: !!workspaceId,
});