diff --git a/core/protocol/ideWebview.ts b/core/protocol/ideWebview.ts index 523ba4995..3b357b679 100644 --- a/core/protocol/ideWebview.ts +++ b/core/protocol/ideWebview.ts @@ -22,7 +22,7 @@ export type ToIdeFromWebviewProtocol = ToIdeFromWebviewOrCoreProtocol & { toggleDevTools: [undefined, void]; reloadWindow: [undefined, void]; focusEditor: [undefined, void]; - toggleFullScreen: [undefined, void]; + toggleFullScreen: [{ newWindow?: boolean } | undefined, void]; insertAtCursor: [{ text: string }, void]; copyText: [{ text: string }, void]; "jetbrains/editorInsetHeight": [{ height: number }, void]; diff --git a/extensions/vscode/package.json b/extensions/vscode/package.json index a9004eceb..2df04a2a0 100644 --- a/extensions/vscode/package.json +++ b/extensions/vscode/package.json @@ -189,6 +189,12 @@ "icon": "$(fullscreen)", "group": "Continue" }, + { + "command": "continue.toggleNewWindow", + "category": "Continue", + "title": "Open New Window", + "icon": "$(link-external)" + }, { "command": "continue.openConfigJson", "category": "Continue", @@ -452,6 +458,11 @@ "command": "continue.toggleFullScreen", "group": "navigation@3", "when": "view == continue.continueGUIView" + }, + { + "command": "continue.toggleNewWindow", + "group": "navigation@4", + "when": "view == continue.continueGUIView" } ], "editor/title": [ @@ -464,11 +475,6 @@ "command": "continue.viewHistory", "group": "navigation@2", "when": "activeWebviewPanelId == continue.continueGUIView" - }, - { - "command": "continue.toggleFullScreen", - "group": "navigation@3", - "when": "activeWebviewPanelId == continue.continueGUIView" } ], "terminal/context": [ diff --git a/extensions/vscode/src/commands.ts b/extensions/vscode/src/commands.ts index b49e9a184..36245b6ab 100644 --- a/extensions/vscode/src/commands.ts +++ b/extensions/vscode/src/commands.ts @@ -483,7 +483,11 @@ const commandsMap: ( "continue.applyCodeFromChat": () => { sidebar.webviewProtocol.request("applyCodeFromChat", undefined); }, - "continue.toggleFullScreen": () => { + "continue.toggleFullScreen": ({ + newWindow, + }: { newWindow?: boolean } = {}) => { + focusGUI(); + // Check if full screen is already open by checking open tabs const fullScreenTab = getFullScreenTab(); @@ -532,6 +536,18 @@ const commandsMap: ( null, extensionContext.subscriptions, ); + + if (newWindow) { + vscode.commands.executeCommand( + "workbench.action.copyEditorToNewWindow", + ); + } + }, + "continue.toggleNewWindow": () => { + focusGUI(); + vscode.commands.executeCommand("continue.toggleFullScreen", { + newWindow: true, + }); }, "continue.openConfigJson": () => { ide.openFile(getConfigJsonPath()); @@ -654,6 +670,9 @@ const commandsMap: ( { label: "$(screen-full) Open full screen chat (Cmd+K Cmd+M)", }, + { + label: "$(link-external) Open chat in a new window", + }, { label: quickPickStatusText(targetStatus), }, @@ -705,6 +724,10 @@ const commandsMap: ( "$(screen-full) Open full screen chat (Cmd+K Cmd+M)" ) { vscode.commands.executeCommand("continue.toggleFullScreen"); + } else if ( + selectedOption === "$(link-external) Open chat in a new window" + ) { + vscode.commands.executeCommand("continue.toggleNewWindow"); } else if (selectedOption === "$(question) Open help center") { focusGUI(); vscode.commands.executeCommand("continue.navigateTo", "/more");