Skip to content

Commit 77a9703

Browse files
authored
Put terminal voice actions in separate group (microsoft#269596)
fix microsoft#269587
1 parent fe97397 commit 77a9703

2 files changed

Lines changed: 20 additions & 29 deletions

File tree

src/vs/workbench/contrib/terminal/browser/terminalMenus.ts

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -521,32 +521,6 @@ export function setupTerminalMenus(): void {
521521
isHiddenByDefault: true
522522
},
523523
},
524-
{
525-
id: MenuId.ViewTitle,
526-
item: {
527-
command: {
528-
id: TerminalCommandId.StartVoice,
529-
title: localize('workbench.action.terminal.startVoice', "Start Dictation"),
530-
},
531-
group: 'navigation',
532-
order: 9,
533-
when: ContextKeyExpr.and(ContextKeyExpr.equals('view', TERMINAL_VIEW_ID), TerminalContextKeys.terminalDictationInProgress.toNegated()),
534-
isHiddenByDefault: true
535-
},
536-
},
537-
{
538-
id: MenuId.ViewTitle,
539-
item: {
540-
command: {
541-
id: TerminalCommandId.StopVoice,
542-
title: localize('workbench.action.terminal.stopVoice', "Stop Dictation"),
543-
},
544-
group: 'navigation',
545-
order: 9,
546-
when: ContextKeyExpr.and(ContextKeyExpr.equals('view', TERMINAL_VIEW_ID), TerminalContextKeys.terminalDictationInProgress),
547-
isHiddenByDefault: true
548-
},
549-
},
550524
]
551525
);
552526

src/vs/workbench/contrib/terminalContrib/voice/browser/terminalVoiceActions.ts

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55

66
import { IAction } from '../../../../../base/common/actions.js';
77
import { localize, localize2 } from '../../../../../nls.js';
8+
import { MenuId } from '../../../../../platform/actions/common/actions.js';
89
import { ICommandService } from '../../../../../platform/commands/common/commands.js';
910
import { ContextKeyExpr, IContextKeyService } from '../../../../../platform/contextkey/common/contextkey.js';
1011
import { IExtensionManagementService } from '../../../../../platform/extensionManagement/common/extensionManagement.js';
@@ -13,7 +14,7 @@ import { INotificationService, Severity } from '../../../../../platform/notifica
1314
import { EnablementState, IWorkbenchExtensionEnablementService } from '../../../../services/extensionManagement/common/extensionManagement.js';
1415
import { HasSpeechProvider, SpeechToTextInProgress } from '../../../speech/common/speechService.js';
1516
import { registerActiveInstanceAction, sharedWhenClause } from '../../../terminal/browser/terminalActions.js';
16-
import { TerminalCommandId } from '../../../terminal/common/terminal.js';
17+
import { TERMINAL_VIEW_ID, TerminalCommandId } from '../../../terminal/common/terminal.js';
1718
import { TerminalContextKeys } from '../../../terminal/common/terminalContextKey.js';
1819
import { TerminalVoiceSession } from './terminalVoice.js';
1920

@@ -73,7 +74,15 @@ export function registerTerminalVoiceActions() {
7374
}, learnMoreAction);
7475
}
7576
notificationService.notify({ severity: Severity.Info, message, actions: { primary: actions } });
76-
}
77+
},
78+
menu: [
79+
{
80+
id: MenuId.ViewTitle,
81+
group: 'voice',
82+
when: ContextKeyExpr.and(ContextKeyExpr.equals('view', TERMINAL_VIEW_ID), TerminalContextKeys.terminalDictationInProgress.toNegated()),
83+
isHiddenByDefault: true
84+
},
85+
]
7786
});
7887

7988
registerActiveInstanceAction({
@@ -84,6 +93,14 @@ export function registerTerminalVoiceActions() {
8493
run: (activeInstance, c, accessor) => {
8594
const instantiationService = accessor.get(IInstantiationService);
8695
TerminalVoiceSession.getInstance(instantiationService).stop(true);
87-
}
96+
},
97+
menu: [
98+
{
99+
id: MenuId.ViewTitle,
100+
group: 'voice',
101+
when: ContextKeyExpr.and(ContextKeyExpr.equals('view', TERMINAL_VIEW_ID), TerminalContextKeys.terminalDictationInProgress),
102+
isHiddenByDefault: true
103+
},
104+
]
88105
});
89106
}

0 commit comments

Comments
 (0)