feat(UI): Introduce new UI components for file attachments and related views (#191)
Add file management API and UI components Implement directory listing, search and CRUD operations in desktop backend Expose new Files API on frontend to list, search, and modify files
This commit is contained in:
committed by
GitHub
parent
1f23b63c0b
commit
d97181bcd2
@@ -61,6 +61,20 @@ export const createVSCodeFilesAPI = (): FilesAPI => ({
|
||||
};
|
||||
},
|
||||
|
||||
async delete(path: string): Promise<{ success: boolean }> {
|
||||
const target = normalizePath(path);
|
||||
const data = await sendBridgeMessage<{ success: boolean }>('api:fs:delete', { path: target });
|
||||
return { success: Boolean(data?.success) };
|
||||
},
|
||||
|
||||
async rename(oldPath: string, newPath: string): Promise<{ success: boolean; path: string }> {
|
||||
const data = await sendBridgeMessage<{ success: boolean; path: string }>('api:fs:rename', { oldPath, newPath });
|
||||
return {
|
||||
success: Boolean(data?.success),
|
||||
path: typeof data?.path === 'string' ? normalizePath(data.path) : newPath,
|
||||
};
|
||||
},
|
||||
|
||||
async readFile(path: string): Promise<{ content: string; path: string }> {
|
||||
const target = normalizePath(path);
|
||||
const data = await sendBridgeMessage<{ content: string; path: string }>('api:fs:read', { path: target });
|
||||
|
||||
Reference in New Issue
Block a user