From 8dea0bbbccb986d6c3cdc669262a863a44f17221 Mon Sep 17 00:00:00 2001 From: pablonyx Date: Fri, 14 Mar 2025 15:48:38 -0700 Subject: [PATCH] fix build --- backend/onyx/db/persona.py | 2 -- web/src/app/search/SearchPage.tsx | 54 ++++++++-------------------- web/src/app/search/WrappedSearch.tsx | 6 +--- 3 files changed, 16 insertions(+), 46 deletions(-) diff --git a/backend/onyx/db/persona.py b/backend/onyx/db/persona.py index 9d32d9d06..43dc9245e 100644 --- a/backend/onyx/db/persona.py +++ b/backend/onyx/db/persona.py @@ -585,8 +585,6 @@ def upsert_persona( existing_persona.user_folders.clear() existing_persona.user_folders = user_folders or [] - print("user_folder_ids", user_folder_ids) - print("user_folders", user_folders) # We should only update display priority if it is not already set if existing_persona.display_priority is None: existing_persona.display_priority = display_priority diff --git a/web/src/app/search/SearchPage.tsx b/web/src/app/search/SearchPage.tsx index 62e018214..3f3da5256 100644 --- a/web/src/app/search/SearchPage.tsx +++ b/web/src/app/search/SearchPage.tsx @@ -7,23 +7,9 @@ import { useSearchParams, } from "next/navigation"; import { - BackendChatSession, - BackendMessage, - BUFFER_COUNT, ChatFileType, - ChatSession, ChatSessionSharedStatus, - FileDescriptor, - FileChatDisplay, Message, - MessageResponseIDInfo, - RetrievalType, - StreamingError, - ToolCallMetadata, - SubQuestionDetail, - constructSubQuestions, - DocumentsResponse, - AgenticMessageResponseIDInfo, } from "@/app/chat/interfaces"; import Prism from "prismjs"; @@ -43,29 +29,20 @@ import { import { Dispatch, SetStateAction, - use, - useCallback, useContext, useEffect, - useLayoutEffect, useMemo, useRef, useState, } from "react"; import { usePopup } from "@/components/admin/connectors/Popup"; -import { - SEARCH_PARAM_NAMES, - shouldSubmitOnLoad, -} from "@/app/chat/searchParams"; -import { LlmDescriptor, useFilters, useLlmManager } from "@/lib/hooks"; +import { SEARCH_PARAM_NAMES } from "@/app/chat/searchParams"; +import { useFilters, useLlmManager } from "@/lib/hooks"; import { ChatState, FeedbackType, RegenerationState } from "@/app/chat/types"; import { OnyxDocument } from "@/lib/search/interfaces"; import { SettingsContext } from "@/components/settings/SettingsProvider"; -import { ChatInputBar } from "@/app/chat/input/ChatInputBar"; import { useChatContext } from "@/components/context/ChatContext"; -import { v4 as uuidv4 } from "uuid"; import { ChatPopup } from "@/app/chat/ChatPopup"; -import FunctionalHeader from "@/components/chat/Header"; import { useSidebarVisibility } from "@/components/chat/hooks"; import { PRO_SEARCH_TOGGLED_COOKIE_NAME, @@ -223,7 +200,7 @@ export default function SearchPage({ ); toggle(false); } - }, [user]); + }, [user, sidebarVisible, toggle]); const chatSessionIdRef = useRef(existingChatSessionId); @@ -642,7 +619,7 @@ export default function SearchPage({ "*" ); } - }, [submittedMessage, currentSessionChatState]); + }, [submittedMessage, currentSessionChatState, messageHistory.length]); // just choose a conservative default, this will be updated in the // background on initial load / on persona change const [maxTokens, setMaxTokens] = useState(4096); @@ -985,18 +962,6 @@ export default function SearchPage({ useSidebarShortcut(router, toggleSidebar); - if (!user) { - redirect("/auth/login"); - } - - if (noAssistants) - return ( - <> - - - - ); - // New state for search UI const [searchQuery, setSearchQuery] = useState(""); const [isSearching, setIsSearching] = useState(false); @@ -1092,6 +1057,17 @@ export default function SearchPage({ document.querySelector(".search-results-container")?.scrollTo(0, 0); }; + if (!user) { + redirect("/auth/login"); + } + + if (noAssistants) + return ( + <> + + + + ); return ( <> diff --git a/web/src/app/search/WrappedSearch.tsx b/web/src/app/search/WrappedSearch.tsx index 36f15fd49..72047cefa 100644 --- a/web/src/app/search/WrappedSearch.tsx +++ b/web/src/app/search/WrappedSearch.tsx @@ -14,11 +14,7 @@ export default function WrappedSearch({ return ( ( - + )} /> );