* Render appearance: click, drag and paint to assign, Pick Up, copy and paste, and Remove * Exclude the workspace Shots strip from dialog width checks * Exclude the collapsed Shots control from dialog width checks * Retain assembly cache listings and measure actual dialog bounds * fix: handle toast button rectangles in assignment status * fix: restrict gallery note measurement helper to tests * test: measure assignment help at the catalogue footer * fix: share the command revision snapshot after restacking
This commit is contained in:
@@ -12,7 +12,12 @@ fn window_widths(h: &Harness) -> Vec<(egui::Id, f32)> {
|
||||
m.areas()
|
||||
.visible_layer_ids()
|
||||
.into_iter()
|
||||
.filter(|l| l.order == egui::Order::Middle && l.id != egui::Id::new("sc_browser_card"))
|
||||
// Workspace hosts are not command windows; Shots has wide expanded and small collapsed forms.
|
||||
.filter(|l| {
|
||||
l.order == egui::Order::Middle
|
||||
&& ![egui::Id::new("sc_browser_card"), egui::Id::new("sc_render_shots_strip"), egui::Id::new("sc_render_shots_pill")]
|
||||
.contains(&l.id)
|
||||
})
|
||||
.filter_map(|l| m.area_rect(l.id).map(|r| (l.id, r.width())))
|
||||
.collect()
|
||||
})
|
||||
@@ -43,6 +48,32 @@ fn fresh() -> Harness {
|
||||
h
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn render_strip_is_excluded_while_real_windows_are_still_measured() {
|
||||
let mut h = fresh();
|
||||
assert_eq!(h.call("ui.workspace", json!({"workspace":"render"}))["ok"], true);
|
||||
h.app.help.about = true;
|
||||
h.frames(6);
|
||||
let strip = egui::Id::new("sc_render_shots_strip");
|
||||
let width = h.ctx.memory(|m| m.area_rect(strip)).expect("visible Shots strip").width();
|
||||
assert!(width > DIALOG_MAX_W, "the workspace strip should span the canvas: {width}");
|
||||
let windows = window_widths(&h);
|
||||
assert!(!windows.iter().any(|(id, _)| *id == strip));
|
||||
assert!(windows.iter().any(|(id, _)| *id == egui::Id::new("sc_about")), "real About window is still measured: {windows:?}");
|
||||
assert_eq!(h.call("engine.execute", json!({"command":"view.shots_strip","params":{"visible":false}}))["ok"], true);
|
||||
h.frames(6);
|
||||
let pill = egui::Id::new("sc_render_shots_pill");
|
||||
let width = h.ctx.memory(|m| m.area_rect(pill)).expect("visible Shots restore control").width();
|
||||
assert!(width < DIALOG_MIN_W, "the restore control is intentionally smaller than a dialog: {width}");
|
||||
let windows = window_widths(&h);
|
||||
assert!(!windows.iter().any(|(id, _)| *id == pill));
|
||||
assert!(windows.iter().any(|(id, _)| *id == egui::Id::new("sc_about")), "real window remains measured with Shots collapsed: {windows:?}");
|
||||
assert_eq!(h.call("ui.start", json!({"command":"file.export_view_dxf"}))["ok"], true);
|
||||
h.frames(6);
|
||||
let dialog = solidcraft_ui_egui::scenario::rect_of("dialog:outer").expect("DXF dialog has an outer rectangle");
|
||||
assert!(dialog.width() >= DIALOG_MIN_W - 4.0, "actual DXF dialog remains at least the dialog minimum: {dialog:?}");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn command_dialogs_shrink_to_their_content_within_limits() {
|
||||
let mut h = fresh();
|
||||
@@ -64,11 +95,10 @@ fn command_dialogs_shrink_to_their_content_within_limits() {
|
||||
}
|
||||
}
|
||||
// The docked dialog shrinks to its content: most dialogs stay well under the maximum.
|
||||
if h.app.dialog.is_some() {
|
||||
for (_, w) in window_widths(&h) {
|
||||
if w < DIALOG_MIN_W - slack {
|
||||
bad.push(format!("{}: {w} px is narrower than {DIALOG_MIN_W}", spec.id));
|
||||
}
|
||||
if let Some(rect) = solidcraft_ui_egui::scenario::rect_of("dialog:outer").filter(|_| h.app.dialog.is_some()) {
|
||||
let w = rect.width();
|
||||
if w < DIALOG_MIN_W - slack {
|
||||
bad.push(format!("{}: active dialog {w} px is narrower than {DIALOG_MIN_W}", spec.id));
|
||||
}
|
||||
}
|
||||
h.app.dialog = None;
|
||||
|
||||
Reference in New Issue
Block a user