Skip to content

Commit

Permalink
Fixed search history
Browse files Browse the repository at this point in the history
  • Loading branch information
nang-dev committed Feb 7, 2025
1 parent 95469f4 commit 43f4caa
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 6 deletions.
12 changes: 12 additions & 0 deletions extensions/vscode/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -263,6 +263,13 @@
"icon": "$(history)",
"group": "PearAI"
},
{
"command": "pearai.viewHistorySearch",
"category": "PearAI",
"title": "View Search History",
"icon": "$(history)",
"group": "PearAI"
},
{
"command": "pearai.writeCommentsForCode",
"category": "PearAI",
Expand Down Expand Up @@ -599,6 +606,11 @@
"command": "pearai.viewHistory",
"group": "navigation@1",
"when": "view == pearai.chatView"
},
{
"command": "pearai.viewHistorySearch",
"group": "navigation@1",
"when": "view == pearai.searchView"
}
],
"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 @@ -587,6 +587,11 @@ const commandsMap: (
"pearai.chatView",
]);
},
"pearai.viewHistorySearch": () => {
sidebar.webviewProtocol?.request("viewHistory", undefined, [
"pearai.searchView",
]);
},
"pearai.toggleFullScreen": () => {
// Check if full screen is already open by checking open tabs
const fullScreenTab = getFullScreenTab();
Expand Down Expand Up @@ -1039,3 +1044,4 @@ export function registerAllCommands(
);
}
}

7 changes: 6 additions & 1 deletion gui/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,12 @@ const router = createMemoryRouter(
},
{
path: "/history",
element: <History />,
element: <History from={
window.viewType === 'pearai.chatView' ? 'continue' :
window.viewType === 'pearai.searchView' ? 'perplexity' :
window.viewType === 'pearai.mem0View' ? 'aider' :
'continue' // default fallback
}/>
},
{
path: "/stats",
Expand Down
11 changes: 6 additions & 5 deletions gui/src/pages/history.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -136,11 +136,12 @@ function TableRow({
// Save current session
saveSession();
await loadSession(session.sessionId);
if (from === 'continue') {
navigate("/");
} else {
onClose();
}
navigate("/");
// if (from === 'continue') {
// navigate("/");
// } else {
// onClose();
// }
}}
>
<div className="text-md w-100">
Expand Down

0 comments on commit 43f4caa

Please sign in to comment.