Skip to content

Commit

Permalink
Revert "chat command center polish (#229674)" (#229755)
Browse files Browse the repository at this point in the history
This reverts commit b802728.

This broke sanity tests for copilot-chat, probably in preconditions
for `inlineChat.start`. It's not clear to me what the right fix is,
so I am backing it out in order to unblock copilot-chat.
  • Loading branch information
connor4312 authored Sep 25, 2024
1 parent 848d216 commit 11fb5bb
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 22 deletions.
2 changes: 1 addition & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -170,5 +170,5 @@
},
"css.format.spaceAroundSelectorSeparator": true,
"typescript.enablePromptUseWorkspaceTsdk": true,
"chat.commandCenter.enabled": true
"inlineChat.experimental.onlyZoneWidget": true
}
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ export class DropdownWithPrimaryActionViewItem extends BaseActionViewItem {
menuAsChild: _options?.menuAsChild ?? true,
classNames: className ? ['codicon', 'codicon-chevron-down', className] : ['codicon', 'codicon-chevron-down'],
actionRunner: this._options?.actionRunner,
keybindingProvider: this._options?.getKeyBinding ?? (action => _keybindingService.lookupKeybinding(action.id)),
keybindingProvider: this._options?.getKeyBinding,
hoverDelegate: _options?.hoverDelegate
});
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ class QuickChatGlobalAction extends Action2 {
},
menu: {
id: MenuId.ChatCommandCenter,
group: 'c_quickChat',
group: 'open',
order: 5
},
metadata: {
Expand Down
3 changes: 1 addition & 2 deletions src/vs/workbench/contrib/chat/browser/chat.contribution.ts
Original file line number Diff line number Diff line change
Expand Up @@ -103,9 +103,8 @@ configurationRegistry.registerConfiguration({
},
'chat.commandCenter.enabled': {
type: 'boolean',
tags: ['experimental'],
markdownDescription: nls.localize('chat.commandCenter.enabled', "Controls whether the command center shows a menu for chat actions (requires {0}).", '`#window.commandCenter#`'),
default: false
default: true
},
'chat.experimental.implicitContext': {
type: 'boolean',
Expand Down
22 changes: 5 additions & 17 deletions src/vs/workbench/contrib/inlineChat/browser/inlineChatActions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import { EditorContextKeys } from '../../../../editor/common/editorContextKeys.j
import { InlineChatController, InlineChatRunOptions } from './inlineChatController.js';
import { ACTION_ACCEPT_CHANGES, CTX_INLINE_CHAT_HAS_AGENT, CTX_INLINE_CHAT_HAS_STASHED_SESSION, CTX_INLINE_CHAT_FOCUSED, CTX_INLINE_CHAT_INNER_CURSOR_FIRST, CTX_INLINE_CHAT_INNER_CURSOR_LAST, CTX_INLINE_CHAT_VISIBLE, CTX_INLINE_CHAT_OUTER_CURSOR_POSITION, CTX_INLINE_CHAT_USER_DID_EDIT, CTX_INLINE_CHAT_DOCUMENT_CHANGED, CTX_INLINE_CHAT_EDIT_MODE, EditMode, MENU_INLINE_CHAT_WIDGET_STATUS, CTX_INLINE_CHAT_REQUEST_IN_PROGRESS, CTX_INLINE_CHAT_RESPONSE_TYPE, InlineChatResponseType, ACTION_REGENERATE_RESPONSE, ACTION_VIEW_IN_CHAT, ACTION_TOGGLE_DIFF, CTX_INLINE_CHAT_CHANGE_HAS_DIFF, CTX_INLINE_CHAT_CHANGE_SHOWS_DIFF, MENU_INLINE_CHAT_ZONE, ACTION_DISCARD_CHANGES } from '../common/inlineChat.js';
import { localize, localize2 } from '../../../../nls.js';
import { Action2, IAction2Options, MenuId } from '../../../../platform/actions/common/actions.js';
import { Action2, IAction2Options } from '../../../../platform/actions/common/actions.js';
import { ContextKeyExpr } from '../../../../platform/contextkey/common/contextkey.js';
import { IInstantiationService, ServicesAccessor } from '../../../../platform/instantiation/common/instantiation.js';
import { KeybindingWeight } from '../../../../platform/keybinding/common/keybindingsRegistry.js';
Expand All @@ -27,7 +27,6 @@ import { ILogService } from '../../../../platform/log/common/log.js';
import { IChatService } from '../../chat/common/chatService.js';
import { CONTEXT_CHAT_INPUT_HAS_TEXT, CONTEXT_IN_CHAT_INPUT } from '../../chat/common/chatContextKeys.js';
import { HunkInformation } from './inlineChatSession.js';
import { ActiveEditorContext } from '../../../common/contextkeys.js';

CommandsRegistry.registerCommandAlias('interactiveEditor.start', 'inlineChat.start');
CommandsRegistry.registerCommandAlias('interactive.acceptChanges', ACTION_ACCEPT_CHANGES);
Expand All @@ -50,28 +49,17 @@ export class StartSessionAction extends EditorAction2 {
constructor() {
super({
id: 'inlineChat.start',
title: localize2('run', 'Editor Inline Chat'),
title: localize2('run', 'Editor Chat'),
category: AbstractInlineChatAction.category,
f1: true,
precondition: ContextKeyExpr.and(
CTX_INLINE_CHAT_HAS_AGENT,
ContextKeyExpr.or(
ActiveEditorContext.isEqualTo('workbench.editors.files.textFileEditor'),
ActiveEditorContext.isEqualTo('workbench.editor.notebook')
)
),
precondition: ContextKeyExpr.and(CTX_INLINE_CHAT_HAS_AGENT, EditorContextKeys.writable),
keybinding: {
when: ContextKeyExpr.and(EditorContextKeys.focus, EditorContextKeys.writable),
when: EditorContextKeys.focus,
weight: KeybindingWeight.WorkbenchContrib,
primary: KeyMod.CtrlCmd | KeyCode.KeyI,
secondary: [KeyChord(KeyMod.CtrlCmd | KeyCode.KeyK, KeyCode.KeyI)],
},
icon: START_INLINE_CHAT,
menu: {
id: MenuId.ChatCommandCenter,
group: 'b_inlineChat',
order: 10,
}
icon: START_INLINE_CHAT
});
}

Expand Down

0 comments on commit 11fb5bb

Please sign in to comment.