mirror of
https://github.com/khoaliber/khoj.git
synced 2026-03-02 21:19:12 +00:00
automatically open the side bar when a new chat is created with the default agent.
This commit is contained in:
@@ -49,7 +49,7 @@ interface ChatBodyDataProps {
|
||||
setImages: (images: string[]) => void;
|
||||
setTriggeredAbort: (triggeredAbort: boolean) => void;
|
||||
isChatSideBarOpen: boolean;
|
||||
onChatSideBarOpenChange: (open: boolean) => void;
|
||||
setIsChatSideBarOpen: (open: boolean) => void;
|
||||
}
|
||||
|
||||
function ChatBodyData(props: ChatBodyDataProps) {
|
||||
@@ -156,6 +156,7 @@ function ChatBodyData(props: ChatBodyDataProps) {
|
||||
incomingMessages={props.streamedMessages}
|
||||
setIncomingMessages={props.setStreamedMessages}
|
||||
customClassName={chatHistoryCustomClassName}
|
||||
setIsChatSideBarOpen={props.setIsChatSideBarOpen}
|
||||
/>
|
||||
</div>
|
||||
<div
|
||||
@@ -180,7 +181,7 @@ function ChatBodyData(props: ChatBodyDataProps) {
|
||||
<ChatSidebar
|
||||
conversationId={conversationId}
|
||||
isOpen={props.isChatSideBarOpen}
|
||||
onOpenChange={props.onChatSideBarOpenChange}
|
||||
onOpenChange={props.setIsChatSideBarOpen}
|
||||
isMobileWidth={props.isMobileWidth} />
|
||||
</div>
|
||||
);
|
||||
@@ -478,7 +479,7 @@ export default function Chat() {
|
||||
setImages={setImages}
|
||||
setTriggeredAbort={setTriggeredAbort}
|
||||
isChatSideBarOpen={isChatSideBarOpen}
|
||||
onChatSideBarOpenChange={setIsChatSideBarOpen}
|
||||
setIsChatSideBarOpen={setIsChatSideBarOpen}
|
||||
/>
|
||||
</Suspense>
|
||||
</div>
|
||||
|
||||
@@ -40,6 +40,7 @@ interface ChatHistoryProps {
|
||||
publicConversationSlug?: string;
|
||||
setAgent: (agent: AgentData) => void;
|
||||
customClassName?: string;
|
||||
setIsChatSideBarOpen?: (isOpen: boolean) => void;
|
||||
}
|
||||
|
||||
interface TrainOfThoughtComponentProps {
|
||||
@@ -149,6 +150,7 @@ export default function ChatHistory(props: ChatHistoryProps) {
|
||||
latestUserMessageRef.current?.scrollIntoView({ behavior: "auto", block: "start" });
|
||||
});
|
||||
}
|
||||
|
||||
}, [data, currentPage]);
|
||||
|
||||
useEffect(() => {
|
||||
@@ -251,6 +253,9 @@ export default function ChatHistory(props: ChatHistoryProps) {
|
||||
};
|
||||
props.setAgent(chatData.response.agent);
|
||||
setData(chatMetadata);
|
||||
if (props.setIsChatSideBarOpen) {
|
||||
props.setIsChatSideBarOpen(true);
|
||||
}
|
||||
}
|
||||
|
||||
setHasMoreMessages(false);
|
||||
|
||||
Reference in New Issue
Block a user