Changesets · Branches · Tags · Compare
| Changeset | a95c52aaa6786f43014f32efa842a595b05e841a64a813a982829dd973368dcd |
|---|---|
| Author | Patrick Erichsen <patrick.a.erichsen@gmail.com> · 2025-09-24 15:10 -07:00 |
| Committer | GitHub <noreply@github.com> · 2025-09-24 15:10 -07:00 |
| Parents | cf7c464716e7 |
3 files changed
modified extensions/vscode/package.json +15 −0
| @@ -373,6 +373,12 @@ | ||
| 373 | 373 | "category": "Continue", |
| 374 | 374 | "title": "Generate Rule", |
| 375 | 375 | "group": "Continue" |
| 376 | + }, | |
| 377 | + { | |
| 378 | + "command": "continue.openInNewWindow", | |
| 379 | + "category": "Continue", | |
| 380 | + "title": "Open in new window", | |
| 381 | + "group": "Continue" | |
| 376 | 382 | } |
| 377 | 383 | ], |
| 378 | 384 | "keybindings": [ |
| @@ -443,6 +449,12 @@ | ||
| 443 | 449 | "mac": "cmd+shift+r", |
| 444 | 450 | "key": "ctrl+shift+r" |
| 445 | 451 | }, |
| 452 | + { | |
| 453 | + "command": "continue.openInNewWindow", | |
| 454 | + "mac": "cmd+k cmd+m", | |
| 455 | + "key": "ctrl+k ctrl+m", | |
| 456 | + "when": "!terminalFocus" | |
| 457 | + }, | |
| 446 | 458 | { |
| 447 | 459 | "command": "continue.toggleTabAutocompleteEnabled", |
| 448 | 460 | "mac": "cmd+k cmd+a", |
| @@ -512,6 +524,9 @@ | ||
| 512 | 524 | }, |
| 513 | 525 | { |
| 514 | 526 | "command": "continue.generateRule" |
| 527 | + }, | |
| 528 | + { | |
| 529 | + "command": "continue.openInNewWindow" | |
| 515 | 530 | } |
| 516 | 531 | ], |
| 517 | 532 | "editor/context": [ |
modified extensions/vscode/src/commands.ts +102 −6
| @@ -46,6 +46,15 @@ | ||
| 46 | 46 | import { openEditorAndRevealRange } from "./util/vscode"; |
| 47 | 47 | import { VsCodeIde } from "./VsCodeIde"; |
| 48 | 48 | |
| 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 | + | |
| 49 | 58 | type TelemetryCaptureParams = Parameters<typeof Telemetry.capture>; |
| 50 | 59 | |
| 51 | 60 | /** |
| @@ -59,15 +68,27 @@ | ||
| 59 | 68 | } |
| 60 | 69 | |
| 61 | 70 | function 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 | + } | |
| 65 | 80 | } |
| 66 | 81 | |
| 67 | 82 | function 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 | + } | |
| 71 | 92 | } |
| 72 | 93 | |
| 73 | 94 | function waitForSidebarReady( |
| @@ -602,6 +623,11 @@ | ||
| 602 | 623 | label: "$(comment) Open chat", |
| 603 | 624 | description: getMetaKeyLabel() + " + L", |
| 604 | 625 | }, |
| 626 | + { | |
| 627 | + label: "$(screen-full) Open full screen chat", | |
| 628 | + description: | |
| 629 | + getMetaKeyLabel() + " + K, " + getMetaKeyLabel() + " + M", | |
| 630 | + }, | |
| 605 | 631 | { |
| 606 | 632 | label: quickPickStatusText(targetStatus), |
| 607 | 633 | description: |
| @@ -644,6 +670,8 @@ | ||
| 644 | 670 | } |
| 645 | 671 | } else if (selectedOption === "$(comment) Open chat") { |
| 646 | 672 | vscode.commands.executeCommand("continue.focusContinueInput"); |
| 673 | + } else if (selectedOption === "$(screen-full) Open full screen chat") { | |
| 674 | + vscode.commands.executeCommand("continue.openInNewWindow"); | |
| 647 | 675 | } else if (selectedOption === "$(gear) Open settings") { |
| 648 | 676 | vscode.commands.executeCommand("continue.navigateTo", "/config"); |
| 649 | 677 | } |
| @@ -770,6 +798,74 @@ | ||
| 770 | 798 | vscode.ConfigurationTarget.Global, |
| 771 | 799 | ); |
| 772 | 800 | }, |
| 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 | + }, | |
| 773 | 869 | "continue.forceNextEdit": async () => { |
| 774 | 870 | captureCommandTelemetry("forceNextEdit"); |
| 775 | 871 |
modified extensions/vscode/src/extension/VsCodeMessenger.ts +3 −0
| @@ -113,6 +113,9 @@ | ||
| 113 | 113 | this.onWebview("focusEditor", (msg) => { |
| 114 | 114 | vscode.commands.executeCommand("workbench.action.focusActiveEditorGroup"); |
| 115 | 115 | }); |
| 116 | + this.onWebview("toggleFullScreen", (msg) => { | |
| 117 | + vscode.commands.executeCommand("continue.openInNewWindow"); | |
| 118 | + }); | |
| 116 | 119 | |
| 117 | 120 | this.onWebview("acceptDiff", async ({ data: { filepath, streamId } }) => { |
| 118 | 121 | await vscode.commands.executeCommand( |