@@ -75,6 +75,7 @@ import { clearChatEditor } from './chatClear.js';
75
75
import { ILanguageModelChatSelector , ILanguageModelsService } from '../../common/languageModels.js' ;
76
76
import { IChatResponseModel } from '../../common/chatModel.js' ;
77
77
import { EditorContextKeys } from '../../../../../editor/common/editorContextKeys.js' ;
78
+ import { mainWindow } from '../../../../../base/browser/window.js' ;
78
79
79
80
export const CHAT_CATEGORY = localize2 ( 'chat.category' , 'Chat' ) ;
80
81
@@ -956,7 +957,7 @@ export function registerChatActions() {
956
957
}
957
958
} ) ;
958
959
959
- registerAction2 ( class OpenChatEditorAction extends Action2 {
960
+ registerAction2 ( class NewChatEditorAction extends Action2 {
960
961
constructor ( ) {
961
962
super ( {
962
963
id : `workbench.action.openChat` ,
@@ -968,6 +969,11 @@ export function registerChatActions() {
968
969
weight : KeybindingWeight . WorkbenchContrib + 1 ,
969
970
primary : KeyMod . CtrlCmd | KeyCode . KeyN ,
970
971
when : ContextKeyExpr . and ( ChatContextKeys . inChatSession , ChatContextKeys . inChatEditor )
972
+ } ,
973
+ menu : {
974
+ id : MenuId . ChatTitleBarMenu ,
975
+ group : 'b_new' ,
976
+ order : 0
971
977
}
972
978
} ) ;
973
979
}
@@ -978,6 +984,28 @@ export function registerChatActions() {
978
984
}
979
985
} ) ;
980
986
987
+ registerAction2 ( class NewChatWindowAction extends Action2 {
988
+ constructor ( ) {
989
+ super ( {
990
+ id : `workbench.action.newChatWindow` ,
991
+ title : localize2 ( 'interactiveSession.newChatWindow' , "New Chat Window" ) ,
992
+ f1 : true ,
993
+ category : CHAT_CATEGORY ,
994
+ precondition : ChatContextKeys . enabled ,
995
+ menu : {
996
+ id : MenuId . ChatTitleBarMenu ,
997
+ group : 'b_new' ,
998
+ order : 1
999
+ }
1000
+ } ) ;
1001
+ }
1002
+
1003
+ async run ( accessor : ServicesAccessor ) {
1004
+ const editorService = accessor . get ( IEditorService ) ;
1005
+ await editorService . openEditor ( { resource : ChatEditorInput . getNewEditorUri ( ) , options : { pinned : true , auxiliary : { compact : true , bounds : { width : 640 , height : 640 } } } satisfies IChatEditorOptions } , AUX_WINDOW_GROUP ) ;
1006
+ }
1007
+ } ) ;
1008
+
981
1009
registerAction2 ( class OpenChatEditorInNewWindowAction extends Action2 {
982
1010
constructor ( ) {
983
1011
super ( {
@@ -1553,12 +1581,11 @@ export class CopilotTitleBarMenuRendering extends Disposable implements IWorkben
1553
1581
1554
1582
constructor (
1555
1583
@IActionViewItemService actionViewItemService : IActionViewItemService ,
1556
- @IInstantiationService instantiationService : IInstantiationService ,
1557
1584
@IChatEntitlementService chatEntitlementService : IChatEntitlementService ,
1558
1585
) {
1559
1586
super ( ) ;
1560
1587
1561
- const disposable = actionViewItemService . register ( MenuId . CommandCenter , MenuId . ChatTitleBarMenu , ( action , options ) => {
1588
+ const disposable = actionViewItemService . register ( MenuId . CommandCenter , MenuId . ChatTitleBarMenu , ( action , options , instantiationService , windowId ) => {
1562
1589
if ( ! ( action instanceof SubmenuItemAction ) ) {
1563
1590
return undefined ;
1564
1591
}
@@ -1574,8 +1601,9 @@ export class CopilotTitleBarMenuRendering extends Disposable implements IWorkben
1574
1601
const signedOut = chatEntitlementService . entitlement === ChatEntitlement . Unknown ;
1575
1602
const free = chatEntitlementService . entitlement === ChatEntitlement . Free ;
1576
1603
1577
- let primaryActionId = TOGGLE_CHAT_ACTION_ID ;
1578
- let primaryActionTitle = localize ( 'toggleChat' , "Toggle Chat" ) ;
1604
+ const isAuxiliaryWindow = windowId !== mainWindow . vscodeWindowId ;
1605
+ let primaryActionId = isAuxiliaryWindow ? CHAT_OPEN_ACTION_ID : TOGGLE_CHAT_ACTION_ID ;
1606
+ let primaryActionTitle = isAuxiliaryWindow ? localize ( 'openChat' , "Open Chat" ) : localize ( 'toggleChat' , "Toggle Chat" ) ;
1579
1607
let primaryActionIcon = Codicon . chatSparkle ;
1580
1608
if ( chatSentiment . installed && ! chatSentiment . disabled ) {
1581
1609
if ( signedOut ) {
0 commit comments