D2: Remote Host browser, compare and sync preview in the UI; docs and G17
Some checks failed
ci / ci (macos-15) (push) Has been cancelled
ci / ci (ubuntu-24.04) (push) Has been cancelled
ci / ci (windows-2025) (push) Has been cancelled

Remote Host tool window (server select, tree, read-only viewer with Edit
and Upload, rename, new folder, delete after its question), server tabs
in the diff viewer, sync preview (uploads preselected, deletions never,
extra confirmation before deleting on the server), Compare with Server
in the tree menu and Tools › Deployment.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
danny 2026-11-06 19:49:53 +01:00
parent 7601ce12f6
commit 1c6c67194a
16 changed files with 1813 additions and 19 deletions

View file

@ -762,6 +762,13 @@ Watched directories: the VFS watcher is non-recursive, so `project.children` wat
- **UI (`ui/src/components/deploy/`):** `deploy.ts` store, `DeployStatusItem.vue` (progress, Cancel, the `deployment.*` UI commands), `DeploymentDialog.vue` (exclusive modal `deployment`; write-only secret field; host-key question), `DeploymentLogToolWindow.vue` (bottom panel). The project tree's context menu gains Upload/Download for files and folders.
- **Tests:** `crates/deploy/tests/transfer.rs` (7: host key first use and mismatch, password and key sign-in, upload, download, cancel, FTP, unreachable), `crates/engine/tests/deploy.rs` (4, including a grep of every event, value, error and the config and data directories for the test password), `ui/tests/deploy/Deploy.test.ts` (12).
### Remote browser, compare and sync (C9 D2)
- **Crate:** `Remote` gains `remove_file`, `remove_dir`, `rename` (SFTP, FTP, folder; the test servers too: SFTP `rename`, FTP `RMD`, `DELE`, `RNFR`/`RNTO`). `browse`: browser paths relative to the root (absolute and `..` refused); `list` (folders first), `read` (`Target::Mapped` project path or `Target::Browser` path; at most 4 MiB, NUL or invalid UTF-8 → binary, missing → `text: None`), `write` (creates the folder), `rename`, `mkdir`, `delete` (recursive, never the root). `job::compare` walks the local tree and the remote listings (sizes from the server; `walk_remote_tree` also serves downloads now) and reports `localOnly`, `remoteOnly`, `different` (size, then contents up to 8 MiB); `job::sync` uploads files and deletes listed files in one connection; `Summary.deleted`.
- **Engine (`cmd/deploy_remote.rs`):** `deploy.browse {path?, id?}`, `deploy.readRemote {path | remotePath, id?}` (answers like `git.show`: `{text, binary, tooLarge}`), `deploy.writeRemote {remotePath, text, id?}`, `deploy.renameRemote {from, to, id?}`, `deploy.mkdirRemote {path, id?}`, `deploy.deleteRemote {path, confirm: true, id?}`, `deploy.compare {paths, id?}`, `deploy.sync {upload?, delete?, confirmDelete, id?}`. Same job slot and events as D1. Missing confirmations are `invalid_params` before any connection. `deploy.upload {saveFirst?}` (default true) saves the dirty buffers under its paths through `file::save_buffer` while `DeployState.saving` keeps those saves from queueing uploads on save.
- **UI:** `remoteBrowser.ts` store; `RemoteBrowserToolWindow.vue` (bottom panel tab `remote`: server select, tree, inline rename / new folder / delete question, read-only viewer with Edit and Upload); `SyncDialog.vue` (exclusive modal `deploySync`); the diff store's server tabs (`DiffTab.remote`, `openRemote`, left side from `deploy.readRemote`). UI commands `deployment.browse`, `deployment.compare {path?, kind?}`, `deployment.sync`; the tree menu adds Compare with Server.
- **Tests:** `crates/deploy/tests/remote.rs` (2: the whole browser, compare and sync scenario over SFTP and over FTP), `crates/engine/tests/deploy.rs` (+1: commands, refused unconfirmed deletes, sync, save before upload), `ui/tests/deploy/RemoteBrowser.test.ts` (6).
## Decisions (M0)
| Question | Decision | Why |
@ -782,6 +789,7 @@ Watched directories: the VFS watcher is non-recursive, so `project.children` wat
| Date | Change | Summary |
|---|---|---|
| 2026-11-06 | minor | C9 D2: remote browser, compare and sync; save before upload |
| 2026-11-06 | minor | C9 D1: `crates/deploy` (L3), `deploy.*` commands, deployment events and UI |
| 2026-11-02 | minor | C9 F1: `Kind::Path` and `check_path` (one validator for `settings.set` and the dialog, `path` in `settings.list`), `lutra_proc::spawn_detached` for the CLI's desktop start |
| 2026-10-31 | minor | C7 B1: app identifier `com.tyrveil.lutra` with the one-time copy from `dev.lutra.desktop`, NSIS and DMG installers, `cargo xtask bundle` |