Skip to content

Commit 3291fdf

Browse files
authored
Revert "add authentication (login/signup) and improve search history management" (#1120)
1 parent bd2f2a1 commit 3291fdf

14 files changed

Lines changed: 223 additions & 462 deletions

File tree

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ release
1919
backend/context_files/
2020

2121
# Editor directories and files
22-
.vscode/
22+
.vscode/.debug.env
2323
.idea
2424
.DS_Store
2525
*.suo

.vscode/.debug.script.mjs

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
import fs from 'node:fs'
2+
import path from 'node:path'
3+
import { fileURLToPath } from 'node:url'
4+
import { createRequire } from 'node:module'
5+
import { spawn } from 'node:child_process'
6+
7+
const pkg = createRequire(import.meta.url)('../package.json')
8+
const __dirname = path.dirname(fileURLToPath(import.meta.url))
9+
10+
// write .debug.env
11+
const envContent = Object.entries(pkg.debug.env).map(([key, val]) => `${key}=${val}`)
12+
fs.writeFileSync(path.join(__dirname, '.debug.env'), envContent.join('\n'))
13+
14+
// bootstrap
15+
spawn(
16+
// TODO: terminate `npm run dev` when Debug exits.
17+
process.platform === 'win32' ? 'npm.cmd' : 'npm',
18+
['run', 'dev'],
19+
{
20+
stdio: 'inherit',
21+
env: Object.assign(process.env, { VSCODE_DEBUG: 'true' }),
22+
},
23+
)

.vscode/extensions.json

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
// See http://go.microsoft.com/fwlink/?LinkId=827846
3+
// for the documentation about the extensions.json format
4+
"recommendations": [
5+
"mrmlnc.vscode-json5",
6+
"ms-python.python",
7+
"ms-python.debugpy",
8+
// Linting / Formatting
9+
"esbenp.prettier-vscode",
10+
"dbaeumer.vscode-eslint",
11+
"bradlc.vscode-tailwindcss"
12+
]
13+
}

.vscode/launch.json

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
{
2+
// Use IntelliSense to learn about possible attributes.
3+
// Hover to view descriptions of existing attributes.
4+
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
5+
"version": "0.2.0",
6+
"compounds": [
7+
{
8+
"name": "Debug App",
9+
"preLaunchTask": "Before Debug",
10+
"configurations": [
11+
"Debug Main Process",
12+
"Debug Renderer Process"
13+
],
14+
"presentation": {
15+
"hidden": false,
16+
"group": "",
17+
"order": 1
18+
},
19+
"stopAll": true
20+
}
21+
],
22+
"configurations": [
23+
{
24+
"name": "Debug Main Process",
25+
"type": "node",
26+
"request": "launch",
27+
"runtimeExecutable": "${workspaceRoot}/node_modules/.bin/electron",
28+
"windows": {
29+
"runtimeExecutable": "${workspaceRoot}/node_modules/.bin/electron.cmd"
30+
},
31+
"runtimeArgs": [
32+
"--no-sandbox",
33+
"--remote-debugging-port=9229",
34+
"."
35+
],
36+
"envFile": "${workspaceFolder}/.vscode/.debug.env",
37+
"console": "integratedTerminal"
38+
},
39+
{
40+
"name": "Debug Renderer Process",
41+
"port": 9229,
42+
"request": "attach",
43+
"type": "chrome",
44+
"timeout": 60000,
45+
"skipFiles": [
46+
"<node_internals>/**",
47+
"${workspaceRoot}/node_modules/**",
48+
"${workspaceRoot}/dist-electron/**",
49+
// Skip files in host(VITE_DEV_SERVER_URL)
50+
"http://127.0.0.1:7777/**"
51+
]
52+
},
53+
{
54+
"name": "Debug Python Backend (Attach)",
55+
"type": "debugpy",
56+
"request": "attach",
57+
"connect": {
58+
"host": "localhost",
59+
"port": 5678
60+
},
61+
"pathMappings": [
62+
{
63+
"localRoot": "${workspaceFolder}/backend",
64+
"remoteRoot": "."
65+
}
66+
],
67+
"justMyCode": false
68+
}
69+
]
70+
}

.vscode/settings.json

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
{
2+
"typescript.tsdk": "node_modules/typescript/lib",
3+
"typescript.tsc.autoDetect": "off",
4+
"json.schemas": [
5+
{
6+
"fileMatch": [
7+
"/*electron-builder.json5",
8+
"/*electron-builder.json"
9+
],
10+
"url": "https://json.schemastore.org/electron-builder"
11+
}
12+
],
13+
"cSpell.words": [
14+
"Eigent"
15+
],
16+
"i18n-ally.localesPaths": [
17+
"backend/lang",
18+
"server/lang",
19+
"src/i18n",
20+
"src/i18n/locales"
21+
],
22+
// Prettier & ESLint configuration
23+
"editor.defaultFormatter": "esbenp.prettier-vscode",
24+
"editor.formatOnSave": true,
25+
"editor.codeActionsOnSave": {
26+
"source.fixAll.eslint": "explicit",
27+
"source.organizeImports": "explicit"
28+
},
29+
"[javascript]": {
30+
"editor.defaultFormatter": "esbenp.prettier-vscode"
31+
},
32+
"[javascriptreact]": {
33+
"editor.defaultFormatter": "esbenp.prettier-vscode"
34+
},
35+
"[typescript]": {
36+
"editor.defaultFormatter": "esbenp.prettier-vscode"
37+
},
38+
"[typescriptreact]": {
39+
"editor.defaultFormatter": "esbenp.prettier-vscode"
40+
},
41+
"[json]": {
42+
"editor.defaultFormatter": "esbenp.prettier-vscode"
43+
},
44+
"[jsonc]": {
45+
"editor.defaultFormatter": "esbenp.prettier-vscode"
46+
},
47+
"prettier.requireConfig": true,
48+
"eslint.validate": [
49+
"javascript",
50+
"javascriptreact",
51+
"typescript",
52+
"typescriptreact"
53+
]
54+
}

.vscode/tasks.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
{
77
"label": "Before Debug",
88
"type": "shell",
9-
"command": "node .vscode/.debug.script.js",
9+
"command": "node .vscode/.debug.script.mjs",
1010
"isBackground": true,
1111
"problemMatcher": {
1212
"owner": "typescript",

src/components/SearchHistoryDialog.tsx

Lines changed: 4 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,9 @@
1414

1515
'use client';
1616

17-
import { ScanFace, Search, Trash2 } from 'lucide-react';
17+
import { ScanFace, Search } from 'lucide-react';
1818
import { useEffect, useState } from 'react';
1919

20-
import { proxyFetchDelete } from '@/api/http';
2120
import GroupedHistoryView from '@/components/GroupedHistoryView';
2221
import {
2322
CommandDialog,
@@ -31,7 +30,6 @@ import {
3130
import useChatStoreAdapter from '@/hooks/useChatStoreAdapter';
3231
import { replayProject } from '@/lib';
3332
import { fetchHistoryTasks } from '@/service/historyApi';
34-
import { getAuthStore } from '@/store/authStore';
3533
import { useGlobalStore } from '@/store/globalStore';
3634
import { VisuallyHidden } from '@radix-ui/react-visually-hidden';
3735
import { useTranslation } from 'react-i18next';
@@ -76,35 +74,9 @@ export function SearchHistoryDialog() {
7674
await replayProject(projectStore, navigate, projectId, question, historyId);
7775
};
7876

79-
const handleDelete = async (historyId: string, callback?: () => void) => {
80-
try {
81-
await proxyFetchDelete(`/api/chat/history/${historyId}`);
82-
83-
// Also delete local files for this task if available (via Electron IPC)
84-
const history = historyTasks.find(
85-
(item) => String(item.id) === String(historyId)
86-
);
87-
const { email } = getAuthStore();
88-
if (history?.task_id && (window as any).ipcRenderer) {
89-
try {
90-
await (window as any).ipcRenderer.invoke(
91-
'delete-task-files',
92-
email,
93-
history.task_id,
94-
history.project_id ?? undefined
95-
);
96-
} catch (error) {
97-
console.warn('Local file cleanup failed:', error);
98-
}
99-
}
100-
101-
setHistoryTasks((list) =>
102-
list.filter((item) => String(item.id) !== String(historyId))
103-
);
104-
callback?.();
105-
} catch (error) {
106-
console.error('Failed to delete history task:', error);
107-
}
77+
const handleDelete = (taskId: string) => {
78+
// TODO: Implement delete functionality similar to HistorySidebar
79+
console.log('Delete task:', taskId);
10880
};
10981

11082
const handleShare = (taskId: string) => {
@@ -165,20 +137,6 @@ export function SearchHistoryDialog() {
165137
<div className="overflow-hidden text-ellipsis whitespace-nowrap">
166138
{task.question}
167139
</div>
168-
<Button
169-
type="button"
170-
variant="ghost"
171-
size="icon"
172-
className="text-muted-foreground hover:text-foreground ml-auto"
173-
aria-label="Delete history"
174-
onClick={(e) => {
175-
e.preventDefault();
176-
e.stopPropagation();
177-
void handleDelete(String(task.id));
178-
}}
179-
>
180-
<Trash2 size={16} />
181-
</Button>
182140
</CommandItem>
183141
))}
184142
</CommandGroup>

0 commit comments

Comments
 (0)