Skip to content

Commit

Permalink
Added new session
Browse files Browse the repository at this point in the history
  • Loading branch information
nang-dev committed Feb 6, 2025
1 parent 7d1b8a9 commit 95469f4
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 3 deletions.
18 changes: 15 additions & 3 deletions extensions/vscode/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -249,6 +249,13 @@
"icon": "$(add)",
"group": "PearAI"
},
{
"command": "pearai.newSessionSearch",
"category": "PearAI",
"title": "New Search Session",
"icon": "$(add)",
"group": "PearAI"
},
{
"command": "pearai.viewHistory",
"category": "PearAI",
Expand Down Expand Up @@ -576,17 +583,22 @@
{
"command": "pearai.newSession",
"group": "navigation@1",
"when": "view == pearai.chatView || view == pearai.searchView"
"when": "view == pearai.chatView"
},
{
"command": "pearai.newSessionSearch",
"group": "navigation@1",
"when": "view == pearai.searchView"
},
{
"command": "pearai.toggleFullScreen",
"group": "navigation@1",
"when": "view == pearai.chatView || view == pearai.searchView"
"when": "view == pearai.chatView"
},
{
"command": "pearai.viewHistory",
"group": "navigation@1",
"when": "view == pearai.chatView || view == pearai.searchView"
"when": "view == pearai.chatView"
}
],
"editor/title": [
Expand Down
6 changes: 6 additions & 0 deletions extensions/vscode/src/commands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -571,11 +571,17 @@ const commandsMap: (
captureCommandTelemetry("sendToTerminal");
ide.runCommand(text);
},
// Note: Unfortunately I don't see a way to get the view ID passed in as an argument here from package.json, so this is what I have for now -@nang-149
"pearai.newSession": async () => {
sidebar.webviewProtocol?.request("newSession", undefined, [PEAR_CONTINUE_VIEW_ID]);
const currentFile = await ide.getCurrentFile();
sidebar.webviewProtocol?.request("setActiveFilePath", currentFile, [PEAR_CONTINUE_VIEW_ID]);
},
"pearai.newSessionSearch": async () => {
sidebar.webviewProtocol?.request("newSession", undefined, ["pearai.searchView"]);
const currentFile = await ide.getCurrentFile();
sidebar.webviewProtocol?.request("setActiveFilePath", currentFile, ["pearai.searchView"]);
},
"pearai.viewHistory": () => {
sidebar.webviewProtocol?.request("viewHistory", undefined, [
"pearai.chatView",
Expand Down

0 comments on commit 95469f4

Please sign in to comment.