File tree Expand file tree Collapse file tree 1 file changed +10
-3
lines changed
apps/webapp/app/components/runs/v3/ai Expand file tree Collapse file tree 1 file changed +10
-3
lines changed Original file line number Diff line number Diff line change @@ -65,6 +65,7 @@ function SystemSection({ text }: { text: string }) {
6565 const [ expanded , setExpanded ] = useState ( false ) ;
6666 const isLong = text . length > 150 ;
6767 const preview = isLong ? text . slice ( 0 , 150 ) + "..." : text ;
68+ const displayText = expanded || ! isLong ? text : preview ;
6869
6970 return (
7071 < div className = "flex flex-col gap-1.5 py-2.5" >
@@ -82,8 +83,10 @@ function SystemSection({ text }: { text: string }) {
8283 }
8384 />
8485 < ChatBubble >
85- < Paragraph variant = "small/dimmed" className = "whitespace-pre-wrap" >
86- { expanded || ! isLong ? text : preview }
86+ < Paragraph variant = "small/dimmed" className = "streamdown-container" >
87+ < Suspense fallback = { < span className = "whitespace-pre-wrap" > { displayText } </ span > } >
88+ < StreamdownRenderer > { displayText } </ StreamdownRenderer >
89+ </ Suspense >
8790 </ Paragraph >
8891 </ ChatBubble >
8992 </ div >
@@ -99,7 +102,11 @@ function UserSection({ text }: { text: string }) {
99102 < div className = "flex flex-col gap-1.5 py-2.5" >
100103 < SectionHeader label = "User" />
101104 < ChatBubble >
102- < Paragraph variant = "small/dimmed" > { text } </ Paragraph >
105+ < Paragraph variant = "small/dimmed" className = "streamdown-container" >
106+ < Suspense fallback = { < span className = "whitespace-pre-wrap" > { text } </ span > } >
107+ < StreamdownRenderer > { text } </ StreamdownRenderer >
108+ </ Suspense >
109+ </ Paragraph >
103110 </ ChatBubble >
104111 </ div >
105112 ) ;
You can’t perform that action at this time.
0 commit comments