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

Switched to toggleOverlay #197

Merged
merged 2 commits into from
Nov 27, 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
2 changes: 1 addition & 1 deletion core/protocol/ideWebview.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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];
Expand Down
6 changes: 3 additions & 3 deletions extensions/vscode/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@
"group": "PearAI"
},
{
"command": "pearai.toggleInventory",
"command": "pearai.toggleOverlay",
"category": "PearAI",
"title": "Toggle PearAI Inventory",
"group": "PearAI"
Expand Down Expand Up @@ -361,7 +361,7 @@
"key": "ctrl+1"
},
{
"command": "pearai.toggleInventory",
"command": "pearai.toggleOverlay",
"mac": "cmd+shift+1",
"key": "ctrl+shift+1"
},
Expand Down Expand Up @@ -484,7 +484,7 @@
"command": "pearai.toggleSearch"
},
{
"command": "pearai.toggleInventory"
"command": "pearai.toggleOverlay"
},
{
"command": "pearai.focusContinueInput"
Expand Down
4 changes: 2 additions & 2 deletions extensions/vscode/src/commands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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]);
Expand Down
5 changes: 2 additions & 3 deletions extensions/vscode/src/util/integrationUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

2 changes: 1 addition & 1 deletion gui/src/pages/inventory.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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) => {
Expand Down
2 changes: 1 addition & 1 deletion gui/src/pages/onboarding/OnboardingTutorial.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -373,7 +373,7 @@ const OnboardingTutorial: React.FC<OnboardingTutorialProps> = ({
);

useWebviewListener(
"navigateToInventory",
"toggleOverlay",
async () => {
if (currentPage === pages.length - 1) {
onClose();
Expand Down