@@ -45,7 +45,7 @@ import { ActiveEditorContext, IsCompactTitleBarContext } from '../../../../commo
4545import { IWorkbenchContribution } from '../../../../common/contributions.js' ;
4646import { IViewDescriptorService , ViewContainerLocation } from '../../../../common/views.js' ;
4747import { IEditorGroupsService } from '../../../../services/editor/common/editorGroupsService.js' ;
48- import { ACTIVE_GROUP , IEditorService } from '../../../../services/editor/common/editorService.js' ;
48+ import { ACTIVE_GROUP , AUX_WINDOW_GROUP , IEditorService } from '../../../../services/editor/common/editorService.js' ;
4949import { IHostService } from '../../../../services/host/browser/host.js' ;
5050import { IWorkbenchLayoutService , Parts } from '../../../../services/layout/browser/layoutService.js' ;
5151import { IViewsService } from '../../../../services/views/common/viewsService.js' ;
@@ -903,6 +903,82 @@ export function registerChatActions() {
903903 }
904904 } ) ;
905905
906+ registerAction2 ( class OpenChatEditorInNewWindowAction extends Action2 {
907+ constructor ( ) {
908+ super ( {
909+ id : `workbench.action.chat.newChatInNewWindow` ,
910+ title : localize2 ( 'chatSessions.openNewChatInNewWindow' , 'Open New Chat in New Window' ) ,
911+ f1 : true ,
912+ category : CHAT_CATEGORY ,
913+ precondition : ChatContextKeys . enabled
914+ } ) ;
915+ }
916+
917+ async run ( accessor : ServicesAccessor ) {
918+ const editorService = accessor . get ( IEditorService ) ;
919+ await editorService . openEditor ( {
920+ resource : ChatEditorInput . getNewEditorUri ( ) ,
921+ options : {
922+ pinned : true ,
923+ auxiliary : { compact : true , bounds : { width : 640 , height : 640 } }
924+ } satisfies IChatEditorOptions
925+ } , AUX_WINDOW_GROUP ) ;
926+ }
927+ } ) ;
928+
929+ registerAction2 ( class OpenChatEditorInNewMaximizedWindowAction extends Action2 {
930+ constructor ( ) {
931+ super ( {
932+ id : `workbench.action.chat.newChatInNewMaximizedWindow` ,
933+ title : localize2 ( 'chatSessions.openNewChatInNewMaximizedWindow' , 'Open New Chat in Maximized Window' ) ,
934+ f1 : true ,
935+ category : CHAT_CATEGORY ,
936+ precondition : ChatContextKeys . enabled
937+ } ) ;
938+ }
939+
940+ async run ( accessor : ServicesAccessor ) {
941+ const editorService = accessor . get ( IEditorService ) ;
942+ await editorService . openEditor ( {
943+ resource : ChatEditorInput . getNewEditorUri ( ) ,
944+ options : {
945+ pinned : true ,
946+ auxiliary : { compact : false }
947+ } satisfies IChatEditorOptions
948+ } , AUX_WINDOW_GROUP ) ;
949+ }
950+ } ) ;
951+
952+ registerAction2 ( class NewChatInSideBarAction extends Action2 {
953+ constructor ( ) {
954+ super ( {
955+ id : `workbench.action.chat.newChatInSideBar` ,
956+ title : localize2 ( 'chatSessions.openNewChatInSideBar' , 'Open New Chat in Side Bar' ) ,
957+ f1 : true ,
958+ category : CHAT_CATEGORY ,
959+ precondition : ChatContextKeys . enabled
960+ } ) ;
961+ }
962+
963+ async run ( accessor : ServicesAccessor ) {
964+ const viewsService = accessor . get ( IViewsService ) ;
965+
966+ // Open the chat view in the sidebar and get the widget
967+ const chatWidget = await showChatView ( viewsService ) ;
968+
969+ if ( chatWidget ) {
970+ // Clear the current chat to start a new one
971+ chatWidget . clear ( ) ;
972+ await chatWidget . waitForReady ( ) ;
973+ chatWidget . attachmentModel . clear ( true ) ;
974+ chatWidget . input . relatedFiles ?. clear ( ) ;
975+
976+ // Focus the input area
977+ chatWidget . focusInput ( ) ;
978+ }
979+ }
980+ } ) ;
981+
906982 registerAction2 ( class ChatAddAction extends Action2 {
907983 constructor ( ) {
908984 super ( {
0 commit comments