diff --git a/core/protocol/ide.ts b/core/protocol/ide.ts index 6fb9018252..2616a8fdc5 100644 --- a/core/protocol/ide.ts +++ b/core/protocol/ide.ts @@ -103,8 +103,8 @@ export type ToIdeFromWebviewOrCoreProtocol = { lockOverlay: [undefined, void]; unlockOverlay: [undefined, void]; - /* dont overuse invokeVSCodeCommandById, use it only for devving, - and if you find yourself writing redundant code just to invoke a + /* dont overuse invokeVSCodeCommandById, use it only for devving, + and if you find yourself writing redundant code just to invoke a command not related to pearai. (workbench, other extension) */ invokeVSCodeCommandById: [ diff --git a/extensions/vscode/src/commands.ts b/extensions/vscode/src/commands.ts index 800e622a11..989af38c6f 100644 --- a/extensions/vscode/src/commands.ts +++ b/extensions/vscode/src/commands.ts @@ -376,16 +376,16 @@ const commandsMap: ( core.invoke("context/indexDocs", { reIndex: true }); }, "pearai.toggleCreator": async () => { - await handleIntegrationShortcutKey("navigateToCreator", "aiderMode", sidebar, PEAR_OVERLAY_VIEW_ID); + await handleIntegrationShortcutKey("navigateToCreator", "aiderMode", sidebar, [PEAR_OVERLAY_VIEW_ID]); }, "pearai.toggleSearch": async () => { - await handleIntegrationShortcutKey("navigateToSearch", "perplexityMode", sidebar, PEAR_OVERLAY_VIEW_ID); + await handleIntegrationShortcutKey("navigateToSearch", "perplexityMode", sidebar, [PEAR_OVERLAY_VIEW_ID]); }, "pearai.toggleInventory": async () => { - await handleIntegrationShortcutKey("navigateToInventory", "inventory", sidebar, PEAR_OVERLAY_VIEW_ID); + await handleIntegrationShortcutKey("navigateToInventory", "inventory", sidebar, [PEAR_OVERLAY_VIEW_ID, PEAR_CONTINUE_VIEW_ID]); }, "pearai.toggleInventoryHome": async () => { - await handleIntegrationShortcutKey("navigateToInventoryHome", "inventory", sidebar, PEAR_OVERLAY_VIEW_ID); + await handleIntegrationShortcutKey("navigateToInventoryHome", "home", sidebar, [PEAR_OVERLAY_VIEW_ID, PEAR_CONTINUE_VIEW_ID]); }, "pearai.startOnboarding": async () => { if (isFirstLaunch(extensionContext)) { @@ -642,7 +642,7 @@ const commandsMap: ( }, "pearai.aiderMode": async () => { //await openAiderPanel(core, sidebar, extensionContext); - await handleIntegrationShortcutKey("navigateToCreator", "aiderMode", sidebar, PEAR_OVERLAY_VIEW_ID); + await handleIntegrationShortcutKey("navigateToCreator", "aiderMode", sidebar, [PEAR_OVERLAY_VIEW_ID]); }, "pearai.aiderCtrlC": async () => { await aiderCtrlC(core); @@ -658,7 +658,7 @@ const commandsMap: ( }, "pearai.perplexityMode": async () => { // handlePerplexityMode(sidebar, extensionContext); - await handleIntegrationShortcutKey("navigateToSearch", "perplexityMode", sidebar, PEAR_OVERLAY_VIEW_ID); + await handleIntegrationShortcutKey("navigateToSearch", "perplexityMode", sidebar, [PEAR_OVERLAY_VIEW_ID]); }, "pearai.addPerplexityContext": (msg) => { const fullScreenTab = getFullScreenTab(); diff --git a/extensions/vscode/src/util/integrationUtils.ts b/extensions/vscode/src/util/integrationUtils.ts index f2ea21b8fd..5d01241c71 100644 --- a/extensions/vscode/src/util/integrationUtils.ts +++ b/extensions/vscode/src/util/integrationUtils.ts @@ -34,9 +34,9 @@ export function getIntegrationTab(webviewName: string) { }); } -export async function handleIntegrationShortcutKey(protocol: keyof ToWebviewProtocol, integrationName: string, sidebar: ContinueGUIWebviewViewProvider, webview: string) { +export async function handleIntegrationShortcutKey(protocol: keyof ToWebviewProtocol, integrationName: string, sidebar: ContinueGUIWebviewViewProvider, webviews: string[]) { const isOverlayVisible = await vscode.commands.executeCommand('pearai.isOverlayVisible'); - const currentTab = await sidebar.webviewProtocol.request("getCurrentTab", undefined, [webview]); + const currentTab = await sidebar.webviewProtocol.request("getCurrentTab", undefined, webviews); if (isOverlayVisible && currentTab === integrationName) { // close overlay @@ -50,6 +50,6 @@ export async function handleIntegrationShortcutKey(protocol: keyof ToWebviewProt } // Navigate to creator tab via webview protocol - await sidebar.webviewProtocol?.request(protocol, undefined, [webview]); + await sidebar.webviewProtocol?.request(protocol, undefined, webviews); } diff --git a/gui/src/pages/gui.tsx b/gui/src/pages/gui.tsx index afe174e9fe..c0417e3e29 100644 --- a/gui/src/pages/gui.tsx +++ b/gui/src/pages/gui.tsx @@ -4,7 +4,7 @@ import { } from "@heroicons/react/24/outline"; import { JSONContent } from "@tiptap/react"; import { InputModifiers } from "core"; -import { usePostHog } from "posthog-js/react"; +import { PostHog, usePostHog } from "posthog-js/react"; import { Fragment, useCallback, @@ -50,7 +50,7 @@ import { isMetaEquivalentKeyPressed, } from "../util"; import { FREE_TRIAL_LIMIT_REQUESTS } from "../util/freeTrial"; -import { getLocalStorage, setLocalStorage } from "../util/localStorage"; +import { getLocalStorage, setLocalStorage } from "@/util/localStorage"; import OnboardingTutorial from "./onboarding/OnboardingTutorial"; import { setActiveFilePath } from "@/redux/slices/uiStateSlice"; diff --git a/gui/src/pages/onboarding/OnboardingTutorial.tsx b/gui/src/pages/onboarding/OnboardingTutorial.tsx index 922d9c8218..675492b473 100644 --- a/gui/src/pages/onboarding/OnboardingTutorial.tsx +++ b/gui/src/pages/onboarding/OnboardingTutorial.tsx @@ -6,6 +6,7 @@ import { import DelayedMessage from "@/components/DelayedMessage"; import CopyButtonWithText from "@/components/markdown/CopyButtonWithText"; import { Button } from "@/components/ui/button"; +import { setLocalStorage } from "@/util/localStorage"; import { IdeMessengerContext } from "@/context/IdeMessenger"; import useHistory from "@/hooks/useHistory"; import { useWebviewListener } from "@/hooks/useWebviewListener"; @@ -248,7 +249,7 @@ const OnboardingTutorial: React.FC = ({ description: ( <>

- Try asking anything about your entire codebase by typing in prompt then + Try asking anything about your entire codebase by typing in prompt then pressing{" "} {getMetaKeyAndShortcutLabel()} @@ -271,6 +272,11 @@ const OnboardingTutorial: React.FC = ({ <>

Lastly, press{" "} + + {getMetaKeyAndShortcutLabel()} +  1 + {" "} + / {" "} {getMetaKeyAndShortcutLabel()}  E @@ -292,10 +298,13 @@ const OnboardingTutorial: React.FC = ({ const nextPage = () => { setIsTransitioning(true); setSlideDirection("right"); - setCurrentPage((prev) => Math.min(prev + 1, pages.length - 1)); + const nextPageNum = Math.min(currentPage + 1, pages.length - 1); + setCurrentPage(nextPageNum); + if (currentPage === 1) { saveSession(); } + setTimeout(() => setIsTransitioning(false), 600); }; @@ -358,6 +367,26 @@ const OnboardingTutorial: React.FC = ({ [currentPage], ); + useWebviewListener( + "navigateToInventoryHome", + async () => { + if (currentPage === pages.length - 1) { + onClose(); + } + }, + [currentPage, onClose, pages.length] + ); + + useWebviewListener( + "navigateToInventory", + async () => { + if (currentPage === pages.length - 1) { + onClose(); + } + }, + [currentPage, onClose, pages.length] + ); + useEffect(() => { if (currentPage === 3) { const handleEnterKey = (event: KeyboardEvent) => { @@ -451,7 +480,7 @@ const OnboardingTutorial: React.FC = ({ /> ))} -

copy prompts by clicking them
+
copy prompts by clicking them
)}