@@ -62,6 +62,8 @@ import { renderStringAsPlaintext } from '../../../../../base/browser/markdownRen
62
62
type VoiceChatSessionContext = 'view' | 'inline' | 'terminal' | 'quick' | 'editor' ;
63
63
const VoiceChatSessionContexts : VoiceChatSessionContext [ ] = [ 'view' , 'inline' , 'terminal' , 'quick' , 'editor' ] ;
64
64
65
+ const TerminalChatExecute = MenuId . for ( 'terminalChatInput' ) ; // unfortunately, terminal decided to go with their own menu (https://github.com/microsoft/vscode/issues/208789)
66
+
65
67
// Global Context Keys (set on global context key service)
66
68
const CanVoiceChat = ContextKeyExpr . and ( CONTEXT_CHAT_ENABLED , HasSpeechProvider ) ;
67
69
const FocusInChatInput = ContextKeyExpr . or ( CTX_INLINE_CHAT_FOCUSED , CONTEXT_IN_CHAT_INPUT ) ;
@@ -609,6 +611,16 @@ export class StartVoiceChatAction extends Action2 {
609
611
group : 'navigation' ,
610
612
order : 2
611
613
} ,
614
+ {
615
+ id : TerminalChatExecute ,
616
+ when : ContextKeyExpr . and (
617
+ HasSpeechProvider ,
618
+ ScopedChatSynthesisInProgress . negate ( ) , // hide when text to speech is in progress
619
+ AnyScopedVoiceChatInProgress ?. negate ( ) , // hide when voice chat is in progress
620
+ ) ,
621
+ group : 'navigation' ,
622
+ order : - 1
623
+ } ,
612
624
]
613
625
} ) ;
614
626
}
@@ -656,6 +668,12 @@ export class StopListeningAction extends Action2 {
656
668
when : ContextKeyExpr . and ( CONTEXT_CHAT_LOCATION . isEqualTo ( ChatAgentLocation . Panel ) . negate ( ) , AnyScopedVoiceChatInProgress ) ,
657
669
group : 'navigation' ,
658
670
order : 2
671
+ } , {
672
+
673
+ id : TerminalChatExecute ,
674
+ when : AnyScopedVoiceChatInProgress ,
675
+ group : 'navigation' ,
676
+ order : - 1
659
677
} ,
660
678
]
661
679
} ) ;
@@ -991,6 +1009,12 @@ export class StopReadAloud extends Action2 {
991
1009
group : 'navigation' ,
992
1010
order : 2
993
1011
} ,
1012
+ {
1013
+ id : TerminalChatExecute ,
1014
+ when : ScopedChatSynthesisInProgress ,
1015
+ group : 'navigation' ,
1016
+ order : - 1
1017
+ }
994
1018
]
995
1019
} ) ;
996
1020
}
@@ -1325,9 +1349,14 @@ export class InstallSpeechProviderForVoiceChatAction extends BaseInstallSpeechPr
1325
1349
precondition : InstallingSpeechProvider . negate ( ) ,
1326
1350
menu : [ {
1327
1351
id : MenuId . ChatInput ,
1328
- when : HasSpeechProvider . negate ( ) ,
1352
+ when : ContextKeyExpr . and ( HasSpeechProvider . negate ( ) , CONTEXT_CHAT_LOCATION . isEqualTo ( ChatAgentLocation . Terminal ) . negate ( ) ) ,
1329
1353
group : 'navigation' ,
1330
1354
order : 3
1355
+ } , {
1356
+ id : TerminalChatExecute ,
1357
+ when : HasSpeechProvider . negate ( ) ,
1358
+ group : 'navigation' ,
1359
+ order : - 1
1331
1360
} ]
1332
1361
} ) ;
1333
1362
}
0 commit comments