Repository navigation
feat(sftp): support drag-and-drop move in SFTP and local file browsers - #1321
Conversation
t8y2
left a comment
There was a problem hiding this comment.
Thanks for the work on this. Three items block merge:
- In-pane drag (internal/workbench/sftp_drag_move.go:309-409, and sftp_window_input.go:402-454) reimplements press/threshold/target/drop/Esc and rect hit-testing by hand. Viva already has ui.DragState (DragSource/DropTarget, Esc cancel), and host_grid.go uses it. Please move the gesture onto it, or explain in the PR why it does not fit the reusable boundary.
- TestSFTPWindowSamePaneDragMoveRemoteLocalAndTree (sftp_drag_move_test.go:414) fails on the Windows CI shard with a timeout in the local same-pane move step, while it passes on Linux. Please find out whether the local rename fails on Windows (and include view.errorText in the failure message) or whether the wait is too short.
- internal/workbench/sftp.go:99-100 is not gofmt-formatted, which fails the Format and vet job. The branch also conflicts with main in the rename/remove case of pumpSFTP, so it needs a rebase.
86a14dd to
de35279
Compare
|
Thanks for the review! All three items have been addressed in the updated commit (
|
t8y2
left a comment
There was a problem hiding this comment.
感谢重做:docked 面板的拖拽现在走 ui.DragState,gofmt 干净,与 main 的冲突也没了,之前提的大部分问题已解决。还有一项阻塞合并:
internal/workbench/sftp_drag_move_test.go:435 的 TestSFTPWindowSamePaneDragMoveRemoteLocalAndTree 在 CI 的 Workbench (Windows, autocrlf, 1/5) 分片仍然失败,把等待加到 20s 也没用。失败信息是 status="Moved ...local_file.txt to ...local_sub\local_file.txt"、busy=false、errorText 为空,但 localRows 没变,也就是 os.Rename 已成功,列表没刷新或「行消失」的判断在 Windows 上不成立。怀疑是 finishLocalMove(sftp_drag_move.go:215-221)里按词法路径比较,t.TempDir() 的 8.3 短路径(RUNNER~1)和规范路径对不上。请在 Windows 上复现,按文件标识(os.SameFile 或 sameDirectoryTreeLocation)比较,不要靠加大超时。
不挡本 PR 的后续项:本地移动先 Lstat 目标再 os.Rename,两步之间目标被创建会被静默覆盖;拖到另一个卷上会返回 EXDEV 且没有复制再删除的回退(失败时源文件原样保留,不丢数据)。
de35279 to
bdabaab
Compare
Thanks for the spot-on diagnosis! It was indeed the lexical path comparison failing on Windows 8.3 short paths ( The branch has been updated with file-identity comparisons:
|
|
Thanks for the contribution! Merged in 5806f9d, will be released in the next version. |
Closes #1282
Summary
Adds drag-and-drop move support for files and folders across both SFTP and local file browsing surfaces:
Verification