+
Thread History
-
- {threads.map((t) => {
- let itemText = t.thread_id;
- if (
- typeof t.values === "object" &&
- t.values &&
- "messages" in t.values &&
- Array.isArray(t.values.messages) &&
- t.values.messages?.length > 0
- ) {
- const firstMessage = t.values.messages[0];
- itemText = getContentString(firstMessage.content);
- }
- return (
-
-
-
- );
- })}
-
+
+
+
+
+ Thread History
+
+ setChatHistoryOpen((o) => !o)}
+ />
+
+
>
);
}
diff --git a/src/components/thread/index.tsx b/src/components/thread/index.tsx
index a6c49c1..2855368 100644
--- a/src/components/thread/index.tsx
+++ b/src/components/thread/index.tsx
@@ -14,8 +14,13 @@ import {
} from "@/lib/ensure-tool-responses";
import { LangGraphLogoSVG } from "../icons/langgraph";
import { TooltipIconButton } from "./tooltip-icon-button";
-import { ArrowDown, LoaderCircle, SquarePen } from "lucide-react";
-import { StringParam, useQueryParam } from "use-query-params";
+import {
+ ArrowDown,
+ LoaderCircle,
+ PanelRightOpen,
+ SquarePen,
+} from "lucide-react";
+import { BooleanParam, StringParam, useQueryParam } from "use-query-params";
import { StickToBottom, useStickToBottomContext } from "use-stick-to-bottom";
import ThreadHistory from "./history";
@@ -59,6 +64,10 @@ function ScrollToBottom(props: { className?: string }) {
export function Thread() {
const [threadId, setThreadId] = useQueryParam("threadId", StringParam);
+ const [_, setChatHistoryOpen] = useQueryParam(
+ "chatHistoryOpen",
+ BooleanParam,
+ );
const [input, setInput] = useState("");
const [firstTokenReceived, setFirstTokenReceived] = useState(false);
@@ -133,15 +142,24 @@ export function Thread() {
>
{threadId && (
-
+
+
+
+