@@ -462,6 +462,7 @@ export class NewChatInputWidget extends Disposable implements IHistoryNavigation
462462 minEditorHeight ?: number ;
463463 placeholder ?: string ;
464464 renderSendButton ?: boolean ;
465+ renderVoiceMode ?: boolean ;
465466 sessionTypePickerOptions ?: ISessionTypePickerOptions ;
466467 supportsBackground ?: boolean ;
467468 deferredNotificationsEnabled ?: IObservable < boolean > ;
@@ -1085,34 +1086,36 @@ export class NewChatInputWidget extends Disposable implements IHistoryNavigation
10851086 this . logService . error ( 'Failed to create new-session dictation control:' , error ) ;
10861087 }
10871088
1088- // Voice controls (mic/stop/settings/disconnect). The hand-built toolbar
1089- // can't use the shared `MenuId.ChatExecute`, so a dedicated menu is used.
1090- // Keep the session picker usable when optional voice initialization fails.
1091- // The controller also handles voice target routing + input glow, which the
1092- // segmented pill relies on, so it is created regardless of the pill; its
1093- // toolbar items hide (via `when`) when the pill is active.
1094- const voiceContainer = dom . append ( toolbar , dom . $ ( '.sessions-chat-voice-toolbar.empty' ) ) ;
1095- try {
1096- this . _register ( this . instantiationService . createInstance ( NewChatVoiceController , {
1097- toolbarContainer : voiceContainer ,
1098- inputContainer : container ,
1099- composer : this ,
1100- onDidChangeActions : actionCount => {
1101- voiceActionCount = actionCount ;
1102- voiceContainer . classList . toggle ( 'empty' , actionCount === 0 ) ;
1103- updateVoiceInputActionBorder ( ) ;
1104- } ,
1105- } ) ) ;
1106- } catch ( error ) {
1107- this . logService . error ( 'Failed to create new-session voice controls:' , error ) ;
1108- }
1089+ if ( this . options . renderVoiceMode !== false ) {
1090+ // Voice controls (mic/stop/settings/disconnect). The hand-built toolbar
1091+ // can't use the shared `MenuId.ChatExecute`, so a dedicated menu is used.
1092+ // Keep the session picker usable when optional voice initialization fails.
1093+ // The controller also handles voice target routing + input glow, which the
1094+ // segmented pill relies on, so it is created regardless of the pill; its
1095+ // toolbar items hide (via `when`) when the pill is active.
1096+ const voiceContainer = dom . append ( toolbar , dom . $ ( '.sessions-chat-voice-toolbar.empty' ) ) ;
1097+ try {
1098+ this . _register ( this . instantiationService . createInstance ( NewChatVoiceController , {
1099+ toolbarContainer : voiceContainer ,
1100+ inputContainer : container ,
1101+ composer : this ,
1102+ onDidChangeActions : actionCount => {
1103+ voiceActionCount = actionCount ;
1104+ voiceContainer . classList . toggle ( 'empty' , actionCount === 0 ) ;
1105+ updateVoiceInputActionBorder ( ) ;
1106+ } ,
1107+ } ) ) ;
1108+ } catch ( error ) {
1109+ this . logService . error ( 'Failed to create new-session voice controls:' , error ) ;
1110+ }
11091111
1110- // Segmented voice/dictation pill (experimental). When enabled it replaces the
1111- // standalone dictation button and voice controls above with a single control.
1112- try {
1113- this . _createVoiceInputModePill ( toolbar , container ) ;
1114- } catch ( error ) {
1115- this . logService . error ( 'Failed to create new-session voice input mode pill:' , error ) ;
1112+ // Segmented voice/dictation pill (experimental). When enabled it replaces the
1113+ // standalone dictation button and voice controls above with a single control.
1114+ try {
1115+ this . _createVoiceInputModePill ( toolbar , container ) ;
1116+ } catch ( error ) {
1117+ this . logService . error ( 'Failed to create new-session voice input mode pill:' , error ) ;
1118+ }
11161119 }
11171120
11181121 this . _loadingSpinner = dom . append ( toolbar , dom . $ ( '.sessions-chat-loading-spinner' ) ) ;
0 commit comments