Skip to content

Commit

Permalink
Merge pull request #208047 from microsoft/tyriar/4288
Browse files Browse the repository at this point in the history
Adopt buttonConfigProvider for terminal chat actions
  • Loading branch information
Tyriar authored Mar 18, 2024
2 parents 20a38ea + 7084cf9 commit 7c74357
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,6 @@ registerActiveXtermAction({
primary: KeyMod.CtrlCmd | KeyCode.Enter,
},
menu: {
// TODO: Allow action to be made primary, the action list is hardcoded within InlineChatWidget
id: MENU_TERMINAL_CHAT_WIDGET_STATUS,
group: '0_main',
order: 0,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import { IInstantiationService } from 'vs/platform/instantiation/common/instanti
import { IChatProgress } from 'vs/workbench/contrib/chat/common/chatService';
import { InlineChatWidget } from 'vs/workbench/contrib/inlineChat/browser/inlineChatWidget';
import { ITerminalInstance } from 'vs/workbench/contrib/terminal/browser/terminal';
import { MENU_TERMINAL_CHAT_INPUT, MENU_TERMINAL_CHAT_WIDGET, MENU_TERMINAL_CHAT_WIDGET_FEEDBACK, MENU_TERMINAL_CHAT_WIDGET_STATUS, TerminalChatContextKeys } from 'vs/workbench/contrib/terminalContrib/chat/browser/terminalChat';
import { MENU_TERMINAL_CHAT_INPUT, MENU_TERMINAL_CHAT_WIDGET, MENU_TERMINAL_CHAT_WIDGET_FEEDBACK, MENU_TERMINAL_CHAT_WIDGET_STATUS, TerminalChatCommandId, TerminalChatContextKeys } from 'vs/workbench/contrib/terminalContrib/chat/browser/terminalChat';

const enum Constants {
HorizontalMargin = 10
Expand Down Expand Up @@ -51,7 +51,18 @@ export class TerminalChatWidget extends Disposable {
{
inputMenuId: MENU_TERMINAL_CHAT_INPUT,
widgetMenuId: MENU_TERMINAL_CHAT_WIDGET,
statusMenuId: MENU_TERMINAL_CHAT_WIDGET_STATUS,
statusMenuId: {
menu: MENU_TERMINAL_CHAT_WIDGET_STATUS,
options: {
buttonConfigProvider: action => {
if (action.id === TerminalChatCommandId.ViewInChat || action.id === TerminalChatCommandId.RunCommand) {
return { isSecondary: false };
} else {
return { isSecondary: true };
}
}
}
},
feedbackMenuId: MENU_TERMINAL_CHAT_WIDGET_FEEDBACK,
telemetrySource: 'terminal-inline-chat'
}
Expand Down

0 comments on commit 7c74357

Please sign in to comment.