From 26b26c7e84bf6ab4df686445a1e5b5d930f12678 Mon Sep 17 00:00:00 2001 From: Megan Mott Date: Thu, 2 Oct 2025 09:50:16 -0700 Subject: [PATCH 1/3] button to disable setting --- src/chat/chatStandIn.ts | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/src/chat/chatStandIn.ts b/src/chat/chatStandIn.ts index e9779c67d..a7acaab27 100644 --- a/src/chat/chatStandIn.ts +++ b/src/chat/chatStandIn.ts @@ -5,6 +5,7 @@ import { callWithTelemetryAndErrorHandling, IActionContext, registerCommand } from '@microsoft/vscode-azext-utils'; import * as vscode from 'vscode'; +import { settingUtils } from '../utils/settingUtils'; import { askAgentAboutResourcePrompt } from './askAgentAboutResource'; const GitHubCopilotForAzureExtensionId = 'ms-azuretools.vscode-azure-github-copilot'; @@ -26,6 +27,7 @@ export function registerChatStandInParticipantIfNeeded(context: vscode.Extension context.subscriptions.push(chatStandInParticipant); registerCommand('azureResourcesGroups.installGitHubCopilotForAzureFromChat', installGitHubCopilotForAzureFromChat); + registerCommand('azureResourceGroups.updateChatStandInSetting', updateChatStandInSetting); } async function chatStandIn( @@ -42,8 +44,15 @@ async function chatStandIn( }); const postButtonMessage = request.prompt === askAgentAboutResourcePrompt ? vscode.l10n.t(`After that, please use \`Ask @azure\` again.`) : - vscode.l10n.t('After that, please repeat your question.'); + vscode.l10n.t(`After that, please repeat your question.\n\n`); responseStream.markdown(postButtonMessage); + + responseStream.markdown(vscode.l10n.t('Or you can also disable this message by clicking the button below.')); + + responseStream.button({ + title: vscode.l10n.t(`Don't ask me again`), + command: 'azureResourceGroups.updateChatStandInSetting' + }); } async function installGitHubCopilotForAzureFromChat(context: IActionContext): Promise { @@ -54,3 +63,7 @@ async function installGitHubCopilotForAzureFromChat(context: IActionContext): Pr context.telemetry.properties.result = 'Canceled'; } } + +async function updateChatStandInSetting(): Promise { + await settingUtils.updateGlobalSetting('enableChatStandIn', false); +} From c3d3d69f1a2d727aaa3b2caedca4ad621077884c Mon Sep 17 00:00:00 2001 From: Megan Mott Date: Tue, 7 Oct 2025 08:54:30 -0700 Subject: [PATCH 2/3] move button --- src/chat/chatStandIn.ts | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/chat/chatStandIn.ts b/src/chat/chatStandIn.ts index a7acaab27..886baf246 100644 --- a/src/chat/chatStandIn.ts +++ b/src/chat/chatStandIn.ts @@ -43,16 +43,14 @@ async function chatStandIn( command: 'azureResourcesGroups.installGitHubCopilotForAzureFromChat', }); - const postButtonMessage = request.prompt === askAgentAboutResourcePrompt ? vscode.l10n.t(`After that, please use \`Ask @azure\` again.`) : - vscode.l10n.t(`After that, please repeat your question.\n\n`); - responseStream.markdown(postButtonMessage); - - responseStream.markdown(vscode.l10n.t('Or you can also disable this message by clicking the button below.')); - responseStream.button({ title: vscode.l10n.t(`Don't ask me again`), command: 'azureResourceGroups.updateChatStandInSetting' }); + + const postButtonMessage = request.prompt === askAgentAboutResourcePrompt ? vscode.l10n.t(`After that, please use \`Ask @azure\` again.`) : + vscode.l10n.t(`After that, please repeat your question.\n\n`); + responseStream.markdown(postButtonMessage); } async function installGitHubCopilotForAzureFromChat(context: IActionContext): Promise { From 53b625ba52bf8588a14a40a7a84ca94f933373e9 Mon Sep 17 00:00:00 2001 From: Megan Mott Date: Tue, 7 Oct 2025 09:41:18 -0700 Subject: [PATCH 3/3] remove --- src/chat/chatStandIn.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/chat/chatStandIn.ts b/src/chat/chatStandIn.ts index 886baf246..bbbe5ead1 100644 --- a/src/chat/chatStandIn.ts +++ b/src/chat/chatStandIn.ts @@ -49,7 +49,7 @@ async function chatStandIn( }); const postButtonMessage = request.prompt === askAgentAboutResourcePrompt ? vscode.l10n.t(`After that, please use \`Ask @azure\` again.`) : - vscode.l10n.t(`After that, please repeat your question.\n\n`); + vscode.l10n.t(`After that, please repeat your question.`); responseStream.markdown(postButtonMessage); }