@@ -188,7 +188,7 @@ const CopilotMessage: FC<CopilotMessageProps> = memo(
188188 return (
189189 < div
190190 key = { `text-${ index } -${ block . timestamp || index } ` }
191- className = { `w-full max-w-full overflow-hidden pl-[2px] transition-opacity duration-200 ease-in-out ${
191+ className = { `w-full max-w-full overflow-hidden transition-opacity duration-200 ease-in-out ${
192192 cleanBlockContent . length > 0 ? 'opacity-100' : 'opacity-70'
193193 } ${ shouldUseSmoothing ? 'translate-y-0 transition-transform duration-100 ease-out' : '' } `}
194194 >
@@ -235,7 +235,8 @@ const CopilotMessage: FC<CopilotMessageProps> = memo(
235235 if ( isUser ) {
236236 return (
237237 < div
238- className = { `w-full max-w-full overflow-hidden transition-opacity duration-200 ${ isDimmed ? 'opacity-40' : 'opacity-100' } ` }
238+ className = { `w-full max-w-full overflow-hidden transition-opacity duration-200 [max-width:var(--panel-max-width)] ${ isDimmed ? 'opacity-40' : 'opacity-100' } ` }
239+ style = { { '--panel-max-width' : `${ panelWidth - 16 } px` } as React . CSSProperties }
239240 >
240241 { isEditMode ? (
241242 < div
@@ -313,7 +314,7 @@ const CopilotMessage: FC<CopilotMessageProps> = memo(
313314 onClick = { handleMessageClick }
314315 onMouseEnter = { ( ) => setIsHoveringMessage ( true ) }
315316 onMouseLeave = { ( ) => setIsHoveringMessage ( false ) }
316- className = 'group relative cursor-pointer rounded-[4px] border border-[#3D3D3D] bg-[#282828] px-[6px] py-[6px] transition-all duration-200 hover:border-[#4A4A4A] hover:bg-[#363636] dark:border-[#3D3D3D] dark:bg-[#363636] dark:hover:border-[#454545] dark:hover:bg-[#3D3D3D]'
317+ className = 'group relative w-full cursor-pointer rounded-[4px] border border-[#3D3D3D] bg-[#282828] px-[6px] py-[6px] transition-all duration-200 hover:border-[#4A4A4A] hover:bg-[#363636] dark:border-[#3D3D3D] dark:bg-[#363636] dark:hover:border-[#454545] dark:hover:bg-[#3D3D3D]'
317318 >
318319 < div
319320 ref = { messageContentRef }
@@ -439,9 +440,10 @@ const CopilotMessage: FC<CopilotMessageProps> = memo(
439440 if ( isAssistant ) {
440441 return (
441442 < div
442- className = { `w-full max-w-full overflow-hidden pl-[2px] transition-opacity duration-200 ${ isDimmed ? 'opacity-40' : 'opacity-100' } ` }
443+ className = { `w-full max-w-full overflow-hidden transition-opacity duration-200 [max-width:var(--panel-max-width)] ${ isDimmed ? 'opacity-40' : 'opacity-100' } ` }
444+ style = { { '--panel-max-width' : `${ panelWidth - 16 } px` } as React . CSSProperties }
443445 >
444- < div className = 'max-w-full space-y-1.5 transition-all duration-200 ease-in-out' >
446+ < div className = 'max-w-full space-y-1.5 px-[2px] transition-all duration-200 ease-in-out' >
445447 { /* Content blocks in chronological order */ }
446448 { memoizedContentBlocks }
447449
0 commit comments