feat(desktop): support file tree drag and rename
Adds double-click rename and internal drag-and-drop moves to the v2 workspace file tree.
The FilesTab root-drop override called private Pierre model methods, so it was removed. Pierre continues to handle supported tree drag targets.
Video example
https://github.com/user-attachments/assets/27a19aa8-7eb7-484d-b4ab-32a3a84f96e8
Tests:
bun test apps/desktop/src/renderer/routes/_authenticated/_dashboard/v2-workspace/$workspaceId/components/WorkspaceSidebar/components/FilesTab/utils/treePath/treePath.test.ts- Focused Biome check
- Desktop typecheck: branch-specific errors resolved; existing unrelated auth/trpc errors remain.
Summary by cubic
Adds double-click rename and internal drag-and-drop moves to the v2 workspace file tree. Renames and moves keep open editors in sync across document paths, dirty buffers, and pane file paths, with folder moves rekeying descendant documents so they reopen with the same identity from their new path.
Details
- Double-clicking a file or folder starts an inline rename; internal drops move the entry on disk, and paths, pane paths, and descendant rekeying commit only after the move succeeds, with failures refreshing the tree and showing an error toast.
- Pane file paths update across tabs, including inactive ones.
- Files no longer open from tree-selection changes; Pierre's selection moves during rename and drag used to open files unintentionally, and every intended open already goes through the click policy.
- Open documents reload when an atomic save replaces them; a move's watcher echo is told from a real replacement by comparing disk content, so dirty buffers survive the echo without an external-change flag.
workspace-fsallows case-only renames on case-insensitive volumes and still rejects hard links to the destination, including case-differing ones.
The root-drop override that called private Pierre model methods is removed; Pierre handles all supported drop targets.
Summary by CodeRabbit
-
New Features
- Added drag-and-drop support for moving files and folders within the workspace file tree.
- Double-clicking a file or folder now starts renaming it.
- Open file panes update when files or folders are moved, including nested paths, while preserving unsaved edits and document state.
-
Bug Fixes
- Prevented invalid or incomplete file moves from being treated as successful.
- Improved handling of file selections and paths after moves.
- Move failures now display an error notification.
- Fixed case-only renames and prevented moves onto a hard link to the source.