feat(#1104): workspace directory CRUD — delete, rename, context menu#1224
feat(#1104): workspace directory CRUD — delete, rename, context menu#1224bergeouss wants to merge 2 commits intonesquena:masterfrom
Conversation
…xt menu The file tree already supported file rename (double-click), file delete (button), and create file/folder. This adds the missing directory operations: Backend: - _handle_file_delete now supports directories when recursive=true (uses shutil.rmtree instead of blocking with an error) Frontend: - Right-click context menu on all file/directory items with Rename and Delete options (follows the project context menu pattern) - Directory delete button (x) with confirmation dialog - _inlineRenameFileItem() for renaming dirs via context menu prompt - Expanded-dir cache is updated on rename/delete to stay consistent - Context menu auto-positions within viewport bounds i18n: delete_dir_confirm, rename_title, rename_prompt in all 7 locales Closes nesquena#1104
|
Thanks for the PR, @bergeouss! Workspace directory CRUD completes the file management story that was partially there for files. Right-click context menu following the existing A few things to verify before merge:
252 workspace/file/i18n tests passing is a good signal. The scope (3 files, closes #1104) is tight. The above are the main things to confirm before merge! |
The inline rename via double-click (nameEl.ondblclick) was not updating the _expandedDirs and _dirCache when renaming a directory, unlike the context-menu rename path (_inlineRenameFileItem) which already had this logic. This could cause the tree view to show stale expand state after a directory was renamed via double-click.
Review Feedback Addressed
Regarding the other points:
🤖 AI-assisted via Hermes Agent |
|
Thanks for following up, @bergeouss! All four points are addressed:
The double-click rename cache fix was the substantive behavioral gap. This looks ready for maintainer merge review. |
|
Merged in v0.50.237 via #1243. Thank you @bergeouss! 🎉 |
Summary
The workspace file tree already supported file rename (double-click), file delete (x button), and create file/folder. This PR adds the missing directory operations.
What changed
Backend (api/routes.py):
_handle_file_deletenow supports directories whenrecursive=true— usesshutil.rmtree()instead of returning an errorFrontend (static/ui.js):
_inlineRenameFileItem()for renaming dirs via context menu (usesshowPromptDialog)i18n (static/i18n.js):
delete_dir_confirm,rename_title,rename_promptin all 7 localesNot included (future)
Test results
Closes #1104