diff --git a/core/protocol/ideWebview.ts b/core/protocol/ideWebview.ts index 0a7dc19a74..488c80ebce 100644 --- a/core/protocol/ideWebview.ts +++ b/core/protocol/ideWebview.ts @@ -55,7 +55,7 @@ export type ToIdeFromWebviewProtocol = ToIdeFromWebviewOrCoreProtocol & { isSupermavenInstalled: [undefined, boolean]; uninstallVscodeExtension: [{ extensionId: string }, void]; completeWelcome: [undefined, void]; - openInventory: [undefined, void]; + openInventoryHome: [undefined, void]; getUrlTitle: [string, string]; pearAIinstallation: [{tools: ToolType[], installExtensions: boolean}, void]; }; diff --git a/extensions/vscode/src/extension/VsCodeMessenger.ts b/extensions/vscode/src/extension/VsCodeMessenger.ts index 3ffc8916ab..92e6419cf3 100644 --- a/extensions/vscode/src/extension/VsCodeMessenger.ts +++ b/extensions/vscode/src/extension/VsCodeMessenger.ts @@ -164,7 +164,7 @@ export class VsCodeMessenger { } return 0; }); - this.onWebview("openInventory", (msg) => { + this.onWebview("openInventoryHome", (msg) => { vscode.commands.executeCommand("pearai.toggleInventoryHome"); }); this.onWebview("pearAIinstallation", (msg) => { diff --git a/gui/src/components/ShortcutContainer.tsx b/gui/src/components/ShortcutContainer.tsx index 8e64cf622f..076df3fea9 100644 --- a/gui/src/components/ShortcutContainer.tsx +++ b/gui/src/components/ShortcutContainer.tsx @@ -124,6 +124,12 @@ const ShortcutContainer = () => { }; const shortcuts = [ + { + modifiers: [modifier], + keyCode: "E", + description: "Open Inventory", + onClick: () => ideMessenger.post("openInventoryHome", undefined), + }, { modifiers: [modifier], keyCode: "\\", diff --git a/gui/src/components/mainInput/TipTapEditor.tsx b/gui/src/components/mainInput/TipTapEditor.tsx index 5fca27d9c0..bea78779c5 100644 --- a/gui/src/components/mainInput/TipTapEditor.tsx +++ b/gui/src/components/mainInput/TipTapEditor.tsx @@ -57,8 +57,6 @@ import { } from "./getSuggestion"; import { ComboBoxItem } from "./types"; import { useLocation } from "react-router-dom"; -import ActiveFileIndicator from "./ActiveFileIndicator"; -import { setActiveFilePath } from "@/redux/slices/uiStateSlice"; import TopBar from "./TopBarIndicators"; import { isAiderMode, isPerplexityMode } from "../../util/bareChatMode"; @@ -969,8 +967,8 @@ const TipTapEditor = memo(function TipTapEditor({ }); event.preventDefault(); }} - > - {(!isPerplexity && !isAider) && } + > + {/* {(!isPerplexity && !isAider) && } */} { - ideMessenger.post("openInventory", undefined); + ideMessenger.post("openInventoryHome", undefined); } return ( - - - {getMetaKeyLabel()}+1 Inventory + + ); }; \ No newline at end of file diff --git a/gui/src/components/mainInput/resolveInput.ts b/gui/src/components/mainInput/resolveInput.ts index 9d9ab3b859..bd7f5ec327 100644 --- a/gui/src/components/mainInput/resolveInput.ts +++ b/gui/src/components/mainInput/resolveInput.ts @@ -118,35 +118,36 @@ async function resolveEditorContent( } } - const defaultModelTitle = (store.getState() as any).state.defaultModelTitle; - const excludeDirStructure = - defaultModelTitle?.toLowerCase() && - EXCLUDE_DIR_STRUCTURE.some((term) => - defaultModelTitle.toLowerCase().includes(term), - ); - - if (!excludeDirStructure) { - const previousDirectoryItems = (store.getState() as any).state - .directoryItems; - // use directory structure - const directoryItems = await ideMessenger.request( - "context/getContextItems", - { - name: "directory", - query: "", - fullInput: stripImages(parts), - selectedCode, - }, - ); - - if (previousDirectoryItems !== directoryItems[0].content) { - store.dispatch(setDirectoryItems(directoryItems[0].content)); - contextItems.push(...directoryItems); - for (const codebaseItem of directoryItems) { - contextItemsText += codebaseItem.content + "\n\n"; - } - } - } + // Depreciated DirStructure on every request (-nang) + // const defaultModelTitle = (store.getState() as any).state.defaultModelTitle; + // const excludeDirStructure = + // defaultModelTitle?.toLowerCase() && + // EXCLUDE_DIR_STRUCTURE.some((term) => + // defaultModelTitle.toLowerCase().includes(term), + // ); + + // if (!excludeDirStructure) { + // const previousDirectoryItems = (store.getState() as any).state + // .directoryItems; + // // use directory structure + // const directoryItems = await ideMessenger.request( + // "context/getContextItems", + // { + // name: "directory", + // query: "", + // fullInput: stripImages(parts), + // selectedCode, + // }, + // ); + + // if (previousDirectoryItems !== directoryItems[0].content) { + // store.dispatch(setDirectoryItems(directoryItems[0].content)); + // contextItems.push(...directoryItems); + // for (const codebaseItem of directoryItems) { + // contextItemsText += codebaseItem.content + "\n\n"; + // } + // } + // } // cmd+enter to use codebase if (modifiers.useCodebase) { diff --git a/gui/src/hooks/useChatHandler.ts b/gui/src/hooks/useChatHandler.ts index 3ebffa7ef0..497cf51548 100644 --- a/gui/src/hooks/useChatHandler.ts +++ b/gui/src/hooks/useChatHandler.ts @@ -92,7 +92,7 @@ function useChatHandler(dispatch: Dispatch, ideMessenger: IIdeMessenger, source: } }) ); - + dispatch(setPerplexityCitations(citationsWithTitles)); } @@ -208,34 +208,34 @@ function useChatHandler(dispatch: Dispatch, ideMessenger: IIdeMessenger, source: ideMessenger, ); - // Automatically use currently open file - if (source === 'continue' && (!modifiers.noContext || useActiveFile) && (history.length === 0 || index === 0)) { - const usingFreeTrial = defaultModel.provider === "free-trial"; + // Depreciated: Automatically use currently open file (-nang) + // if (source === 'continue' && (!modifiers.noContext || useActiveFile) && (history.length === 0 || index === 0)) { + // const usingFreeTrial = defaultModel.provider === "free-trial"; - const currentFilePath = await ideMessenger.ide.getCurrentFile(); - if (typeof currentFilePath === "string") { - let currentFileContents = - await ideMessenger.ide.readFile(currentFilePath); - if (usingFreeTrial) { - currentFileContents = currentFileContents - .split("\n") - .slice(0, 1000) - .join("\n"); - } - contextItems.unshift({ - content: `The following file is currently open. Don't reference it if it's not relevant to the user's message.\n\n\`\`\`${getRelativePath( - currentFilePath, - await ideMessenger.ide.getWorkspaceDirs(), - )}\n${currentFileContents}\n\`\`\``, - name: `Active file: ${getBasename(currentFilePath)}`, - description: currentFilePath, - id: { - itemId: currentFilePath, - providerTitle: "file", - }, - }); - } - } + // const currentFilePath = await ideMessenger.ide.getCurrentFile(); + // if (typeof currentFilePath === "string") { + // let currentFileContents = + // await ideMessenger.ide.readFile(currentFilePath); + // if (usingFreeTrial) { + // currentFileContents = currentFileContents + // .split("\n") + // .slice(0, 1000) + // .join("\n"); + // } + // contextItems.unshift({ + // content: `The following file is currently open. Don't reference it if it's not relevant to the user's message.\n\n\`\`\`${getRelativePath( + // currentFilePath, + // await ideMessenger.ide.getWorkspaceDirs(), + // )}\n${currentFileContents}\n\`\`\``, + // name: `Active file: ${getBasename(currentFilePath)}`, + // description: currentFilePath, + // id: { + // itemId: currentFilePath, + // providerTitle: "file", + // }, + // }); + // } + // } const message: ChatMessage = { role: "user", diff --git a/gui/src/pages/onboarding/OnboardingTutorial.tsx b/gui/src/pages/onboarding/OnboardingTutorial.tsx index 675492b473..2d157cc616 100644 --- a/gui/src/pages/onboarding/OnboardingTutorial.tsx +++ b/gui/src/pages/onboarding/OnboardingTutorial.tsx @@ -272,11 +272,6 @@ const OnboardingTutorial: React.FC = ({ <> Lastly, press{" "} - - {getMetaKeyAndShortcutLabel()} - 1 - {" "} - / {" "} {getMetaKeyAndShortcutLabel()} E
Lastly, press{" "} - - {getMetaKeyAndShortcutLabel()} - 1 - {" "} - / {" "} {getMetaKeyAndShortcutLabel()} E