@@ -46,6 +46,15 @@ import { getMetaKeyLabel } from "./util/util";
4646import { openEditorAndRevealRange } from "./util/vscode" ;
4747import { VsCodeIde } from "./VsCodeIde" ;
4848
49+ let fullScreenPanel : vscode . WebviewPanel | undefined ;
50+
51+ function getFullScreenTab ( ) {
52+ const tabs = vscode . window . tabGroups . all . flatMap ( ( tabGroup ) => tabGroup . tabs ) ;
53+ return tabs . find ( ( tab ) =>
54+ ( tab . input as any ) ?. viewType ?. endsWith ( "continue.continueGUIView" ) ,
55+ ) ;
56+ }
57+
4958type TelemetryCaptureParams = Parameters < typeof Telemetry . capture > ;
5059
5160/**
@@ -59,15 +68,27 @@ function captureCommandTelemetry(
5968}
6069
6170function focusGUI ( ) {
62- // focus sidebar
63- vscode . commands . executeCommand ( "continue.continueGUIView.focus" ) ;
64- // vscode.commands.executeCommand("workbench.action.focusAuxiliaryBar");
71+ const fullScreenTab = getFullScreenTab ( ) ;
72+ if ( fullScreenTab ) {
73+ // focus fullscreen
74+ fullScreenPanel ?. reveal ( ) ;
75+ } else {
76+ // focus sidebar
77+ vscode . commands . executeCommand ( "continue.continueGUIView.focus" ) ;
78+ // vscode.commands.executeCommand("workbench.action.focusAuxiliaryBar");
79+ }
6580}
6681
6782function hideGUI ( ) {
68- // focus sidebar
69- vscode . commands . executeCommand ( "workbench.action.closeAuxiliaryBar" ) ;
70- // vscode.commands.executeCommand("workbench.action.toggleAuxiliaryBar");
83+ const fullScreenTab = getFullScreenTab ( ) ;
84+ if ( fullScreenTab ) {
85+ // focus fullscreen
86+ fullScreenPanel ?. dispose ( ) ;
87+ } else {
88+ // focus sidebar
89+ vscode . commands . executeCommand ( "workbench.action.closeAuxiliaryBar" ) ;
90+ // vscode.commands.executeCommand("workbench.action.toggleAuxiliaryBar");
91+ }
7192}
7293
7394function waitForSidebarReady (
@@ -602,6 +623,11 @@ const getCommandsMap: (
602623 label : "$(comment) Open chat" ,
603624 description : getMetaKeyLabel ( ) + " + L" ,
604625 } ,
626+ {
627+ label : "$(screen-full) Open full screen chat" ,
628+ description :
629+ getMetaKeyLabel ( ) + " + K, " + getMetaKeyLabel ( ) + " + M" ,
630+ } ,
605631 {
606632 label : quickPickStatusText ( targetStatus ) ,
607633 description :
@@ -644,6 +670,8 @@ const getCommandsMap: (
644670 }
645671 } else if ( selectedOption === "$(comment) Open chat" ) {
646672 vscode . commands . executeCommand ( "continue.focusContinueInput" ) ;
673+ } else if ( selectedOption === "$(screen-full) Open full screen chat" ) {
674+ vscode . commands . executeCommand ( "continue.openInNewWindow" ) ;
647675 } else if ( selectedOption === "$(gear) Open settings" ) {
648676 vscode . commands . executeCommand ( "continue.navigateTo" , "/config" ) ;
649677 }
@@ -770,6 +798,74 @@ const getCommandsMap: (
770798 vscode . ConfigurationTarget . Global ,
771799 ) ;
772800 } ,
801+ "continue.openInNewWindow" : async ( ) => {
802+ focusGUI ( ) ;
803+
804+ const sessionId = await sidebar . webviewProtocol . request (
805+ "getCurrentSessionId" ,
806+ undefined ,
807+ ) ;
808+ // Check if full screen is already open by checking open tabs
809+ const fullScreenTab = getFullScreenTab ( ) ;
810+
811+ if ( fullScreenTab && fullScreenPanel ) {
812+ // Full screen open, but not focused - focus it
813+ fullScreenPanel . reveal ( ) ;
814+ return ;
815+ }
816+
817+ // Clear the sidebar to prevent overwriting changes made in fullscreen
818+ vscode . commands . executeCommand ( "continue.newSession" ) ;
819+
820+ // Full screen not open - open it
821+ captureCommandTelemetry ( "openInNewWindow" ) ;
822+
823+ // Create the full screen panel
824+ let panel = vscode . window . createWebviewPanel (
825+ "continue.continueGUIView" ,
826+ "Continue" ,
827+ vscode . ViewColumn . One ,
828+ {
829+ retainContextWhenHidden : true ,
830+ enableScripts : true ,
831+ } ,
832+ ) ;
833+ fullScreenPanel = panel ;
834+
835+ // Add content to the panel
836+ panel . webview . html = sidebar . getSidebarContent (
837+ extensionContext ,
838+ panel ,
839+ undefined ,
840+ undefined ,
841+ true ,
842+ ) ;
843+
844+ const sessionLoader = panel . onDidChangeViewState ( ( ) => {
845+ vscode . commands . executeCommand ( "continue.newSession" ) ;
846+ if ( sessionId ) {
847+ vscode . commands . executeCommand (
848+ "continue.focusContinueSessionId" ,
849+ sessionId ,
850+ ) ;
851+ }
852+ panel . reveal ( ) ;
853+ sessionLoader . dispose ( ) ;
854+ } ) ;
855+
856+ // When panel closes, reset the webview and focus
857+ panel . onDidDispose (
858+ ( ) => {
859+ sidebar . resetWebviewProtocolWebview ( ) ;
860+ vscode . commands . executeCommand ( "continue.focusContinueInput" ) ;
861+ } ,
862+ null ,
863+ extensionContext . subscriptions ,
864+ ) ;
865+
866+ vscode . commands . executeCommand ( "workbench.action.copyEditorToNewWindow" ) ;
867+ vscode . commands . executeCommand ( "workbench.action.closeAuxiliaryBar" ) ;
868+ } ,
773869 "continue.forceNextEdit" : async ( ) => {
774870 captureCommandTelemetry ( "forceNextEdit" ) ;
775871
0 commit comments