Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

full screen now opens the current session #3344

Merged
merged 1 commit into from
Dec 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions core/protocol/passThrough.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ export const CORE_TO_WEBVIEW_PASS_THROUGH: (keyof ToWebviewFromCoreProtocol)[] =
"didChangeAvailableProfiles",
"setTTSActive",
"getWebviewHistoryLength",
"getCurrentSessionId",
"signInToControlPlane",
"openDialogMessage",
"docs/suggestions",
Expand Down
1 change: 1 addition & 0 deletions core/protocol/webview.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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];
Expand Down
11 changes: 10 additions & 1 deletion extensions/vscode/src/commands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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();

Expand All @@ -777,6 +778,7 @@ const getCommandsMap: (
vscode.ViewColumn.One,
{
retainContextWhenHidden: true,
enableScripts: true,
},
);
fullScreenPanel = panel;
Expand All @@ -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(
Expand Down
8 changes: 8 additions & 0 deletions gui/src/hooks/useSetup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,14 @@ function useSetup() {
[history],
);

useWebviewListener(
"getCurrentSessionId",
async () => {
return sessionId
},
[sessionId],
);

useWebviewListener("setInactive", async () => {
dispatch(setInactive());
});
Expand Down
Loading