feat(file-explorer): add SFTP copy/cut/paste with confirmation dialog and duplicate handling - #402
feat(file-explorer): add SFTP copy/cut/paste with confirmation dialog and duplicate handling#402hellonone wants to merge 17 commits into
Conversation
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 2415f93c4c
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
4 条建议已全部处理完毕:
|
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 80f0080b08
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| copy_file_entry(app.clone(), manager.clone(), request).await?; | ||
| delete_remote_file( |
There was a problem hiding this comment.
Do not delete sources when duplicate copy is skipped
When the duplicate strategy is skip, or an ask prompt is answered with Skip, copy_file_entry emits a cancelled transfer but returns Ok(()); this code then immediately deletes the source anyway. A cut-paste onto an existing name can therefore discard the cut file without creating a new copy, so the copy pipeline must report whether it actually copied before deletion is allowed.
Useful? React with 👍 / 👎.
| const sourceParent = getExplorerParentDirectory(entries[0].path, "remote"); | ||
| if (sourceParent && sourceParent === normalizeExplorerPath(targetDir, "remote")) { |
There was a problem hiding this comment.
Reject cuts into a source descendant
For a same-session cut of directory /a, navigating to /a/b and pasting passes this check because the target is not the source's parent. The backend then copies to /a/b/a and recursively deletes /a, which also deletes the newly created destination; reject any cut target that is equal to or nested beneath any source directory.
Useful? React with 👍 / 👎.
| /> | ||
| )} | ||
|
|
||
| <PasteConfirmDialog /> |
There was a problem hiding this comment.
Mount only one global paste-confirm dialog
When the file explorer's secondary pane is open, each FileExplorerPane renders its own FileExplorerDialogs, while every PasteConfirmDialog subscribes to the same global prompt state. A paste therefore opens two overlapping alert dialogs and focus traps for one request; mount this global subscriber once above the per-pane dialog containers.
Useful? React with 👍 / 👎.
|
感谢您的贡献! SFTP 的复制 / 剪切 / 粘贴是一个非常实用的功能,这个 PR 已经把整体框架和不少细节实现得比较完整了。 我这边对于这部分功能还有一些想法,包括交互细节、剪切操作的数据安全以及不同场景下的行为一致性等。后续我会基于这个 PR 的实现继续完善和调整,并整合到主线中。 再次感谢你的贡献! |
功能描述
为文件浏览器增加 复制 / 剪切 / 粘贴 支持,包含快捷键、确认对话框、SFTP 侧重名冲突处理,以及传输完成后的自动目录刷新。 #292
详情
一些特性
截图
其他
大部分功能都已经手动测试,理论上没有问题