diff --git a/core/protocol/ideWebview.ts b/core/protocol/ideWebview.ts index e6683713b4..e251371a03 100644 --- a/core/protocol/ideWebview.ts +++ b/core/protocol/ideWebview.ts @@ -101,7 +101,7 @@ export type ToWebviewFromIdeProtocol = ToWebviewFromIdeOrCoreProtocol & { addPerplexityContextinChat: [{ text: string, language: string }, void]; navigateToCreator: [undefined, void]; navigateToSearch: [undefined, void]; - navigateToInventory: [undefined, void]; + toggleOverlay: [undefined, void]; navigateToInventoryHome: [undefined, void]; getCurrentTab: [undefined, string]; setAiderProcessStateInGUI: [AiderState, void]; diff --git a/extensions/vscode/package.json b/extensions/vscode/package.json index 9bb940b382..3293e653f0 100644 --- a/extensions/vscode/package.json +++ b/extensions/vscode/package.json @@ -171,7 +171,7 @@ "group": "PearAI" }, { - "command": "pearai.toggleInventory", + "command": "pearai.toggleOverlay", "category": "PearAI", "title": "Toggle PearAI Inventory", "group": "PearAI" @@ -361,7 +361,7 @@ "key": "ctrl+1" }, { - "command": "pearai.toggleInventory", + "command": "pearai.toggleOverlay", "mac": "cmd+shift+1", "key": "ctrl+shift+1" }, @@ -484,7 +484,7 @@ "command": "pearai.toggleSearch" }, { - "command": "pearai.toggleInventory" + "command": "pearai.toggleOverlay" }, { "command": "pearai.focusContinueInput" diff --git a/extensions/vscode/src/commands.ts b/extensions/vscode/src/commands.ts index 4f97df4178..13b7554dff 100644 --- a/extensions/vscode/src/commands.ts +++ b/extensions/vscode/src/commands.ts @@ -382,8 +382,8 @@ const commandsMap: ( "pearai.toggleSearch": async () => { await handleIntegrationShortcutKey("navigateToSearch", "perplexityMode", sidebar, [PEAR_OVERLAY_VIEW_ID]); }, - "pearai.toggleInventory": async () => { - await handleIntegrationShortcutKey("navigateToInventory", "inventory", sidebar, [PEAR_OVERLAY_VIEW_ID, PEAR_CONTINUE_VIEW_ID]); + "pearai.toggleOverlay": async () => { + await handleIntegrationShortcutKey("toggleOverlay", "inventory", sidebar, [PEAR_OVERLAY_VIEW_ID, PEAR_CONTINUE_VIEW_ID]); }, "pearai.toggleInventoryHome": async () => { await handleIntegrationShortcutKey("navigateToInventoryHome", "home", sidebar, [PEAR_OVERLAY_VIEW_ID, PEAR_CONTINUE_VIEW_ID]); diff --git a/extensions/vscode/src/util/integrationUtils.ts b/extensions/vscode/src/util/integrationUtils.ts index 5d01241c71..4954b94f4e 100644 --- a/extensions/vscode/src/util/integrationUtils.ts +++ b/extensions/vscode/src/util/integrationUtils.ts @@ -46,10 +46,9 @@ export async function handleIntegrationShortcutKey(protocol: keyof ToWebviewProt if (!isOverlayVisible) { // If overlay isn't open, open it first + // Navigate to creator tab via webview protocol + await sidebar.webviewProtocol?.request(protocol, undefined, webviews); await vscode.commands.executeCommand("pearai.showOverlay"); } - - // Navigate to creator tab via webview protocol - await sidebar.webviewProtocol?.request(protocol, undefined, webviews); } diff --git a/gui/src/pages/inventory.tsx b/gui/src/pages/inventory.tsx index dc785e9558..34d74d1b08 100644 --- a/gui/src/pages/inventory.tsx +++ b/gui/src/pages/inventory.tsx @@ -56,7 +56,7 @@ export default function Inventory() { useWebviewListener("navigateToInventoryHome", () => handleTabChange("home"), []); useWebviewListener("navigateToCreator", () => handleTabChange("aiderMode"), []); useWebviewListener("navigateToSearch", () => handleTabChange("perplexityMode"), []); - useWebviewListener("navigateToInventory", () => handleTabChange("inventory"), []); + useWebviewListener("toggleOverlay", () => handleTabChange("inventory"), []); useWebviewListener("getCurrentTab", async () => activeTab, [activeTab]); const handleTabChange = async (value: string) => { diff --git a/gui/src/pages/onboarding/OnboardingTutorial.tsx b/gui/src/pages/onboarding/OnboardingTutorial.tsx index 2d157cc616..80ac55ab4b 100644 --- a/gui/src/pages/onboarding/OnboardingTutorial.tsx +++ b/gui/src/pages/onboarding/OnboardingTutorial.tsx @@ -373,7 +373,7 @@ const OnboardingTutorial: React.FC = ({ ); useWebviewListener( - "navigateToInventory", + "toggleOverlay", async () => { if (currentPage === pages.length - 1) { onClose();