PM: merge F2b explain screenshot timeouts
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
commit
232a596ba2
3 changed files with 95 additions and 5 deletions
|
|
@ -64,7 +64,7 @@ As built in M0:
|
|||
- Methods: `app.ping`, `app.auth {token}`, `app.focus`, `engine.execute {command, params}`, `engine.listCommands`, `ui.screenshot {path}`, `events.subscribe`. Names and docs live in `crates/control/src/methods.rs`.
|
||||
- `events.subscribe` answers `{subscribed: true}` and from then on writes `{"event": {...}}` lines for every engine event on that connection, between responses; a shared writer writes each line whole. Subscribing twice is a no-op. Each subscriber has a queue of 4096 events (`lutra_control::EVENT_QUEUE`); a subscriber that falls behind or disconnects is dropped by `Subscribers::publish`, and the connection gets a final `{"event": {"kind": "subscriptionLost"}}` line if it is still open.
|
||||
- `lutra_control` defines a `Backend` trait; the desktop app implements it (engine access, effects, screenshots, event subscribers), tests implement it with a bare engine (`lutra_testkit::EngineBackend`). Hosts publish each outcome's events through `lutra_control::Subscribers`. One thread accepts connections and each connection gets its own thread; no async runtime is needed in the crate.
|
||||
- Screenshots never focus, raise or show the window; `app.focus` is the only method that does. On Windows the webview captures itself with WebView2 `CapturePreview` (PNG into a memory stream, scheduled on the main thread through `with_webview`, the control thread waits up to 10 s), so windows covering Lutra do not appear and the native title bar is not part of the image (`apps/lutra-desktop/src/screenshot/webview2.rs`). Fallback on macOS and Linux until WKWebView's and WebKitGTK's snapshot APIs are wired: `xcap` captures the screen region under the client area (it does not enumerate windows of its own process, whose title queries can deadlock), without focusing, so covering windows appear (`screenshot/region.rs`). A `--control` instance opens its window without taking the foreground. The ignored test `apps/lutra-desktop/tests/screenshot_focus.rs` starts a built app and fails if its window is ever in the foreground while it starts and takes screenshots.
|
||||
- Screenshots never focus, raise or show the window; `app.focus` is the only method that does. On Windows the webview captures itself with WebView2 `CapturePreview` (PNG into a memory stream, scheduled on the main thread through `with_webview`, the control thread waits up to 10 s), so windows covering Lutra do not appear and the native title bar is not part of the image (`apps/lutra-desktop/src/screenshot/webview2.rs`). Fallback on macOS and Linux until WKWebView's and WebKitGTK's snapshot APIs are wired: `xcap` captures the screen region under the client area (it does not enumerate windows of its own process, whose title queries can deadlock), without focusing, so covering windows appear (`screenshot/region.rs`). A capture that does not arrive within 10 s is explained: the main thread never ran the request (blocked), or WebView2 accepted it but drew no frame; in that case the page's `document.visibilityState` is read and a hidden page is reported with its likely causes (locked session, display asleep, minimised or on another virtual desktop). Covered, off-screen and DWM-cloaked windows capture fine (checked on Windows 11). A `--control` instance builds its window and webview with `focused(false)`; when it is started from the foreground app's process tree it still becomes the foreground window about 1 s after start (seen 2026-10-29; see `docs/gaps.md`). The ignored test `apps/lutra-desktop/tests/screenshot_focus.rs` starts a built app and fails if its window is ever in the foreground while it starts and takes screenshots.
|
||||
|
||||
### CLI and single instance (M3.7)
|
||||
|
||||
|
|
@ -711,6 +711,7 @@ Watched directories: the VFS watcher is non-recursive, so `project.children` wat
|
|||
|
||||
| Question | Decision | Why |
|
||||
|---|---|---|
|
||||
| 2026-10-30 | minor | F2b: screenshot timeouts say whether the main thread was blocked or the page hidden; `--control` start can still take the foreground |
|
||||
| Highlighting | A Lezer grammar (`@lezer/php`, MIT) in CodeMirror highlights instantly on the UI thread. tree-sitter in `crates/syntax` stays the structural source (outline, folding, index) and later adds semantic tokens on top. | The keystroke-to-highlight budget (< 16 ms) leaves no room for an IPC round trip per keystroke; Lezer is incremental inside CodeMirror. tree-sitter gives the core one parser for every structural feature. |
|
||||
| Git library | `gix` (MIT OR Apache-2.0) for reading: status, log, diff, blame, refs. Writes the library doesn't cover well (push, pull, rebase, merge, hooks, signing) run the user's `git` executable. `git2`/libgit2 is not used. | gix is pure Rust and permissively licensed; libgit2 is GPL-2.0 with a linking exception, outside the permitted licences. Shelling out for writes keeps the user's hooks, credential helpers and config working. |
|
||||
| Terminal | `portable-pty` (MIT) in the new L3 crate `crates/terminal`; xterm.js (MIT) renders in the frontend. Output is streamed as events, input goes through commands. | ConPTY on Windows and Unix PTYs behind one API; xterm.js is the standard web terminal. A separate crate keeps PTY code out of the engine. |
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue