1414
1515'use client' ;
1616
17- import { ScanFace , Search , Trash2 } from 'lucide-react' ;
17+ import { ScanFace , Search } from 'lucide-react' ;
1818import { useEffect , useState } from 'react' ;
1919
20- import { proxyFetchDelete } from '@/api/http' ;
2120import GroupedHistoryView from '@/components/GroupedHistoryView' ;
2221import {
2322 CommandDialog ,
@@ -31,7 +30,6 @@ import {
3130import useChatStoreAdapter from '@/hooks/useChatStoreAdapter' ;
3231import { replayProject } from '@/lib' ;
3332import { fetchHistoryTasks } from '@/service/historyApi' ;
34- import { getAuthStore } from '@/store/authStore' ;
3533import { useGlobalStore } from '@/store/globalStore' ;
3634import { VisuallyHidden } from '@radix-ui/react-visually-hidden' ;
3735import { 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