@@ -145,8 +145,8 @@ const SmoothStreamingText = memo(
145145 } , [ content , isStreaming ] )
146146
147147 return (
148- < div className = 'relative' style = { { minHeight : '1.25rem' } } >
149- < div className = 'space-y-4 break-words font-geist-sans text-[#0D0D0D] text-base leading-relaxed dark:text-gray-100' >
148+ < div className = 'relative max-w-full overflow-hidden ' style = { { minHeight : '1.25rem' } } >
149+ < div className = 'max-w-full space-y-4 break-words font-geist-sans text-[#0D0D0D] text-base leading-relaxed dark:text-gray-100' >
150150 < ReactMarkdown remarkPlugins = { [ remarkGfm ] } components = { markdownComponents } >
151151 { displayedContent }
152152 </ ReactMarkdown >
@@ -374,7 +374,7 @@ const CopilotMessage: FC<CopilotMessageProps> = memo(
374374 }
375375
376376 return (
377- < div className = 'my-6 rounded-md bg-gray-900 text-sm dark:bg-black' >
377+ < div className = 'my-6 w-0 min-w-full rounded-md bg-gray-900 text-sm dark:bg-black' >
378378 < div className = 'flex items-center justify-between border-gray-700 border-b px-4 py-1.5 dark:border-gray-800' >
379379 < span className = 'font-geist-sans text-gray-400 text-xs' > { language } </ span >
380380 < Button
@@ -390,9 +390,11 @@ const CopilotMessage: FC<CopilotMessageProps> = memo(
390390 < Copy className = 'h-3 w-3 text-gray-400' />
391391 </ Button >
392392 </ div >
393- < pre className = 'overflow-x-auto p-4 font-mono text-gray-100 text-sm leading-relaxed' >
394- { codeContent }
395- </ pre >
393+ < div className = 'overflow-x-auto' >
394+ < pre className = 'whitespace-pre p-4 font-mono text-gray-100 text-sm leading-relaxed' >
395+ { codeContent }
396+ </ pre >
397+ </ div >
396398 </ div >
397399 )
398400 } ,
@@ -440,7 +442,7 @@ const CopilotMessage: FC<CopilotMessageProps> = memo(
440442
441443 // Tables
442444 table : ( { children } : React . TableHTMLAttributes < HTMLTableElement > ) => (
443- < div className = 'my-4 w-full overflow-x-auto' >
445+ < div className = 'my-4 max- w-full overflow-x-auto' >
444446 < table className = 'min-w-full table-auto border border-gray-300 font-geist-sans text-sm dark:border-gray-700' >
445447 { children }
446448 </ table >
@@ -500,7 +502,7 @@ const CopilotMessage: FC<CopilotMessageProps> = memo(
500502 return (
501503 < div
502504 key = { `text-${ index } -${ block . timestamp || index } ` }
503- className = 'w-full transition-opacity duration-200 ease-in-out'
505+ className = 'w-full max-w-full overflow-hidden transition-opacity duration-200 ease-in-out'
504506 style = { {
505507 opacity : cleanBlockContent . length > 0 ? 1 : 0.7 ,
506508 transform : shouldUseSmoothing ? 'translateY(0)' : undefined ,
@@ -516,7 +518,7 @@ const CopilotMessage: FC<CopilotMessageProps> = memo(
516518 markdownComponents = { markdownComponents }
517519 />
518520 ) : (
519- < div className = 'space-y-4 break-words font-geist-sans text-[#0D0D0D] text-base leading-relaxed dark:text-gray-100' >
521+ < div className = 'max-w-full space-y-4 break-words font-geist-sans text-[#0D0D0D] text-base leading-relaxed dark:text-gray-100' >
520522 < ReactMarkdown remarkPlugins = { [ remarkGfm ] } components = { markdownComponents } >
521523 { cleanBlockContent }
522524 </ ReactMarkdown >
@@ -600,8 +602,8 @@ const CopilotMessage: FC<CopilotMessageProps> = memo(
600602
601603 if ( isAssistant ) {
602604 return (
603- < div className = 'w-full py-2 pl-[2px]' >
604- < div className = 'space-y-2 transition-all duration-200 ease-in-out' >
605+ < div className = 'w-full max-w-full overflow-hidden py-2 pl-[2px]' >
606+ < div className = 'max-w-full space-y-2 transition-all duration-200 ease-in-out' >
605607 { /* Content blocks in chronological order */ }
606608 { memoizedContentBlocks }
607609
0 commit comments