feat(fm): cross-connection directory transfers (copy + move)#35
Merged
Conversation
…ections)
Copying/moving a folder between a local and a remote pane (F5/F6) used to
silently skip directories ("N folder(s) skipped"). Now it transfers them
recursively.
- `plan_dir_transfer` (off the main thread) enumerates the source tree and
creates the destination directory structure: upload walks the local tree
and mkdirs on the remote; download walks the remote tree via `list_dir` and
mkdirs locally. It returns the per-file `(local, remote)` work and a count of
files skipped because they already exist on the destination (matching the
single-file cross-connection behaviour; a conflict prompt is a later step).
- `spawn_dir_transfer` runs the plan, then spawns one transfer per file through
the existing engine (progress + cancel per file, as before).
- Directory **move** is safe: every file is copied, and the whole source tree
is removed only once all files have landed successfully — a batch counter
(`PendingDirMoveCleanup`, keyed by a batch id threaded through
`spawn_transfer_with_backend`) tracks completion, and a partial failure keeps
the source (no data loss). The batch is registered before spawning so a
synchronous (test-mode) completion still counts down correctly.
Verified: `cargo check -p warp` clean; new tests pass —
`plan_dir_transfer` upload/download/skip-existing (real local fs + an in-memory
backend as the remote side), and directory-move cleanup deleting the source on
full success / keeping it on failure — alongside the existing sftp_manager suite.
Follow-ups still open: remote↔remote transfers (relay via a local temp) and an
overwrite prompt on cross-connection conflicts.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
# Conflicts: # app/src/sftp_manager/browser.rs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Copying/moving a folder between a local and a remote pane (F5/F6) used to silently skip it (
N folder(s) skipped (not yet across connections)). Now directories transfer recursively, both directions.How
plan_dir_transfer(off the main thread) enumerates the source tree and creates the destination directory structure:WalkDir(parents before children),mkdiron the remote, collect the files to upload.list_dir,create_dir_alllocally, collect the files to download.(local, remote)work plus a count of files skipped because they already exist on the destination (matching the single-file cross-connection behaviour; a conflict prompt is a separate follow-up).spawn_dir_transferruns the plan, then spawns one transfer per file through the existing engine — same per-file progress + cancel as before.PendingDirMoveCleanup, keyed by a batch id threaded throughspawn_transfer_with_backend) tracks completion; a partial failure keeps the source — never a partial data loss. The batch is registered before spawning so a synchronous (test-mode) completion still counts down correctly.Verification
cargo check -p warp— clean, 0 errors/warnings.cargo test -p warp --lib sftp_manager— 258 passed, 0 failed, including 5 new tests:plan_dir_transferupload / download / skip-existing (real local fs + an in-memory backend as the remote side, so paths resolve correctly).Files
app/src/sftp_manager/browser.rs(plan + spawn + batch cleanup + transfer routing),browser_integration_tests.rs(tests).Follow-ups (still open backlog)
🤖 Generated with Claude Code