@@ -559,29 +559,23 @@ export class ChatListItemRenderer extends Disposable implements ITreeRenderer<Ch
559
559
templateData . rowContainer . classList . toggle ( 'chat-response-loading' , ( isResponseVM ( element ) && ! element . isComplete ) ) ;
560
560
561
561
const content : IChatRendererContent [ ] = [ ] ;
562
- // Always add the references to avoid shifting the content parts when a reference is added, and having to re-diff all the content.
563
- // The part will hide itself if the list is empty.
564
- content . push ( { kind : 'references' , references : element . contentReferences } ) ;
565
- content . push ( ...annotateSpecialMarkdownContent ( element . response . value ) ) ;
566
- if ( element . codeCitations . length ) {
567
- content . push ( { kind : 'codeCitations' , citations : element . codeCitations } ) ;
562
+ const isFiltered = ! ! element . errorDetails ?. responseIsFiltered ;
563
+ if ( ! isFiltered ) {
564
+ // Always add the references to avoid shifting the content parts when a reference is added, and having to re-diff all the content.
565
+ // The part will hide itself if the list is empty.
566
+ content . push ( { kind : 'references' , references : element . contentReferences } ) ;
567
+ content . push ( ...annotateSpecialMarkdownContent ( element . response . value ) ) ;
568
+ if ( element . codeCitations . length ) {
569
+ content . push ( { kind : 'codeCitations' , citations : element . codeCitations } ) ;
570
+ }
568
571
}
569
572
570
573
if ( element . errorDetails ?. message && element . errorDetails . message !== canceledName ) {
571
574
content . push ( { kind : 'errorDetails' , errorDetails : element . errorDetails , isLast : index === this . delegate . getListLength ( ) - 1 } ) ;
572
575
}
573
576
574
- const isFiltered = ! ! element . errorDetails ?. responseIsFiltered ;
575
- if ( ! isFiltered ) {
576
- const diff = this . diff ( templateData . renderedParts ?? [ ] , content , element ) ;
577
- this . renderChatContentDiff ( diff , content , element , index , templateData ) ;
578
- } else {
579
- dom . clearNode ( templateData . value ) ;
580
- if ( templateData . renderedParts ) {
581
- dispose ( templateData . renderedParts ) ;
582
- }
583
- templateData . renderedParts = [ ] ;
584
- }
577
+ const diff = this . diff ( templateData . renderedParts ?? [ ] , content , element ) ;
578
+ this . renderChatContentDiff ( diff , content , element , index , templateData ) ;
585
579
586
580
this . updateItemHeightOnRender ( element , templateData ) ;
587
581
}
@@ -991,11 +985,12 @@ export class ChatListItemRenderer extends Disposable implements ITreeRenderer<Ch
991
985
renderedError . addDisposable ( renderedError . onDidChangeHeight ( ( ) => this . updateItemHeight ( templateData ) ) ) ;
992
986
return renderedError ;
993
987
} else if ( content . errorDetails . confirmationButtons && isLast ) {
994
- const errorConfirmation = this . instantiationService . createInstance ( ChatErrorConfirmationContentPart , ChatErrorLevel . Error , new MarkdownString ( content . errorDetails . message ) , content , content . errorDetails . confirmationButtons , this . renderer , context ) ;
988
+ const level = content . errorDetails . level ?? ChatErrorLevel . Error ;
989
+ const errorConfirmation = this . instantiationService . createInstance ( ChatErrorConfirmationContentPart , level , new MarkdownString ( content . errorDetails . message ) , content , content . errorDetails . confirmationButtons , this . renderer , context ) ;
995
990
errorConfirmation . addDisposable ( errorConfirmation . onDidChangeHeight ( ( ) => this . updateItemHeight ( templateData ) ) ) ;
996
991
return errorConfirmation ;
997
992
} else {
998
- const level = content . errorDetails . level ?? ( content . errorDetails . responseIsFiltered ? ChatErrorLevel . Info : ChatErrorLevel . Error ) ;
993
+ const level = content . errorDetails . level ?? ChatErrorLevel . Error ;
999
994
return this . instantiationService . createInstance ( ChatErrorContentPart , level , new MarkdownString ( content . errorDetails . message ) , content , this . renderer ) ;
1000
995
}
1001
996
}
0 commit comments