@@ -2,8 +2,16 @@ import { AnimatePresence, motion } from "framer-motion";
22import { Suspense , lazy , useCallback , useEffect , useRef , useState } from "react" ;
33import { AISparkleIcon } from "~/assets/icons/AISparkleIcon" ;
44
5- // Lazy load streamdown to avoid SSR issues
6- const Streamdown = lazy ( ( ) => import ( "streamdown" ) . then ( ( mod ) => ( { default : mod . Streamdown } ) ) ) ;
5+ // Lazy load streamdown components to avoid SSR issues
6+ const StreamdownRenderer = lazy ( ( ) =>
7+ import ( "streamdown" ) . then ( ( mod ) => ( {
8+ default : ( { children, isAnimating } : { children : string ; isAnimating : boolean } ) => (
9+ < mod . ShikiThemeContext . Provider value = { [ "one-dark-pro" , "one-dark-pro" ] } >
10+ < mod . Streamdown isAnimating = { isAnimating } > { children } </ mod . Streamdown >
11+ </ mod . ShikiThemeContext . Provider >
12+ ) ,
13+ } ) )
14+ ) ;
715import { Button } from "~/components/primitives/Buttons" ;
816import { Spinner } from "~/components/primitives/Spinner" ;
917import { useEnvironment } from "~/hooks/useEnvironment" ;
@@ -137,7 +145,7 @@ export function AIQueryInput({ onQueryGenerated, autoSubmitPrompt }: AIQueryInpu
137145 setThinking ( ( prev ) => prev + event . content ) ;
138146 break ;
139147 case "tool_call" :
140- setThinking ( ( prev ) => prev + `\n[Validating query...] \n` ) ;
148+ setThinking ( ( prev ) => prev + `\nValidating query...\n` ) ;
141149 break ;
142150 case "tool_result" :
143151 // Optionally show validation result
@@ -319,9 +327,9 @@ export function AIQueryInput({ onQueryGenerated, autoSubmitPrompt }: AIQueryInpu
319327 </ Button >
320328 ) }
321329 </ div >
322- < div className = "streamdown-container max-h-48 overflow-y-auto text-xs text-text-dimmed scrollbar-thin scrollbar-track-transparent scrollbar-thumb-charcoal-600" >
330+ < div className = "streamdown-container max-h-96 overflow-y-auto text-xs text-text-dimmed scrollbar-thin scrollbar-track-transparent scrollbar-thumb-charcoal-600" >
323331 < Suspense fallback = { < p className = "whitespace-pre-wrap" > { thinking } </ p > } >
324- < Streamdown isAnimating = { isLoading } > { thinking } </ Streamdown >
332+ < StreamdownRenderer isAnimating = { isLoading } > { thinking } </ StreamdownRenderer >
325333 </ Suspense >
326334 </ div >
327335 </ div >
0 commit comments