feat(fm): destination picker for F5/F6 with >2 open panes#34
Merged
Conversation
…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>
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
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:/pathrow — 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_panerefactored so theplan_transferrouting is a sharedroute_copy_movehelper 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.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/SftpBrowserActionmatches updated for the new variant.Verification
cargo check -p warp— clean, 0 errors/warnings.cargo test -p warp --lib sftp_manager— 255 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