Integrate eguidev (egui automation) behind an opt-in feature - #276
Draft
frewsxcv wants to merge 1 commit into
Draft
Integrate eguidev (egui automation) behind an opt-in feature#276frewsxcv wants to merge 1 commit into
frewsxcv wants to merge 1 commit into
Conversation
Wires cortesi/eguidev — an egui automation/testing framework (screenshots, widget-state inspection, input injection, Luau scripting over an embedded MCP server) — into rgis's bevy_egui UI on the native target, behind an off-by-default `eguidev` feature. Normal and wasm builds are unaffected. What's here: - third_party/eguidev: vendored fork of cortesi/eguidev, patched to compile against egui 0.33 (rgis's version; upstream requires 0.34). Four small edits: * actions.rs: drop MouseWheel.phase (0.34-only field) * instrument.rs: intrinsic_size is a field in 0.33, not a method * tools/layout.rs: global_style() -> style() * devmcp.rs: make begin_frame/end_frame pub (called from separate Bevy systems) - rgis-ui/src/eguidev_adapter.rs: the bevy_egui<->eguidev bridge. Reproduces eframe's frame lifecycle inside Bevy: a PreUpdate raw_input_hook system (after ProcessInput, before BeginPass), begin/end-frame systems bracketing the EguiPrimaryContextPass, and a single-threaded executor for that pass (eguidev tracks the active frame via a thread-local). - rgis-ui/src/dev_ui.rs: cfg-switching wrappers (button/label/track) that register widgets with eguidev under stable ids when the feature is on, else plain egui. - Instrumented the bottom status bar (app-version, edit-crs, crs/coords readouts) and the map scale bar as a demo surface. - rgis window pinned to 1280x720 @ scale 1.0 under the feature, to match the Playwright harness's coordinate space. - .edev.toml: launch config so `edev smoke script.luau` can drive the app. Also includes a wasm build fix (zstd-sys no_asm) discovered separately. Draft: see PR description for the eguidev-vs-Playwright comparison and caveats (native != wasm rendering; eguidev screenshot round-trip needs a Bevy bridge that is not built here).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Draft for review — wires cortesi/eguidev (an egui automation/testing framework: screenshots, widget-state inspection, input injection, Luau scripting over an embedded MCP server) into rgis's bevy_egui UI, behind an off-by-default
eguidevfeature (native only). Normal builds and the wasm/web build are unaffected.What this does
Lets an agent/script drive the native app and assert on structured widget state (text, rects, layout) rather than pixels. Driving the running app with
edev smoke:How it's wired
third_party/eguidev/— vendored fork, patched to build against egui 0.33 (rgis's version; upstream needs 0.34). Four edits, visible in the diff:actions.rs(dropMouseWheel.phase),instrument.rs(intrinsic_sizeis a field in 0.33),tools/layout.rs(global_style()→style()),devmcp.rs(begin_frame/end_framemadepub).rgis-ui/src/eguidev_adapter.rs— the bevy_egui↔eguidev bridge: aPreUpdateraw_input_hooksystem (after(ProcessInput).before(BeginPass)),begin/end_framesystems bracketingEguiPrimaryContextPass, and that pass set to a single-threaded executor (eguidev uses a thread-local frame model).rgis-ui/src/dev_ui.rs— cfg-switchingbutton/label/trackwrappers: register widgets with eguidev ids when the feature is on, plain egui otherwise.app-version,edit-crs,crs/coords) and the map scale bar.rgis/src/lib.rs— window pinned to 1280×720 @ scale 1.0 under the feature (matches Playwright's coordinate space)..edev.toml— launch config foredev.Try it
Caveats (why it's a draft)
ViewportCommand::Screenshot, so eguidev'sscreenshot()would hang; a Bevy capture→egui::Event::Screenshotbridge is not built. Verification uses structured queries.zstd-sysno_asm).eguidev vs Playwright
Recommendation: Playwright stays the pragmatic choice for verifying what ships; eguidev earns its keep only if you want widget-level CI assertions and accept the tradeoffs.