Implement context files feature - verified

- Added Context view with file list sidebar and text/image editor
- Added Context navigation item to sidebar
- Added deleteFile API method to Electron IPC
- Updated coding_prompt.md to include Step 1.5 for loading context files
- Updated mock Electron API to properly handle context directory
- Added test utilities for context view navigation

Features:
- Left panel with list of all context files
- Text editor for editing .md, .txt, and other text files
- Image preview for .png, .jpg, .gif, and other image files
- Add new text or image files via dialog
- Delete files with confirmation dialog
- Drag and drop file upload support
- Auto-save detection with Save button

All Playwright tests passing (9/9)
Deleted test file after verification

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
Cody Seibert
2025-12-09 01:20:56 -05:00
parent d7a32b2314
commit f4df08f9b4
9 changed files with 672 additions and 9 deletions

View File

@@ -146,6 +146,15 @@ ipcMain.handle("fs:stat", async (_, filePath) => {
}
});
ipcMain.handle("fs:deleteFile", async (_, filePath) => {
try {
await fs.unlink(filePath);
return { success: true };
} catch (error) {
return { success: false, error: error.message };
}
});
// App data path
ipcMain.handle("app:getPath", (_, name) => {
return app.getPath(name);

View File

@@ -18,6 +18,7 @@ contextBridge.exposeInMainWorld("electronAPI", {
readdir: (dirPath) => ipcRenderer.invoke("fs:readdir", dirPath),
exists: (filePath) => ipcRenderer.invoke("fs:exists", filePath),
stat: (filePath) => ipcRenderer.invoke("fs:stat", filePath),
deleteFile: (filePath) => ipcRenderer.invoke("fs:deleteFile", filePath),
// App APIs
getPath: (name) => ipcRenderer.invoke("app:getPath", name),