From 409e1c9d67f7484126b11ada05fa0138d67ffcc2 Mon Sep 17 00:00:00 2001 From: aiongg Date: Fri, 13 Nov 2026 04:28:22 +0000 Subject: [PATCH] docs: porting guide 6.4 captures old and port through craft-automation; trial for the client sample; README client row --- crates/automation/README.md | 2 +- crates/automation/tests/it/control.rs | 56 +++++++++++ docs/porting.md | 137 ++++++++++++++++++++++++-- 3 files changed, 187 insertions(+), 8 deletions(-) diff --git a/crates/automation/README.md b/crates/automation/README.md index e48211d04..9f5e9fa5a 100644 --- a/crates/automation/README.md +++ b/crates/automation/README.md @@ -12,7 +12,7 @@ Drive a running Craft app from tests, agents and the CLI, and record and play ac | `control` | `ControlRequest`, `Reply`, `Dispatch` and `ControlChannel`: the UI-thread side that drains requests between frames, replies after injected input or a background job settles, and admits screenshots. The app supplies the method table. | | `synthetic` | `Click`, `KeyPress` and `move_from_params`: the validated parameters of `ui.click`, `ui.move` and `ui.key`, queued through `WindowHost::inject_*` one step per pass. | | `server` | `start`: the loopback TCP listener that authenticates each connection and forwards requests to the channel. | -| `client` | `ControlClient`: connect, authenticate, call, screenshot; for integration tests and CLIs. | +| `client` | `ControlClient`: connect, authenticate, call (a screenshot is `call("ui.screenshot", ..)`); for integration tests and CLIs. | | `screenshot` | `Captures`: the bounded, cancellable screenshot queue over `WindowHost::screenshot`, with settling, geometry epochs, retries and the PNG reply. | | `profiler` | `FrameStages` and `SlowFrames`: where a frame's time went, the slow ones kept for the control channel's `perf` output and one log line a second. | | `trace` | `FrameTrace`: every frame of a gesture (a brush stroke, a drag) as a row, a percentile summary per gesture, optional CSV. | diff --git a/crates/automation/tests/it/control.rs b/crates/automation/tests/it/control.rs index deb75c0fc..6ea346842 100644 --- a/crates/automation/tests/it/control.rs +++ b/crates/automation/tests/it/control.rs @@ -5,6 +5,7 @@ use std::net::TcpStream; use std::sync::mpsc::channel; use std::time::Duration; +use craft_automation::client::ControlClient; use craft_automation::control::{ControlChannel, ControlRequest, Reply, expired_error, result_reply, timeout_error}; use craft_automation::security::MAX_REQUEST_BYTES; use craft_automation::server; @@ -119,3 +120,58 @@ fn an_over_long_request_is_refused_and_closes_the_connection() { assert!(read_json(&mut reader).is_none(), "the connection is closed"); assert!(rx.try_recv().is_err()); } + +/// Sends one state of a states file and saves its capture as `