Fix voice and notebook chat kb conflicts. (#208830)

This commit is contained in:
Peng Lyu 2024-03-26 13:10:11 -07:00 committed by GitHub
parent 1d122e94cf
commit 3e1b51e378
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -53,6 +53,7 @@ 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, TerminalChatContextKeys } from 'vs/workbench/contrib/terminal/browser/terminalContribExports';
import { NOTEBOOK_EDITOR_FOCUSED } from 'vs/workbench/contrib/notebook/common/notebookContextKeys';
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.") });
@ -524,7 +525,8 @@ export class HoldToVoiceChatInChatViewAction extends Action2 {
when: ContextKeyExpr.and(
CanVoiceChat,
FocusInChatInput.negate(), // when already in chat input, disable this action and prefer to start voice chat directly
EditorContextKeys.focus.negate() // do not steal the inline-chat keybinding
EditorContextKeys.focus.negate(), // do not steal the inline-chat keybinding
NOTEBOOK_EDITOR_FOCUSED.negate() // do not steal the notebook keybinding
),
primary: KeyMod.CtrlCmd | KeyCode.KeyI
}
@ -607,6 +609,7 @@ export class StartVoiceChatAction extends Action2 {
when: ContextKeyExpr.and(
FocusInChatInput, // scope this action to chat input fields only
EditorContextKeys.focus.negate(), // do not steal the inline-chat keybinding
NOTEBOOK_EDITOR_FOCUSED.negate(), // do not steal the notebook keybinding
CONTEXT_VOICE_CHAT_IN_VIEW_IN_PROGRESS.negate(),
CONTEXT_QUICK_VOICE_CHAT_IN_PROGRESS.negate(),
CONTEXT_VOICE_CHAT_IN_EDITOR_IN_PROGRESS.negate(),