Skip to content

Commit 170729f

Browse files
committed
Moved last action
1 parent 9eecafa commit 170729f

File tree

2 files changed

+37
-13
lines changed

2 files changed

+37
-13
lines changed

src/vs/workbench/contrib/chat/browser/actions/chatActions.ts

Lines changed: 37 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ import { ToggleTitleBarConfigAction } from '../../../../browser/parts/titlebar/t
4444
import { ActiveEditorContext, IsCompactTitleBarContext } from '../../../../common/contextkeys.js';
4545
import { IWorkbenchContribution } from '../../../../common/contributions.js';
4646
import { IViewDescriptorService, ViewContainerLocation } from '../../../../common/views.js';
47-
import { IEditorGroupsService } from '../../../../services/editor/common/editorGroupsService.js';
47+
import { GroupDirection, IEditorGroupsService } from '../../../../services/editor/common/editorGroupsService.js';
4848
import { ACTIVE_GROUP, AUX_WINDOW_GROUP, IEditorService } from '../../../../services/editor/common/editorService.js';
4949
import { IHostService } from '../../../../services/host/browser/host.js';
5050
import { IWorkbenchLayoutService, Parts } from '../../../../services/layout/browser/layoutService.js';
@@ -909,7 +909,7 @@ export function registerChatActions() {
909909
super({
910910
id: `workbench.action.chat.newChatInNewWindow`,
911911
title: localize2('chatSessions.openNewChatInNewWindow', 'Open New Chat in New Window'),
912-
f1: true,
912+
f1: false,
913913
category: CHAT_CATEGORY,
914914
precondition: ChatContextKeys.enabled,
915915
menu: {
@@ -938,7 +938,7 @@ export function registerChatActions() {
938938
super({
939939
id: `workbench.action.chat.newChatInNewMaximizedWindow`,
940940
title: localize2('chatSessions.openNewChatInNewMaximizedWindow', 'Open New Chat in Maximized Window'),
941-
f1: true,
941+
f1: false,
942942
category: CHAT_CATEGORY,
943943
precondition: ChatContextKeys.enabled,
944944
menu: {
@@ -967,7 +967,7 @@ export function registerChatActions() {
967967
super({
968968
id: `workbench.action.chat.newChatInSideBar`,
969969
title: localize2('chatSessions.openNewChatInSideBar', 'Open New Chat in Side Bar'),
970-
f1: true,
970+
f1: false,
971971
category: CHAT_CATEGORY,
972972
precondition: ChatContextKeys.enabled,
973973
menu: {
@@ -998,6 +998,39 @@ export function registerChatActions() {
998998
}
999999
});
10001000

1001+
registerAction2(class OpenChatInNewEditorGroupAction extends Action2 {
1002+
constructor() {
1003+
super({
1004+
id: 'workbench.action.chat.openInNewEditorGroup',
1005+
title: localize2('chat.openInNewEditorGroup.label', "Open Chat in New Editor Group"),
1006+
category: CHAT_CATEGORY,
1007+
precondition: ChatContextKeys.enabled,
1008+
f1: false,
1009+
menu: {
1010+
id: MenuId.ViewTitle,
1011+
group: 'submenu',
1012+
order: 1,
1013+
when: ContextKeyExpr.equals('view', `${VIEWLET_ID}.local`),
1014+
}
1015+
});
1016+
}
1017+
1018+
async run(accessor: ServicesAccessor, ...args: any[]) {
1019+
const editorService = accessor.get(IEditorService);
1020+
const editorGroupService = accessor.get(IEditorGroupsService);
1021+
1022+
// Create a new editor group to the right
1023+
const newGroup = editorGroupService.addGroup(editorGroupService.activeGroup, GroupDirection.RIGHT);
1024+
editorGroupService.activateGroup(newGroup);
1025+
1026+
// Open a new chat editor in the new group
1027+
await editorService.openEditor(
1028+
{ resource: ChatEditorInput.getNewEditorUri(), options: { pinned: true } },
1029+
newGroup.id
1030+
);
1031+
}
1032+
});
1033+
10011034
registerAction2(class ChatAddAction extends Action2 {
10021035
constructor() {
10031036
super({

src/vs/workbench/contrib/chat/browser/chatSessions.ts

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -962,12 +962,3 @@ MenuRegistry.appendMenuItem(MenuId.ViewTitle, {
962962
when: ContextKeyExpr.equals('view', `${VIEWLET_ID}.local`),
963963
});
964964

965-
MenuRegistry.appendMenuItem(MenuId.ViewTitle, {
966-
command: {
967-
id: 'workbench.action.chat.openInNewEditorGroup',
968-
title: nls.localize2('chatSessions.openNewChatInNewEditorGroup', 'Open New Chat in Editor Group'),
969-
},
970-
group: 'submenu',
971-
order: 1,
972-
when: ContextKeyExpr.equals('view', `${VIEWLET_ID}.local`),
973-
});

0 commit comments

Comments
 (0)