@@ -86,6 +86,9 @@ export const ChatRowContent = ({
8686 const { t } = useTranslation ( )
8787 const { mcpServers, alwaysAllowMcp, currentCheckpoint } = useExtensionState ( )
8888 const [ reasoningCollapsed , setReasoningCollapsed ] = useState ( true )
89+ const [ isDiffErrorExpanded , setIsDiffErrorExpanded ] = useState ( false )
90+ const [ showCopySuccess , setShowCopySuccess ] = useState ( false )
91+ const { copyWithFeedback } = useCopyToClipboard ( )
8992
9093 const [ cost , apiReqCancelReason , apiReqStreamingFailedMessage ] = useMemo ( ( ) => {
9194 if ( message . text !== null && message . text !== undefined && message . say === "api_req_started" ) {
@@ -602,6 +605,98 @@ export const ChatRowContent = ({
602605 switch ( message . type ) {
603606 case "say" :
604607 switch ( message . say ) {
608+ case "diff_error" :
609+ return (
610+ < div >
611+ < div
612+ style = { {
613+ marginTop : "0px" ,
614+ overflow : "hidden" ,
615+ marginBottom : "8px" ,
616+ } } >
617+ < div
618+ style = { {
619+ borderBottom : isDiffErrorExpanded
620+ ? "1px solid var(--vscode-editorGroup-border)"
621+ : "none" ,
622+ fontWeight : "normal" ,
623+ fontSize : "var(--vscode-font-size)" ,
624+ color : "var(--vscode-editor-foreground)" ,
625+ display : "flex" ,
626+ alignItems : "center" ,
627+ justifyContent : "space-between" ,
628+ cursor : "pointer" ,
629+ } }
630+ onClick = { ( ) => setIsDiffErrorExpanded ( ! isDiffErrorExpanded ) } >
631+ < div
632+ style = { {
633+ display : "flex" ,
634+ alignItems : "center" ,
635+ gap : "10px" ,
636+ flexGrow : 1 ,
637+ } } >
638+ < span
639+ className = "codicon codicon-warning"
640+ style = { {
641+ color : "var(--vscode-editorWarning-foreground)" ,
642+ opacity : 0.8 ,
643+ fontSize : 16 ,
644+ marginBottom : "-1.5px" ,
645+ } } > </ span >
646+ < span style = { { fontWeight : "bold" } } > { t ( "chat:diffError.title" ) } </ span >
647+ </ div >
648+ < div style = { { display : "flex" , alignItems : "center" } } >
649+ < VSCodeButton
650+ appearance = "icon"
651+ style = { {
652+ padding : "3px" ,
653+ height : "24px" ,
654+ marginRight : "4px" ,
655+ color : "var(--vscode-editor-foreground)" ,
656+ display : "flex" ,
657+ alignItems : "center" ,
658+ justifyContent : "center" ,
659+ background : "transparent" ,
660+ } }
661+ onClick = { ( e ) => {
662+ e . stopPropagation ( )
663+
664+ // Call copyWithFeedback and handle the Promise
665+ copyWithFeedback ( message . text || "" ) . then ( ( success ) => {
666+ if ( success ) {
667+ // Show checkmark
668+ setShowCopySuccess ( true )
669+
670+ // Reset after a brief delay
671+ setTimeout ( ( ) => {
672+ setShowCopySuccess ( false )
673+ } , 1000 )
674+ }
675+ } )
676+ } } >
677+ < span
678+ className = { `codicon codicon-${ showCopySuccess ? "check" : "copy" } ` } > </ span >
679+ </ VSCodeButton >
680+ < span
681+ className = { `codicon codicon-chevron-${ isDiffErrorExpanded ? "up" : "down" } ` } > </ span >
682+ </ div >
683+ </ div >
684+ { isDiffErrorExpanded && (
685+ < div
686+ style = { {
687+ padding : "8px" ,
688+ backgroundColor : "var(--vscode-editor-background)" ,
689+ borderTop : "none" ,
690+ } } >
691+ < CodeBlock
692+ source = { `${ "```" } plaintext\n${ message . text || "" } \n${ "```" } ` }
693+ forceWrap = { true }
694+ />
695+ </ div >
696+ ) }
697+ </ div >
698+ </ div >
699+ )
605700 case "subtask_result" :
606701 return (
607702 < div >
0 commit comments