From 09582acc4ba71682c7dc98792f71345f216945e9 Mon Sep 17 00:00:00 2001 From: Joyce Er Date: Fri, 22 Nov 2024 18:07:26 -0800 Subject: [PATCH] fix: add tooltip for chat collapsed code blocks --- .../chat/browser/chatContentParts/chatMarkdownContentPart.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/vs/workbench/contrib/chat/browser/chatContentParts/chatMarkdownContentPart.ts b/src/vs/workbench/contrib/chat/browser/chatContentParts/chatMarkdownContentPart.ts index 4cd638dedf1a0..d4b7425654d53 100644 --- a/src/vs/workbench/contrib/chat/browser/chatContentParts/chatMarkdownContentPart.ts +++ b/src/vs/workbench/contrib/chat/browser/chatContentParts/chatMarkdownContentPart.ts @@ -388,6 +388,9 @@ class CollapsedCodeBlock extends Disposable { } labelAdded.textContent = `+${addedLines}`; labelRemoved.textContent = `-${removedLines}`; + const insertionsFragment = addedLines === 1 ? localize('chat.codeblock.insertions.one', "{0} insertion") : localize('chat.codeblock.insertions', "{0} insertions", addedLines); + const deletionsFragment = removedLines === 1 ? localize('chat.codeblock.deletions.one', "{0} deletion") : localize('chat.codeblock.deletions', "{0} deletions", removedLines); + this.element.ariaLabel = this.element.title = localize('summary', 'Edited {0}, {1}, {2}', iconText, insertionsFragment, deletionsFragment); } } }));