Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .repository-projection.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
"projection": "deixic-code",
"projectionSchemaVersion": 1,
"sourceRepository": "dx-corp/mono",
"sourceSha": "582b01208b58857ec89ea02e0a1330a84f0650f7",
"sourceSha": "03ccf8fea13e310f4d2fd6dd92736749692f3344",
"destinationRepository": "dx-corp/code",
"priorProjectedBase": "72a207b043c3f3167e8f44fd68143b17abe2fc3f",
"priorProjectedBase": "9c490dd81e4c467066295a5f88d01d2f05366a08",
"definitionDigest": "064b6b9745d392dde277afd7dfdf028cff32b6178a8b9c99c518343219bab429",
"toolDigest": "c8000985e1bd708bf1f8754b27cc1a2aad67af10ee23cf5317bd1fba670b4456",
"contentDigest": "0b2113cfef482d03f1d99af1630641768d0445721e8d46efdd31817cd8941614",
"contentDigest": "d54a206dc5baa9988e5cb4e69f4027b92b950195e9267c6562a98b15e9d198e4",
"publicationEligible": true
}
38 changes: 37 additions & 1 deletion packages/tui-rs/examples/onboarding-preview.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ use maestro_tui::{
};
use maestro_ui_preview::{
Scene,
authoring::{MenuRecipe, menu_recipe_fixtures, menu_studio},
review::{self, Capture},
};

Expand Down Expand Up @@ -178,6 +179,8 @@ fn run() -> Result<(), String> {
"{}",
serde_json::to_string(&serde_json::json!({
"fixtures": support::theme_selector_story::fixture_requests(),
"menu_starter": MenuRecipe::starter(),
"menu_fixtures": menu_recipe_fixtures(),
"presets": support::theme_selector_story::presets()
.into_iter()
.zip([
Expand All @@ -196,6 +199,23 @@ fn run() -> Result<(), String> {
);
return Ok(());
}
if args == ["--studio-stdin"] {
use std::io::Read;
let mut body = String::new();
std::io::stdin()
.take(16_385)
.read_to_string(&mut body)
.map_err(|error| error.to_string())?;
if body.len() > 16_384 {
return Err("menu recipe exceeds 16384 bytes".into());
}
let recipe: MenuRecipe = serde_json::from_str(&body).map_err(|error| error.to_string())?;
println!(
"{}",
serde_json::to_string(&menu_studio(recipe)?).map_err(|error| error.to_string())?
);
return Ok(());
}
if args == ["--replay-stdin"] {
use std::io::Read;
let mut body = String::new();
Expand All @@ -215,7 +235,10 @@ fn run() -> Result<(), String> {
return Ok(());
}
if args.len() > 1 || args.first().is_some_and(|a| a != "--html" && a != "--json") {
return Err("usage: onboarding-preview [--html|--json|--sequences|--replay-stdin]".into());
return Err(
"usage: onboarding-preview [--html|--json|--sequences|--replay-stdin|--studio-stdin]"
.into(),
);
}
let captures = captures()?;
let output = if args.first().is_some_and(|a| a == "--html") {
Expand Down Expand Up @@ -260,4 +283,17 @@ mod tests {
assert_ne!(text("onboarding-ready"), text("onboarding-failed"));
assert!(text("onboarding-failed").contains("Model request failed"));
}

#[test]
fn menu_authoring_fixtures_render_through_the_shared_recipe() {
for recipe in menu_recipe_fixtures() {
let response = menu_studio(recipe).unwrap();
assert!(!response.transcript.is_empty());
assert!(
response
.effect_policy
.contains("external actions and settings are untouched")
);
}
}
}
60 changes: 51 additions & 9 deletions packages/ui-preview-rs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -133,10 +133,13 @@ retaining their stable IDs; new stories do not need a second rendering switch.
Use repository-relative source paths for links to GitHub; `file!()` is useful
for local source identification but may need a repository path prefix.

The browser has grouped thumbnails, scene/size/frame URLs, renderer links and a
pinned comparison. Comparison follows the selected timestamp using the nearest
available earlier frame. Existing baseline acceptance remains explicit and is
never performed by the workbench.
The browser groups states under their product experience, preserves
scene/size/frame URLs, links to renderer source, and supports a pinned
comparison. Comparison follows the selected timestamp using the nearest
available earlier frame. Its accessible preview is a line-oriented transcript;
hidden terminal glyphs stay in visual cell data but are omitted from that
transcript. Existing baseline acceptance remains explicit and is never
performed by the workbench.

## Watch while designing

Expand All @@ -160,8 +163,47 @@ signs in, executes a tool, or writes application settings.
The server rejects non-loopback Host/Origin values, oversized bodies, text,
event counts and dimensions. It invokes no browser-supplied command or path.
`--components-only` remains a static catalog and exposes no replay endpoint.
The workbench preserves URL state
and scroll across successful refreshes. Failed builds retain the previous page
and show an error; they never update accepted baselines. It uses the configured
`CARGO_TARGET_DIR` or a user cache outside the checkout. In Mono it runs the
existing build-capacity check before each build. Ctrl+C stops serving.

Choose **New menu scene** to open the Scene Inspector. Content edits keep stable
action IDs separate from labels and render through the same Rust `ActionPicker`
and `Menu` used by product code. State switches cover ready, loading, empty,
error, long-content, Unicode, and narrow fixtures. The Interaction tab replays
typing, navigation, selection, cancel, resize, and retry and reports simulated
effects by stable ID. The coverage table distinguishes available variants from
the variants exercised by the current draft; its automated-check column is
reported separately and is never inferred from a preview.

**Export recipe** saves the bounded declarative draft. **Export replay** saves
the ordinary deterministic input sequence consumed by capture tests. **Export
Rust fixture** emits a runnable Cargo example that uses the production widgets;
the caller still owns real action dispatch and persistence. Import validates a
recipe with Rust before replacing the current draft. Draft form fields live in
browser session storage so a source-watch reload preserves even a temporarily
invalid edit. This storage is editor state only and never changes application
settings.

To keep an exported scene, place its `.rs` file beside the owning preview
adapter. Its generated `register(&mut Registry)` function adds the recipe state
and every deterministic input prefix to the same registry used by `--json`,
`--html`, and PR visual evidence:

```rust
#[path = "workspace_menu.rs"]
pub mod exported_workspace_menu;

exported_workspace_menu::register(&mut registry)?;
```

Keep that generated module public when compiling with dead-code warnings: the
same file also exposes a public standalone `main` used by `cargo run --example`.

The built-in recipe states and four interaction journeys use this path. They
add 21 bounded cases, including select, filter/cancel, retry/select, and
Unicode/resize/cancel prefixes. Registration rejects duplicate IDs or invalid
dimensions; it never accepts a baseline.

The workbench preserves URL state and scroll across successful refreshes.
Failed builds retain the previous page and show an error; they never update
accepted baselines. It uses the configured `CARGO_TARGET_DIR` or a user cache
outside the checkout. In Mono it runs the existing build-capacity check before
each build. Ctrl+C stops serving.
Loading
Loading