From 68499e253bf44e6afa2c53517e8d1ff9918d516b Mon Sep 17 00:00:00 2001 From: sabaimran Date: Sun, 27 Oct 2024 15:48:13 -0700 Subject: [PATCH] Auto-collapse train of thought, show after chat response in history --- .../components/chatHistory/chatHistory.tsx | 69 ++++++++++--------- 1 file changed, 36 insertions(+), 33 deletions(-) diff --git a/src/interface/web/app/components/chatHistory/chatHistory.tsx b/src/interface/web/app/components/chatHistory/chatHistory.tsx index a373da34..870ec19c 100644 --- a/src/interface/web/app/components/chatHistory/chatHistory.tsx +++ b/src/interface/web/app/components/chatHistory/chatHistory.tsx @@ -54,29 +54,32 @@ function TrainOfThoughtComponent(props: TrainOfThoughtComponentProps) { const [collapsed, setCollapsed] = useState(props.completed); return ( -
+
{!props.completed && } - {collapsed ? ( - - ) : ( - - )} - + {props.completed && + (collapsed ? ( + + ) : ( + + ))} {!collapsed && props.trainOfThought.map((train, index) => ( ( <> - {chatMessage.trainOfThought && chatMessage.by === "khoj" && ( - train.data, - )} - lastMessage={false} - agentColor={data?.agent?.color || "orange"} - key={`${index}trainOfThought`} - completed={true} - /> - )} + {chatMessage.trainOfThought && chatMessage.by === "khoj" && ( + train.data, + )} + lastMessage={false} + agentColor={data?.agent?.color || "orange"} + key={`${index}trainOfThought`} + completed={true} + /> + )} ))} {props.incomingMessages &&