mirror of
https://github.com/AutoMaker-Org/automaker.git
synced 2026-03-18 10:23:07 +00:00
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:
@@ -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',
|
||||
},
|
||||
],
|
||||
};
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user