Files
filmcraft/crates/ui-egui/examples/menu_tree.rs
vangel76andClaude Opus 5.5 6aca7c1798 #781: cargo xtask parity measures menu coverage
Problem: the menu parity figure in docs/target-app-parity.md came from an
ad hoc label-matching script over string literals; nothing repeatable
measured the real menu bar (docs/gaps.md G7).

Fix: `cargo xtask parity` dumps the shipped menu bar (new
`menus::default_menu_items`, deterministic: English, default prefs,
built-in workspaces; printed by `examples/menu_tree.rs`) and compares it
with a reference list of menu paths, by default the local, never-committed
`plan/premiere/menus.json` (any JSON of paths via --reference; parsing is
depth- and size-capped). Presence and placement are reported separately
(same path, elsewhere, missing); app/Help/recent/account/macOS items are
out of scope. Writes a markdown checklist (target/parity/ or --out) and
--min fails below a presence threshold. Without a reference it prints our
inventory only.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-10 23:39:57 +02:00

27 lines
825 B
Rust

//! Print FilmCraft's menu bar as it ships (English, default preferences) as JSON: one object per
//! item with its `id`, `label` and menu `path`. `cargo xtask parity` reads this to measure menu
//! coverage against a reference list.
//!
//! ```sh
//! cargo run -p filmcraft-ui-egui --example menu_tree
//! ```
use std::process::ExitCode;
use serde_json::json;
fn main() -> ExitCode {
let items: Vec<serde_json::Value> =
filmcraft_ui_egui::menus::default_menu_items().into_iter().map(|it| json!({"id": it.id, "label": it.label, "path": it.path})).collect();
match serde_json::to_string_pretty(&items) {
Ok(text) => {
println!("{text}");
ExitCode::SUCCESS
}
Err(e) => {
eprintln!("menu_tree: {e}");
ExitCode::FAILURE
}
}
}