Skip to content

Commit 05614ad

Browse files
committed
automations: hide voice mode in dialog
Keep voice mode enabled by default for new chat inputs while excluding its currently unsupported controls from the automation composer. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 83b4f23f-9ae8-4cb3-be91-f383660edc25
1 parent d2d0a97 commit 05614ad

2 files changed

Lines changed: 31 additions & 27 deletions

File tree

‎src/vs/sessions/contrib/automations/browser/automationDialog.ts‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -585,6 +585,7 @@ export function renderForm(
585585
historyKey: constObservable(undefined),
586586
placeholder: localize('automation.form.prompt.placeholder', "Describe what you want to automate"),
587587
renderSendButton: false,
588+
renderVoiceMode: false,
588589
hideAttachments: true,
589590
suppressNotices: true,
590591
disableDraftPersistence: true,

‎src/vs/sessions/contrib/chat/browser/newChatInput.ts‎

Lines changed: 30 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -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

Comments
 (0)