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` |

View file

@ -1,6 +1,6 @@
# Deployment
> **Status:** Deployment v1 (C9 D1, owner decision D27): servers per project, upload, download, upload on save, test connection, host keys, Deployment log. Remote browser, compare and sync follow in D2 · **Last updated:** 2026-11-06
> **Status:** Deployment v1 (C9 D1, owner decision D27): servers per project, upload, download, upload on save, test connection, host keys, Deployment log. v2 (C9 D2): Remote Host browser, compare with the server, sync with a preview, save before upload · **Last updated:** 2026-11-06
Lutra uploads a PHP project to a server and downloads files back, the way people deploy shared hosting and small servers every day.
@ -41,14 +41,29 @@ Uploads and downloads never ask about a key; they fail with a message pointing t
- **Project tree:** right-click a file or folder › **Upload to Server** / **Download from Server** (default server).
- **Tools › Deployment:** Upload Current File, Download Current File, Upload Project, Test Connection, Deployment Log.
- The same actions are in the command palette. Lutra assigns no default shortcuts; bind them in the keymap.
- Uploads send what is on disk; save first. Downloads replace the local files.
- An upload first saves the open, unsaved files it covers, so the server gets what the editor shows. Downloads replace the local files.
- While a job runs, the status bar shows it with a Cancel button. One job runs at a time; uploads on save wait for the running one.
- Every file, skip and error goes to the **Deployment** log in the bottom panel (newest 1,000 lines). A failing file is logged and the job goes on; a lost connection or a refused sign-in stops it. Each error says what to do.
## Remote Host
**Tools › Deployment › Remote Host** opens the server's folders in the bottom panel (the default server; choose another in the toolbar). Paths are relative to the server's root folder; the browser never leaves it.
- Click a folder to expand it, a file to open it. Files open **read-only**; **Edit** makes the text editable and **Upload** writes it back. Files that are not text, or larger than 4 MiB, are not shown.
- **Rename** and **Delete on Server** are on each row; **New Folder** goes into the selected folder. Delete always asks first, names what goes (a folder with everything inside it), and only the red button deletes. The root folder cannot be deleted.
## Compare and sync
- **Compare with Server** on a file (project tree, or Tools › Deployment › Compare Current File with Server) opens the diff viewer: the server's copy on the left (read-only), your working copy on the right (editable as usual).
- On a folder, or **Sync Project with Server…**, Lutra lists every file that differs: only in the project, only on the server, or changed (sizes first, then contents up to 8 MiB per file; larger files of equal size count as equal). Excluded and unmapped files are left out.
- The preview selects the uploads (new and changed files). Files only on the server would be **deleted on the server**; they are never selected for you, and once you select one, Sync stays disabled until you tick "I understand that … files will be deleted on the server". Sync goes from the project to the server only; to take a server change into the project, use Download.
## For agents and scripts
The `deploy.*` engine commands (`deploy.servers`, `deploy.saveServer`, `deploy.setSecret`, `deploy.testConnection`, `deploy.trustHostKey`, `deploy.upload`, `deploy.download`, `deploy.cancel`, `deploy.log`, …) work over the control channel and MCP like every command; see `docs/architecture.md` › Deployment. Their results never contain a secret.
The `deploy.*` engine commands (`deploy.servers`, `deploy.saveServer`, `deploy.setSecret`, `deploy.testConnection`, `deploy.trustHostKey`, `deploy.upload`, `deploy.download`, `deploy.browse`, `deploy.readRemote`, `deploy.writeRemote`, `deploy.renameRemote`, `deploy.mkdirRemote`, `deploy.deleteRemote`, `deploy.compare`, `deploy.sync`, `deploy.cancel`, `deploy.log`, …) work over the control channel and MCP like every command; see `docs/architecture.md` › Deployment. Their results never contain a secret. `deploy.deleteRemote` refuses without `confirm: true`, and `deploy.sync` refuses deletions without `confirmDelete: true`: an agent must have asked the user.
## Not yet (D2)
## Not yet
A remote file browser, opening and editing remote files, compare with the server, and sync with a preview.
- Remote files open in the Remote Host viewer, not as editor tabs with highlighting.
- FTPS accepts only certificates the system trusts; servers with a self-signed certificate cannot be pinned yet.
- Linux has no keychain store yet.

View file

@ -22,7 +22,7 @@ Every known shortfall, ranked. This is the work list: unless the owner gives a t
| G14 | Localization: English and German interface: ~~English message catalog for UI strings~~ (M1.11), engine messages (`EngineError.message`) as message keys, language switch, plurals, German catalog | later | ~38 h |
| G15 | Database tools, HTTP client, Docker and remote | later | ~430 h |
| G16 | Plug-ins and ecosystem | later | ~120 h |
| G17 | Deployment: **v1 done (C9 D1)**: SFTP, FTP, FTPS and folder servers per project, path mappings, excluded paths, upload/download of files and folders, upload on save (off by default), test connection, host-key check, keychain secrets, Deployment log. Open (D2): remote browser, edit remote files, compare with server, sync with preview | M7 | ~40 h |
| G17 | Deployment: **v1 + v2 done (C9 D1, D2)**: SFTP, FTP, FTPS and folder servers per project, path mappings, excluded paths, upload/download, upload on save, save before upload, host-key check, keychain secrets, Deployment log, Remote Host browser (view, edit and upload, rename, delete after a question, new folder), compare (file diff, folder list), sync with preview and confirmed deletions. Open: remote files as highlighted editor tabs, FTPS certificate pinning, Linux keychain | M7 | ~12 h |
| G18 | Editor productivity: Local History, live and file templates, postfix completion, code generation, intention actions, auto import, scratch files, macros, compare files/folders, TODO view, language injections, code style/formatter | M6–M7 | ~400 h |
| G19 | Remote development and Dev Containers | M9 | ~200 h |
| G20 | AI features (chat, inline prompts, commit messages); MCP server is G7/M3 | M9 | ~60 h |
@ -55,6 +55,7 @@ G6 progress: M3.2 landed the LSP client library in `crates/lsp`: JSON-RPC framin
| Date | Change | Summary |
|---|---|---|
| 2026-11-06 | patch | G17: deployment v2 (C9 D2): remote browser, compare, sync |
| 2026-11-06 | patch | G17: deployment v1 (C9 D1); remote browser, compare and sync left for D2 |
| 2026-11-06 | minor | G3: more themes, theme import, editor font settings (C9 T1) |
| 2026-11-01 | patch | G8: chunk staging, unstaging and revert from the gutter and the diff viewer (C8 C3) |