test(ui): find command dialogs by their published rect (#1011)

The dialog_docked scenario check and the ui_layout width test looked up
the dialog window by the id "sc_dialog", but dialogs are now registered
under ("sc_dialog", <title>). Every lookup failed with "no command
dialog", so the test had to stay ignored and could no longer catch an
oversized dialog.

Read the rect the dialog publishes each frame instead (viewport
dialog_rect in the check, "dialog:outer" in the test), and re-enable
every_dialog_opens_docked_within_its_width_limits. The exploded view
dialog it was ignored for now opens 365 px wide, inside its limits.


Claude-Session: https://claude.ai/code/session_01VbBYY5zfMXgq939AF9Vren

Co-authored-by: PhilippBischoff0 <[email protected]>
Co-authored-by: Claude Opus 5.5 <[email protected]>
Co-authored-by: bherbruck <[email protected]>
This commit is contained in:
authored and GitHub committed 2026-10-14 08:16:49 -04:00
1 parent 0f4cda0510
commit 3256fffe35
2 files changed
+5 -4

No files matched your search

+3 -1
View File
@@ -731,7 +731,9 @@ pub fn check(h: &mut Harness, e: &Value) -> Result<(), String> {
}
"dialog_docked" => {
// The command dialog: docked at the viewport's right, its width in [min, max].
let r = h.ctx.memory(|m| m.area_rect(egui::Id::new("sc_dialog"))).ok_or("no command dialog")?;
// Its window id carries the dialog's title, so read the rect the dialog
// publishes each frame rather than looking up a fixed id.
let r = h.app.viewport.dialog_rect.filter(|_| h.app.dialog.is_some()).ok_or("no command dialog")?;
let vp = h.app.viewport.rect.unwrap_or(egui::Rect::NOTHING);
let (lo, hi) = (v["min"].as_f64().unwrap_or(260.0) as f32, v["max"].as_f64().unwrap_or(380.0) as f32);
if r.width() < lo - 0.5 || r.width() > hi + 0.5 {