From 7c2a097c6a482d70dfb8756ff9f8015357b8a2ed Mon Sep 17 00:00:00 2001 From: Johannes Rieken Date: Tue, 6 Aug 2024 15:33:34 +0200 Subject: [PATCH] inline chat - filter response elements that are just text edits (hides the dreaded "Made changes" messages) (#224947) --- .../chatContentParts/chatTextEditContentPart.ts | 2 +- .../contrib/inlineChat/browser/inlineChatWidget.ts | 11 ++++++++++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/src/vs/workbench/contrib/chat/browser/chatContentParts/chatTextEditContentPart.ts b/src/vs/workbench/contrib/chat/browser/chatContentParts/chatTextEditContentPart.ts index cf8afc4f69612..61bbdb4f99d32 100644 --- a/src/vs/workbench/contrib/chat/browser/chatContentParts/chatTextEditContentPart.ts +++ b/src/vs/workbench/contrib/chat/browser/chatContentParts/chatTextEditContentPart.ts @@ -56,7 +56,7 @@ export class ChatTextEditContentPart extends Disposable implements IChatContentP if (rendererOptions.renderTextEditsAsSummary?.(chatTextEdit.uri)) { if (isResponseVM(element) && element.response.value.every(item => item.kind === 'textEditGroup')) { this.domNode = $('.interactive-edits-summary', undefined, !element.isComplete - ? localize('editsSummary1', "Making changes...") + ? '' : element.isCanceled ? localize('edits0', "Making changes was aborted.") : localize('editsSummary', "Made changes.")); diff --git a/src/vs/workbench/contrib/inlineChat/browser/inlineChatWidget.ts b/src/vs/workbench/contrib/inlineChat/browser/inlineChatWidget.ts index 6fdd5cee1e848..35ad5dbf14863 100644 --- a/src/vs/workbench/contrib/inlineChat/browser/inlineChatWidget.ts +++ b/src/vs/workbench/contrib/inlineChat/browser/inlineChatWidget.ts @@ -146,7 +146,16 @@ export class InlineChatWidget { renderInputOnTop: false, renderFollowups: true, supportsFileReferences: _configurationService.getValue(`chat.experimental.variables.${location.location}`) === true, - filter: item => !isWelcomeVM(item), + filter: item => { + if (isWelcomeVM(item)) { + return false; + } + if (isResponseVM(item) && item.isComplete && item.response.value.every(item => item.kind === 'textEditGroup' && options.chatWidgetViewOptions?.rendererOptions?.renderTextEditsAsSummary?.(item.uri))) { + // filter responses that are just text edits (prevents the "Made Edits") + return false; + } + return true; + }, ...options.chatWidgetViewOptions }, {