Skip to content

feat(fm): destination picker for F5/F6 with >2 open panes#34

Merged
iret77 merged 1 commit into
mainfrom
feat/fm-backlog
Jul 5, 2026
Merged

feat(fm): destination picker for F5/F6 with >2 open panes#34
iret77 merged 1 commit into
mainfrom
feat/fm-backlog

Conversation

@iret77

@iret77 iret77 commented Jul 5, 2026

Copy link
Copy Markdown
Collaborator

What

MC copy/move (F5/F6) picked the single other file-manager pane automatically and, with more than one other pane open, gave up with a "keep exactly two panels" toast. Now it shows a destination picker: a dialog listing every other pane as a host:/path row — pick one to route the copy/move there, Cancel/X aborts. Closes the last non-daemon FM backlog item #12.

How

  • Dialog::CopyMoveTargetPicker { is_move, labels } + render_target_picker / render_target_row (full-width rows; long paths shrink to fit).
  • copy_or_move_to_other_pane refactored so the plan_transfer routing is a shared route_copy_move helper used by both the single-candidate fast path and the picker — every destination goes through the exact same same-fs / upload / download / remote↔remote dispatch, no divergence.
  • Picker state (pending_target_pick) holds the sources + candidate descriptors while the dialog is up; PickCopyMoveTarget(index) routes the choice, Cancel discards it. One mouse-state handle per row so hover/press track independently.

The single-candidate case is unchanged; only the >1 case gained the picker instead of the placeholder toast. All three exhaustive Dialog / SftpBrowserAction matches updated for the new variant.

Verification

  • cargo check -p warp — clean, 0 errors/warnings.
  • cargo test -p warp --lib sftp_manager255 passed, 0 failed, including two new tests:
    • test_f5_with_multiple_panes_opens_target_picker — 3 panes → F5 opens the picker (2 candidates, nothing copied yet); picking routes the copy into exactly the chosen pane.
    • test_target_picker_cancel_copies_nothing — cancelling discards the pending pick.

Files

app/src/sftp_manager/types.rs (dialog variant), dialogs.rs (render), browser.rs (state + routing + action), context_menu.rs (exhaustive match), browser_integration_tests.rs (tests).

🤖 Generated with Claude Code

…is open

MC copy/move (F5/F6) picked the single other file-manager pane automatically
and, with more than one open, gave up with a "keep exactly two panels" toast.
Now it shows a **destination picker**: a dialog listing every other pane as a
`host:/path` row; picking one routes the copy/move there, Cancel/X aborts.

- `Dialog::CopyMoveTargetPicker { is_move, labels }` + `render_target_picker` /
  `render_target_row` (full-width rows, long paths shrink to fit).
- `copy_or_move_to_other_pane` refactored: the plan_transfer routing is now a
  shared `route_copy_move` used by both the single-candidate fast path and the
  picker, so every destination goes through the exact same same-fs / upload /
  download / remote↔remote dispatch.
- Picker state (`pending_target_pick`) holds the sources + candidate descriptors
  while the dialog is up; `PickCopyMoveTarget(index)` routes the choice, Cancel
  discards it. One mouse-state handle per row so hover/press track independently.

The single-pane case is unchanged; only the >1 case gained the picker instead
of the placeholder toast.

Verified: `cargo check -p warp` clean; new integration tests
(`test_f5_with_multiple_panes_opens_target_picker`,
`test_target_picker_cancel_copies_nothing`) plus the existing sftp_manager
suite pass.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@iret77 iret77 merged commit b4d1fa4 into main Jul 5, 2026
2 checks passed
@iret77 iret77 deleted the feat/fm-backlog 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