Skip to content

Commit a375ea8

Browse files
authored
voice - disable start action when request is active in terminal (microsoft#208801)
1 parent 1a2cc56 commit a375ea8

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

src/vs/workbench/contrib/chat/electron-sandbox/actions/voiceChatActions.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ import { ThemeIcon } from 'vs/base/common/themables';
5252
import { EditorContextKeys } from 'vs/editor/common/editorContextKeys';
5353
import { ITerminalService } from 'vs/workbench/contrib/terminal/browser/terminal';
5454
import { ProgressLocation } from 'vs/platform/progress/common/progress';
55-
import { TerminalChatController } from 'vs/workbench/contrib/terminal/browser/terminalContribExports';
55+
import { TerminalChatController, TerminalChatContextKeys } from 'vs/workbench/contrib/terminal/browser/terminalContribExports';
5656

5757
const CONTEXT_VOICE_CHAT_GETTING_READY = new RawContextKey<boolean>('voiceChatGettingReady', false, { type: 'boolean', description: localize('voiceChatGettingReady', "True when getting ready for receiving voice input from the microphone for voice chat.") });
5858
const CONTEXT_VOICE_CHAT_IN_PROGRESS = new RawContextKey<boolean>('voiceChatInProgress', false, { type: 'boolean', description: localize('voiceChatInProgress', "True when voice recording from microphone is in progress for voice chat.") });
@@ -616,7 +616,7 @@ export class StartVoiceChatAction extends Action2 {
616616
primary: KeyMod.CtrlCmd | KeyCode.KeyI
617617
},
618618
icon: Codicon.mic,
619-
precondition: ContextKeyExpr.and(CanVoiceChat, CONTEXT_VOICE_CHAT_GETTING_READY.negate(), CONTEXT_CHAT_REQUEST_IN_PROGRESS.negate(), CTX_INLINE_CHAT_HAS_ACTIVE_REQUEST.negate()),
619+
precondition: ContextKeyExpr.and(CanVoiceChat, CONTEXT_VOICE_CHAT_GETTING_READY.negate(), CONTEXT_CHAT_REQUEST_IN_PROGRESS.negate(), CTX_INLINE_CHAT_HAS_ACTIVE_REQUEST.negate(), TerminalChatContextKeys.requestActive.negate()),
620620
menu: [{
621621
id: MenuId.ChatExecute,
622622
when: ContextKeyExpr.and(HasSpeechProvider, CONTEXT_VOICE_CHAT_IN_VIEW_IN_PROGRESS.negate(), CONTEXT_QUICK_VOICE_CHAT_IN_PROGRESS.negate(), CONTEXT_VOICE_CHAT_IN_EDITOR_IN_PROGRESS.negate()),

src/vs/workbench/contrib/terminal/browser/terminalContribExports.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,5 @@
77
// to touch terminalContrib either.
88
// eslint-disable-next-line local/code-import-patterns
99
export { TerminalChatController } from 'vs/workbench/contrib/terminalContrib/chat/browser/terminalChatController';
10+
// eslint-disable-next-line local/code-import-patterns
11+
export { TerminalChatContextKeys } from 'vs/workbench/contrib/terminalContrib/chat/browser/terminalChat';

0 commit comments

Comments
 (0)