voice - disable start action when request is active in terminal (#208801)

This commit is contained in:
Benjamin Pasero 2024-03-26 17:07:14 +01:00 committed by GitHub
parent 1a2cc56282
commit a375ea8754
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 4 additions and 2 deletions

View file

@ -52,7 +52,7 @@ import { ThemeIcon } from 'vs/base/common/themables';
import { EditorContextKeys } from 'vs/editor/common/editorContextKeys';
import { ITerminalService } from 'vs/workbench/contrib/terminal/browser/terminal';
import { ProgressLocation } from 'vs/platform/progress/common/progress';
import { TerminalChatController } from 'vs/workbench/contrib/terminal/browser/terminalContribExports';
import { TerminalChatController, TerminalChatContextKeys } from 'vs/workbench/contrib/terminal/browser/terminalContribExports';
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.") });
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 {
primary: KeyMod.CtrlCmd | KeyCode.KeyI
},
icon: Codicon.mic,
precondition: ContextKeyExpr.and(CanVoiceChat, CONTEXT_VOICE_CHAT_GETTING_READY.negate(), CONTEXT_CHAT_REQUEST_IN_PROGRESS.negate(), CTX_INLINE_CHAT_HAS_ACTIVE_REQUEST.negate()),
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()),
menu: [{
id: MenuId.ChatExecute,
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()),

View file

@ -7,3 +7,5 @@
// to touch terminalContrib either.
// eslint-disable-next-line local/code-import-patterns
export { TerminalChatController } from 'vs/workbench/contrib/terminalContrib/chat/browser/terminalChatController';
// eslint-disable-next-line local/code-import-patterns
export { TerminalChatContextKeys } from 'vs/workbench/contrib/terminalContrib/chat/browser/terminalChat';