Skip to content

Commit 6025daa

Browse files
committed
cr
1 parent 2be5034 commit 6025daa

File tree

4 files changed

+25
-27
lines changed

4 files changed

+25
-27
lines changed

โ€Žsrc/components/thread/agent-inbox/components/state-view.tsxโ€Ž

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,13 @@ export function StateView({
244244
}
245245

246246
return (
247-
<div className="overflow-y-auto pl-6 border-t-[1px] lg:border-t-[0px] lg:border-l-[1px] border-gray-100 flex flex-row gap-0 w-full">
247+
<div
248+
className={cn(
249+
"flex flex-row gap-0 w-full",
250+
view === "state" &&
251+
"border-t-[1px] lg:border-t-[0px] lg:border-l-[1px] border-gray-100 ",
252+
)}
253+
>
248254
{view === "description" && (
249255
<div className="pt-6 pb-2">
250256
<MarkdownText>
@@ -253,7 +259,7 @@ export function StateView({
253259
</div>
254260
)}
255261
{view === "state" && (
256-
<div className="flex flex-col items-start justify-start gap-1 pt-6 pb-2">
262+
<div className="flex flex-col items-start justify-start gap-1">
257263
{Object.entries(values).map(([k, v], idx) => (
258264
<StateViewObject
259265
expanded={expanded}
@@ -264,7 +270,7 @@ export function StateView({
264270
))}
265271
</div>
266272
)}
267-
<div className="flex gap-2 items-start justify-end pt-6 pr-6">
273+
<div className="flex gap-2 items-start justify-end">
268274
{view === "state" && (
269275
<Button
270276
onClick={() => setExpanded((prev) => !prev)}

โ€Žsrc/components/thread/agent-inbox/components/thread-actions-view.tsxโ€Ž

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ export function ThreadActionsView({
102102
const actionsDisabled = loading || streaming;
103103

104104
return (
105-
<div className="flex flex-col min-h-full w-full p-12 gap-9">
105+
<div className="flex flex-col min-h-full w-full gap-9">
106106
{/* Header */}
107107
<div className="flex flex-wrap items-center justify-between w-full gap-3">
108108
<div className="flex items-center justify-start gap-3">
Lines changed: 11 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import { StateView } from "./components/state-view";
22
import { ThreadActionsView } from "./components/thread-actions-view";
33
import { useState } from "react";
4-
import { cn } from "@/lib/utils";
54
import { HumanInterrupt } from "@langchain/langgraph/prebuilt";
65
import { useStreamContext } from "@/providers/Stream";
76

@@ -11,7 +10,7 @@ interface ThreadViewProps {
1110

1211
export function ThreadView({ interrupt }: ThreadViewProps) {
1312
const thread = useStreamContext();
14-
const [showDescription, setShowDescription] = useState(true);
13+
const [showDescription, setShowDescription] = useState(false);
1514
const [showState, setShowState] = useState(false);
1615
const showSidePanel = showDescription || showState;
1716

@@ -36,33 +35,22 @@ export function ThreadView({ interrupt }: ThreadViewProps) {
3635
};
3736

3837
return (
39-
<div className="flex flex-col lg:flex-row w-full h-[750px] border-[1px] border-slate-200 rounded-2xl pb-4">
40-
<div
41-
className={cn(
42-
"flex overflow-y-auto",
43-
showSidePanel ? "lg:min-w-1/2 w-full" : "w-full",
44-
)}
45-
>
46-
<ThreadActionsView
47-
interrupt={interrupt}
48-
handleShowSidePanel={handleShowSidePanel}
49-
showState={showState}
50-
showDescription={showDescription}
51-
/>
52-
</div>
53-
<div
54-
className={cn(
55-
showSidePanel ? "flex" : "hidden",
56-
"overflow-y-auto lg:max-w-1/2 w-full",
57-
)}
58-
>
38+
<div className="flex flex-col lg:flex-row w-full h-[80vh] p-8 bg-gray-50/50 rounded-2xl overflow-y-scroll [&::-webkit-scrollbar]:w-1.5 [&::-webkit-scrollbar-thumb]:rounded-full [&::-webkit-scrollbar-thumb]:bg-gray-300 [&::-webkit-scrollbar-track]:bg-transparent">
39+
{showSidePanel ? (
5940
<StateView
6041
handleShowSidePanel={handleShowSidePanel}
6142
description={interrupt.description}
6243
values={thread.values}
6344
view={showState ? "state" : "description"}
6445
/>
65-
</div>
46+
) : (
47+
<ThreadActionsView
48+
interrupt={interrupt}
49+
handleShowSidePanel={handleShowSidePanel}
50+
showState={showState}
51+
showDescription={showDescription}
52+
/>
53+
)}
6654
</div>
6755
);
6856
}

โ€Žtailwind.config.jsโ€Ž

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,10 @@ module.exports = {
1313
md: "calc(var(--radius) - 2px)",
1414
sm: "calc(var(--radius) - 4px)",
1515
},
16+
components: {
17+
".scrollbar-pretty":
18+
"overflow-y-scroll [&::-webkit-scrollbar]:w-1.5 [&::-webkit-scrollbar-thumb]:rounded-full [&::-webkit-scrollbar-thumb]:bg-gray-300 [&::-webkit-scrollbar-track]:bg-transparent",
19+
},
1620
colors: {
1721
background: "hsl(var(--background))",
1822
foreground: "hsl(var(--foreground))",

0 commit comments

Comments
ย (0)