Skip to content

feat(filebrowser): multi-select and Download as Zip - #23

Merged
Atreus-X merged 4 commits into
mainfrom
feat/filebrowser-multiselect-zip
Sep 29, 2026
Merged

Atreus-X merged 4 commits into
mainfrom
feat/filebrowser-multiselect-zip

Conversation

@Atreus-X

Copy link
Copy Markdown
Owner

What

  • Multi-select in the file browser: Ctrl/⌘-click toggles a row, Shift-click selects a range, Ctrl/⌘+A selects all; Esc, plain arrow keys, or changing folder clear it. Selected rows are highlighted (focus stays as before).
  • Right-click a multi-selection: "Download N Items as Zip", Copy File Names / Full File Names / Shell-Quoted names. A single file or folder gets "Download as Zip".
  • /wave/stream-zip (new, pkg/web/streamzip.go): builds the zip on the fly and streams it to Electron's normal download flow (same as "Download File"). Folders are walked recursively; each file is streamed exactly like /wave/stream-file.

Both connection paths

  • No-wsh SSH (SFTP): files open via wshfs.OpenAltStream, folders list via the SFTP AltFs.
  • wsh hosts: files stream through wshfs.FileStream + the RPC stream broker, folders via RemoteListEntries.
  • Local: routed like any wsh://local/… path.
    No 32 MB transfer limit anywhere (no single-message reads), nothing staged on disk.

Details: duplicate top-level names become name (2).ext; files that can't be read are listed in _download-errors.txt inside the zip (the response has already started, so the download still completes); symlinked folders aren't followed; limits 64 levels deep / 200k entries.

Testing

  • Go (streamzip_test.go): the handler against a real temp directory served through the file hooks — nested folders, a 40 MB file (byte-identical after unzip), duplicate names, an unreadable file reported in the errors file; bad requests (no/invalid/empty paths, missing file) return errors.
  • vitest: click/Ctrl/Shift selection, select-all skipping .., right-click targets, zip naming.
  • tsc, go vet, prettier, gofmt.
  • Not yet tried in the app against real SFTP and wsh hosts.

🤖 Generated with Claude Code

https://claude.ai/code/session_01JhvhnSTH8EXbTG9wmtY7dd

- File browser rows support multi-selection: Ctrl/Cmd-click toggles,
  Shift-click selects a range, Ctrl/Cmd+A selects all, Esc / arrow keys /
  changing folder clear it. Selected rows are highlighted.
- Right-click inside a multi-selection: "Download N Items as Zip", plus copy
  file names / full paths / shell-quoted names. Single rows (files or
  folders) get "Download as Zip".
- New /wave/stream-zip endpoint builds the zip on the fly and streams it:
  folders recursively, each file streamed like /wave/stream-file (SFTP for
  no-wsh hosts, wsh streams for wsh hosts, local files too), so there's no
  32 MB transfer limit and nothing is staged on disk. Duplicate top-level
  names get " (2)"; unreadable files are listed in _download-errors.txt in
  the zip instead of failing the download; symlinked folders aren't
  followed. Electron downloads it through the normal download flow.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JhvhnSTH8EXbTG9wmtY7dd
Atreus-X and others added 3 commits September 28, 2026 16:01
…pace)

- Shift+Up/Down/PageUp/PageDown extend the selection from the anchor
  (the focused row if nothing was selected), and can shrink it back
- Ctrl+Up/Down/PageUp/PageDown move the focus without changing the
  selection (a lone focused row becomes explicitly selected first)
- Ctrl+Space adds or removes the focused row
- fix: select-all was bound to Wave's "Cmd", which is Alt on Windows and
  Linux; it's now Ctrl+A there (Cmd+A on macOS), same for the keys above

The table publishes its row order (dirDisplayPaths) so keyboard ranges
follow the sorted display, like Shift-click.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JhvhnSTH8EXbTG9wmtY7dd
Right-click a multi-selection -> "Delete N Items…", or press Delete with
several rows selected. Always asks first, listing the names (up to 8 +
"and N more"); folders in the selection are deleted with their contents.
Items that fail are listed afterwards; the selection clears and the
folder refreshes. Uses FileDeleteCommand, so no-wsh (SFTP), wsh and
local folders all work. Single-row delete is unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JhvhnSTH8EXbTG9wmtY7dd
@Atreus-X
Atreus-X merged commit 087582d into main Sep 29, 2026
2 checks passed
@Atreus-X Atreus-X mentioned this pull request Sep 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant