M0.5: Tauri desktop shell with themed main window

The window is built in setup with the theme tokens injected by an
initialization script and the background colour taken from the theme, so
the first frame is already themed. Frontend IPC (engine_execute,
engine_list_commands) and the control channel both run commands through
the Host, which applies effects such as Quit. ui.screenshot captures the
window's client area from the screen because xcap skips windows of its own
process. build.rs generates the placeholder icon into the gitignored
icons/ directory. Verified on Windows: window opens, ping, listCommands,
screenshot, app.quit, and exit status 1 when the control port is taken.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
danny 2026-10-14 18:39:49 +02:00
parent a3f83102f1
commit 55acb0dffb
14 changed files with 6025 additions and 36 deletions

View file

@ -64,7 +64,7 @@ Vue components read engine state (pushed as events) and act through `run(command
## Running and looking at the app
- `cargo xtask dev` starts the desktop app in development mode (Vite + Tauri).
- `cargo run -p lutra-desktop -- --control 7979 [path]` starts it with the JSON control channel. If the port is taken, the app exits with an error; pick another port.
- `cargo xtask dev -- --control 7979 [path]` starts it with the JSON control channel. A plain `cargo run -p lutra-desktop -- --control 7979` works too while `pnpm --dir ui dev` runs; for a self-contained build run `pnpm --dir ui build` and add `--features bundled-ui`. If the port is taken, the app exits with an error; pick another port.
- Drive it with JSON lines on `127.0.0.1:7979`, e.g. `{"id":1,"method":"engine.execute","params":{"command":"project.open","params":{"path":"/tmp/demo"}}}` then `{"id":2,"method":"ui.screenshot","params":{"path":"/tmp/shot.png"}}`. Methods: `crates/control/src/methods.rs`.
- **For UI work, look at the result**: take `ui.screenshot`, read the PNG, and compare it with the public documentation notes in `plan/phpstorm/`. If no frame can be presented (headless machine), cover the component with a Vitest + Vue Test Utils test.
- **Performance:** `lutra perf` checks the budgets (cold start, open a 1 MB file, keystroke to highlight, find in files, index a reference project) on generated and reference projects; `lutra bench PATH` times one project. Run them before and after editor, index or search changes, on an idle machine.