From 4338a98b8bfdd16a4268a1084b59f92e378e5125 Mon Sep 17 00:00:00 2001 From: Jackson Chen <90215880+Sma1lboy@users.noreply.github.com> Date: Fri, 8 Nov 2024 03:14:30 -0600 Subject: [PATCH] fix: add relevant context only chat view is visible (#3388) --- clients/vscode/src/Commands.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/clients/vscode/src/Commands.ts b/clients/vscode/src/Commands.ts index 9368e9b6d..64f55c5f8 100644 --- a/clients/vscode/src/Commands.ts +++ b/clients/vscode/src/Commands.ts @@ -87,8 +87,11 @@ export class Commands { this.chatViewProvider.addRelevantContext(fileContext); } }; + commands.executeCommand("tabby.chatView.focus"); - commands.executeCommand("tabby.chatView.focus").then(addContext); + if (this.chatViewProvider.webview?.visible) { + addContext(); + } } commands: Record void> = {