full screen now opens in current session
This commit is contained in:
parent
4ba3d98e26
commit
dd36a6606d
4 changed files with 20 additions and 1 deletions
|
|
@ -73,6 +73,7 @@ export const CORE_TO_WEBVIEW_PASS_THROUGH: (keyof ToWebviewFromCoreProtocol)[] =
|
|||
"didChangeAvailableProfiles",
|
||||
"setTTSActive",
|
||||
"getWebviewHistoryLength",
|
||||
"getCurrentSessionId",
|
||||
"signInToControlPlane",
|
||||
"openDialogMessage",
|
||||
"docs/suggestions",
|
||||
|
|
|
|||
|
|
@ -24,6 +24,7 @@ export type ToWebviewFromIdeOrCoreProtocol = {
|
|||
];
|
||||
setTTSActive: [boolean, void];
|
||||
getWebviewHistoryLength: [undefined, number];
|
||||
getCurrentSessionId: [undefined, string];
|
||||
signInToControlPlane: [undefined, void];
|
||||
openDialogMessage: ["account", void];
|
||||
"docs/suggestions": [PackageDocsResult[], void];
|
||||
|
|
|
|||
|
|
@ -754,9 +754,10 @@ const getCommandsMap: (
|
|||
"continue.applyCodeFromChat": () => {
|
||||
void sidebar.webviewProtocol.request("applyCodeFromChat", undefined);
|
||||
},
|
||||
"continue.toggleFullScreen": () => {
|
||||
"continue.toggleFullScreen": async () => {
|
||||
focusGUI();
|
||||
|
||||
const sessionId = await sidebar.webviewProtocol.request("getCurrentSessionId", undefined);
|
||||
// Check if full screen is already open by checking open tabs
|
||||
const fullScreenTab = getFullScreenTab();
|
||||
|
||||
|
|
@ -777,6 +778,7 @@ const getCommandsMap: (
|
|||
vscode.ViewColumn.One,
|
||||
{
|
||||
retainContextWhenHidden: true,
|
||||
enableScripts: true,
|
||||
},
|
||||
);
|
||||
fullScreenPanel = panel;
|
||||
|
|
@ -789,6 +791,13 @@ const getCommandsMap: (
|
|||
undefined,
|
||||
true,
|
||||
);
|
||||
|
||||
panel.onDidChangeViewState(() => {
|
||||
vscode.commands.executeCommand("continue.newSession");
|
||||
if(sessionId){
|
||||
vscode.commands.executeCommand("continue.focusContinueSessionId", sessionId);
|
||||
}
|
||||
});
|
||||
|
||||
// When panel closes, reset the webview and focus
|
||||
panel.onDidDispose(
|
||||
|
|
|
|||
|
|
@ -137,6 +137,14 @@ function useSetup() {
|
|||
[history],
|
||||
);
|
||||
|
||||
useWebviewListener(
|
||||
"getCurrentSessionId",
|
||||
async () => {
|
||||
return sessionId
|
||||
},
|
||||
[sessionId],
|
||||
);
|
||||
|
||||
useWebviewListener("setInactive", async () => {
|
||||
dispatch(setInactive());
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue