From b0b761ef369c894d3cf5b2e8fa9dac4ab93d4104 Mon Sep 17 00:00:00 2001 From: Tom Ross Date: Fri, 7 Jul 2023 08:46:26 +0100 Subject: [PATCH] Cody Inline Chat: Add "Collapse All Comments" (#54675) --- client/cody/CHANGELOG.md | 3 ++- client/cody/package.json | 19 ++++++++++++++++++- client/cody/src/main.ts | 3 +++ 3 files changed, 23 insertions(+), 2 deletions(-) diff --git a/client/cody/CHANGELOG.md b/client/cody/CHANGELOG.md index 5eca973ffac4..337b5beabff5 100644 --- a/client/cody/CHANGELOG.md +++ b/client/cody/CHANGELOG.md @@ -11,7 +11,8 @@ Starting from `0.2.0`, Cody is using `major.EVEN_NUMBER.patch` for release versi - Added support for server-side token limits to Chat. [pull/54488](https://github.com/sourcegraph/sourcegraph/pull/54488) - Add "Find code smells" recipe to editor context menu and command pallette [pull/54432](https://github.com/sourcegraph/sourcegraph/pull/54432) - Add a typewriter effect to Cody's responses to mimic typing in characters rather than varying chunks [pull/54522](https://github.com/sourcegraph/sourcegraph/pull/54522) -- Add suggested recipes to the new chat welcome message. (pull/54277)(https://github.com/sourcegraph/sourcegraph/pull/54277) +- Add suggested recipes to the new chat welcome message. [pull/54277](https://github.com/sourcegraph/sourcegraph/pull/54277) +- Added the option to collapse all inline chats from within the inline chat window. [pull/54675](https://github.com/sourcegraph/sourcegraph/pull/54675) ### Fixed diff --git a/client/cody/package.json b/client/cody/package.json index 2a09f4f02a21..5f7c3cb41e5b 100644 --- a/client/cody/package.json +++ b/client/cody/package.json @@ -369,7 +369,7 @@ }, { "command": "cody.comment.delete", - "title": "Remove Comment", + "title": "Remove Inline Chat", "category": "Cody Inline Chat", "when": "cody.activated && config.cody.inlineChat.enabled", "enablement": "!commentThreadIsEmpty", @@ -383,6 +383,14 @@ "enablement": "!commentThreadIsEmpty", "icon": "$(sync~spin)" }, + { + "command": "cody.comment.collapse-all", + "title": "Collapse All Inline Chats", + "category": "Cody Inline Chat", + "when": "cody.activated && config.cody.inlineChat.enabled", + "enablement": "!commentThreadIsEmpty", + "icon": "$(collapse-all)" + }, { "command": "cody.inline.new", "title": "Start a new Thread (Ctrl+Shift+C)", @@ -556,6 +564,10 @@ "command": "cody.comment.load", "when": "false" }, + { + "command": "cody.comment.collapse-all", + "when": "false" + }, { "command": "cody.fixup.apply", "when": "false" @@ -743,6 +755,11 @@ "command": "cody.comment.load", "group": "inline@2", "when": "cody.activated && commentController =~ /^cody-inline/ && cody.reply.pending && config.cody.inlineChat.enabled" + }, + { + "command": "cody.comment.collapse-all", + "group": "inline@3", + "when": "cody.activated && commentController =~ /^cody-inline/ && config.cody.inlineChat.enabled" } ], "view/item/context": [ diff --git a/client/cody/src/main.ts b/client/cody/src/main.ts index b1b45ec8ff34..47f4cb4715cd 100644 --- a/client/cody/src/main.ts +++ b/client/cody/src/main.ts @@ -177,6 +177,9 @@ const register = async ( vscode.commands.registerCommand('cody.comment.delete', (thread: vscode.CommentThread) => { commentController.delete(thread) }), + vscode.commands.registerCommand('cody.comment.collapse-all', () => + vscode.commands.executeCommand('workbench.action.collapseAllComments') + ), vscode.commands.registerCommand('cody.inline.new', () => vscode.commands.executeCommand('workbench.action.addComment') ),