Feature: File Editor (#789)

* feat: Add file management feature

* feat: Add auto-save functionality to file editor

* fix: Replace HardDriveDownload icon with Save icon for consistency

* fix: Prevent recursive copy/move and improve shell injection prevention

* refactor: Extract editor settings form into separate component
This commit is contained in:
gsxdsm
2026-02-20 16:06:44 -08:00
committed by GitHub
parent 0a5540c9a2
commit 0e020f7e4a
36 changed files with 5513 additions and 11 deletions

View File

@@ -647,6 +647,17 @@ export interface ElectronAPI {
stat: (filePath: string) => Promise<StatResult>;
deleteFile: (filePath: string) => Promise<WriteResult>;
trashItem?: (filePath: string) => Promise<WriteResult>;
copyItem?: (
sourcePath: string,
destinationPath: string,
overwrite?: boolean
) => Promise<WriteResult & { exists?: boolean }>;
moveItem?: (
sourcePath: string,
destinationPath: string,
overwrite?: boolean
) => Promise<WriteResult & { exists?: boolean }>;
downloadItem?: (filePath: string) => Promise<void>;
getPath: (name: string) => Promise<string>;
openInEditor?: (
filePath: string,
@@ -2856,6 +2867,47 @@ function createMockGitAPI(): GitAPI {
},
};
},
getDetails: async (projectPath: string, filePath?: string) => {
console.log('[Mock] Git details:', { projectPath, filePath });
return {
success: true,
details: {
branch: 'main',
lastCommitHash: 'abc1234567890',
lastCommitMessage: 'Initial commit',
lastCommitAuthor: 'Developer',
lastCommitTimestamp: new Date().toISOString(),
linesAdded: 5,
linesRemoved: 2,
isConflicted: false,
isStaged: false,
isUnstaged: true,
statusLabel: 'Modified',
},
};
},
getEnhancedStatus: async (projectPath: string) => {
console.log('[Mock] Git enhanced status:', { projectPath });
return {
success: true,
branch: 'main',
files: [
{
path: 'src/feature.ts',
indexStatus: ' ',
workTreeStatus: 'M',
isConflicted: false,
isStaged: false,
isUnstaged: true,
linesAdded: 10,
linesRemoved: 3,
statusLabel: 'Modified',
},
],
};
},
};
}