File tree Expand file tree Collapse file tree 2 files changed +6
-8
lines changed
webview-ui/src/components/common Expand file tree Collapse file tree 2 files changed +6
-8
lines changed Original file line number Diff line number Diff line change @@ -117,7 +117,6 @@ const CodeAccordian = ({
117117 ) }
118118 { ( ! ( path || isFeedback || isConsoleLogs ) || isExpanded ) && (
119119 < div
120- //className="code-block-scrollable" this doesn't seem to be necessary anymore, on silicon macs it shows the native mac scrollbar instead of the vscode styled one
121120 style = { {
122121 overflowX : "auto" ,
123122 overflowY : "hidden" ,
Original file line number Diff line number Diff line change @@ -598,6 +598,10 @@ const CodeBlock = memo(
598598 [ source , rawSource , copyWithFeedback ] ,
599599 )
600600
601+ if ( source ?. length === 0 ) {
602+ return null
603+ }
604+
601605 return (
602606 < CodeBlockContainer ref = { codeBlockRef } >
603607 < StyledPre
@@ -607,9 +611,7 @@ const CodeBlock = memo(
607611 windowshade = { windowShade ? "true" : "false" }
608612 collapsedHeight = { collapsedHeight }
609613 onMouseDown = { ( ) => updateCodeBlockButtonPosition ( true ) }
610- onMouseUp = { ( ) => updateCodeBlockButtonPosition ( false ) }
611- // onScroll prop is removed - handled by the useEffect scroll listener now
612- >
614+ onMouseUp = { ( ) => updateCodeBlockButtonPosition ( false ) } >
613615 < div dangerouslySetInnerHTML = { { __html : highlightedCode } } />
614616 </ StyledPre >
615617 { ! isSelecting && (
@@ -685,10 +687,7 @@ const CodeBlock = memo(
685687 // After UI updates, ensure code block is visible and update button position
686688 setTimeout (
687689 ( ) => {
688- codeBlock . scrollIntoView ( {
689- behavior : "smooth" ,
690- block : "nearest" ,
691- } )
690+ codeBlock . scrollIntoView ( { behavior : "smooth" , block : "nearest" } )
692691
693692 // Wait for scroll to complete before updating button position
694693 setTimeout ( ( ) => {
You can’t perform that action at this time.
0 commit comments