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:
parent
a3f83102f1
commit
55acb0dffb
14 changed files with 6025 additions and 36 deletions
|
|
@ -1,6 +1,6 @@
|
|||
# Architecture
|
||||
|
||||
> **Status:** M0 decisions recorded · **Last updated:** 2026-10-13
|
||||
> **Status:** M0 decisions recorded · **Last updated:** 2026-10-14
|
||||
|
||||
## Overview
|
||||
|
||||
|
|
@ -60,7 +60,7 @@ As built in M0:
|
|||
- Request: `{"id": <number|string>, "method": "<name>", "params": {...}}`. Response: `{"id": ..., "result": ...}` or `{"id": ..., "error": {"code": "...", "message": "..."}}`. A line that is not valid JSON gets an error response with `"id": null`.
|
||||
- Methods (M0): `app.ping`, `engine.execute {command, params}`, `engine.listCommands`, `ui.screenshot {path}`.
|
||||
- `lutra_control` defines a `Backend` trait; the desktop app implements it (engine access, effects, screenshots), tests implement it with a bare engine. One thread accepts connections and each connection gets its own thread; no async runtime is needed in the crate.
|
||||
- Screenshots: the desktop captures its own main window with `xcap` and writes a PNG.
|
||||
- Screenshots: `xcap` does not enumerate windows of its own process (querying their titles can deadlock), so the desktop focuses its main window, reads the client area's physical position and size from Tauri and captures that region of the monitor with `xcap::Monitor::capture_region`. Windows covering Lutra at that moment appear in the image. A webview-native capture (WebView2 `CapturePreview`, WKWebView snapshots) can replace it later.
|
||||
|
||||
## Frontend ↔ engine
|
||||
|
||||
|
|
@ -78,11 +78,13 @@ Theme tokens are defined in Rust (`lutra_engine::theme`) and rendered as CSS cus
|
|||
| Text buffer | `ropey` (MIT) in `crates/text`. | Mature rope with line and UTF-16 helpers. |
|
||||
| Clippy panic lints | `unwrap_used`, `expect_used`, `panic`, `unreachable`, `todo`, `unimplemented`, `indexing_slicing`, `string_slice` are denied workspace-wide; `clippy.toml` allows them in `#[test]`/`#[cfg(test)]`; integration tests in `tests/` and `testkit` allow them at crate level. `missing_docs` is denied too, to back the doc-comment code style. `unsafe_code` is denied; a crate that needs it allows it locally with a doc comment saying why. | AGENTS.md › Never crash. |
|
||||
| Desktop dev mode | Plain `cargo build`/`cargo run -p lutra-desktop` is a Tauri dev build that loads the Vite dev server. `cargo xtask dev [-- ARGS]` starts both. A self-contained build embeds `ui/dist` through the `bundled-ui` feature. | Keeps `cargo build --workspace` independent of the frontend build. |
|
||||
| App identifier | `dev.lutra.desktop` is a placeholder. The final reverse-DNS identifier depends on the project's domain and hosting, which are the owner's decision (execution plan §4); bundling stays off until then. | Tauri requires an identifier to build. |
|
||||
| App icon | A placeholder (rounded otter-brown square with a pale stone) is generated by `apps/lutra-desktop/build.rs` into the gitignored `apps/lutra-desktop/icons/`. | The real icon is the owner's to commission; ASSETS.md allows generated-in-code art. |
|
||||
|
||||
## Revision history
|
||||
|
||||
| Date | Change | Summary |
|
||||
|---|---|---|
|
||||
| 2026-10-14 | minor | Screenshot method, placeholder app identifier |
|
||||
| 2026-10-13 | major | M0: layers metadata, command and guard design, control protocol, open questions decided |
|
||||
| 2026-10-13 | major | Initial draft |
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue