Explorer: file operations with the mouse and keyboard, drag-and-drop, uploads #54

Closed
opened 2026-10-22 21:25:05 -04:00 by jared · 0 comments
Owner

The explorer could only browse and create files through a dialog. It now works like VS Code's.

Mouse

  • Right-click a file, a folder or empty space for a menu: Open / Open preview / Open changes, New file…, New folder…, Upload files here…, Cut, Copy, Paste, Duplicate, Copy path, Copy relative path, Mention to Claude (@path), Download, Rename…, Delete.
  • Ctrl/⌘+click and Shift+click select several items.
  • Drag items onto a folder to move them; hold Ctrl/Alt to copy. A closed folder opens when you hover it. Dropping a folder into itself is refused.
  • Drag files or whole folders from the desktop onto a folder (or anywhere in the pane) to upload them, keeping their structure. A name clash asks once: Replace, Skip or Keep both ("name (1).ext"), with "do this for the rest too". Progress shows at the bottom.
  • Drag a file or a tab onto the terminal to type @path into Claude's prompt.
  • The toolbar has New file, New folder, Upload and Collapse all.

Keyboard

  • F2 renames in place: the name box selects the name without its extension.
  • Delete moves to the trash, after asking.
  • Ctrl+C / Ctrl+X / Ctrl+V copy, cut and paste files; pasting files copied on the desktop uploads them.
  • Ctrl+A selects all; ⇧+arrows extend the selection; Esc clears a multi-selection or a cut.

Safety

  • Delete goes to a per-session trash in /var/lib/devdesk/trash/ for 7 days, and the toast's Undo restores it.
  • Nothing is overwritten unless you choose Replace.
  • Symlinks are moved and deleted as links, never followed.
  • Every path stays inside the session folder.

Server: --fs-mkdir, --fs-move, --fs-copy, --fs-delete, --fs-restore, --fs-put (any file up to 25 MB) and --fs-download, in libexec/devdesk-fsops.sh, with bats tests.

Found while testing

  • An escape bug. Bash's set -e doesn't reach into $(...), so a failed check inside a nested capture carried on with an empty path. fs-mkdir out/x, with out a symlink pointing outside the session folder, created /x. Every nested capture now ends in || exit 1, a second dd_fs_inside guard checks each result, and a test asserts /x is never created. (The empty /x from that test run was removed.)
  • A stale-tree race. A folder listing still in flight could overwrite a newer one. The newest request now always wins.
  • sessionAction didn't return the server's JSON. The 0.10.3 change never applied, so "Close split panes" always said "No split panes".
The explorer could only browse and create files through a dialog. It now works like VS Code's. **Mouse** - Right-click a file, a folder or empty space for a menu: Open / Open preview / Open changes, New file…, New folder…, Upload files here…, Cut, Copy, Paste, Duplicate, Copy path, Copy relative path, Mention to Claude (@path), Download, Rename…, Delete. - Ctrl/⌘+click and Shift+click select several items. - Drag items onto a folder to move them; hold Ctrl/Alt to copy. A closed folder opens when you hover it. Dropping a folder into itself is refused. - Drag files or whole folders from the desktop onto a folder (or anywhere in the pane) to upload them, keeping their structure. A name clash asks once: Replace, Skip or Keep both ("name (1).ext"), with "do this for the rest too". Progress shows at the bottom. - Drag a file or a tab onto the terminal to type `@path` into Claude's prompt. - The toolbar has New file, New folder, Upload and Collapse all. **Keyboard** - F2 renames in place: the name box selects the name without its extension. - Delete moves to the trash, after asking. - Ctrl+C / Ctrl+X / Ctrl+V copy, cut and paste files; pasting files copied on the desktop uploads them. - Ctrl+A selects all; ⇧+arrows extend the selection; Esc clears a multi-selection or a cut. **Safety** - Delete goes to a per-session trash in `/var/lib/devdesk/trash/` for 7 days, and the toast's **Undo** restores it. - Nothing is overwritten unless you choose Replace. - Symlinks are moved and deleted as links, never followed. - Every path stays inside the session folder. **Server:** `--fs-mkdir`, `--fs-move`, `--fs-copy`, `--fs-delete`, `--fs-restore`, `--fs-put` (any file up to 25 MB) and `--fs-download`, in `libexec/devdesk-fsops.sh`, with bats tests. **Found while testing** - **An escape bug.** Bash's `set -e` doesn't reach into `$(...)`, so a failed check inside a nested capture carried on with an empty path. `fs-mkdir out/x`, with `out` a symlink pointing outside the session folder, created `/x`. Every nested capture now ends in `|| exit 1`, a second `dd_fs_inside` guard checks each result, and a test asserts `/x` is never created. (The empty `/x` from that test run was removed.) - **A stale-tree race.** A folder listing still in flight could overwrite a newer one. The newest request now always wins. - **`sessionAction` didn't return the server's JSON.** The 0.10.3 change never applied, so "Close split panes" always said "No split panes".
jared closed this issue 2026-10-22 21:25:44 -04:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: LotusGuild/devdesk#54