Skip to content

feat(fm): cross-connection directory transfers (copy + move)#35

Merged
iret77 merged 2 commits into
mainfrom
feat/fm-crossconn
Jul 5, 2026
Merged

feat(fm): cross-connection directory transfers (copy + move)#35
iret77 merged 2 commits into
mainfrom
feat/fm-crossconn

Conversation

@iret77

@iret77 iret77 commented Jul 5, 2026

Copy link
Copy Markdown
Collaborator

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:
    • Upload (local → remote): walk the local tree with WalkDir (parents before children), mkdir on the remote, collect the files to upload.
    • Download (remote → local): walk the remote tree via list_dir, create_dir_all locally, collect the files to download.
    • Returns the per-file (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_transfer runs the plan, then spawns one transfer per file through the existing engine — same per-file progress + cancel as before.
  • Directory move is safe. Every file is copied, and the whole source tree is removed only once all files land successfully. A batch counter (PendingDirMoveCleanup, keyed by a batch id threaded through spawn_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_manager258 passed, 0 failed, including 5 new tests:
    • plan_dir_transfer upload / download / skip-existing (real local fs + an in-memory backend as the remote side, so paths resolve correctly).
    • directory-move cleanup deletes the source on full success and keeps it on any failure.

Files

app/src/sftp_manager/browser.rs (plan + spawn + batch cleanup + transfer routing), browser_integration_tests.rs (tests).

Follow-ups (still open backlog)

  • remote↔remote transfers (relay via a local temp).
  • an overwrite prompt on cross-connection conflicts (today they skip existing, consistent with the pre-existing file path).

🤖 Generated with Claude Code

iret77 and others added 2 commits July 5, 2026 16:07
…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
@iret77 iret77 merged commit 9f8afa6 into main Jul 5, 2026
2 checks passed
@iret77 iret77 deleted the feat/fm-crossconn branch July 5, 2026 15:33
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