DIAG prints: NumberField label click and MarginHandles drag in the suite

This commit is contained in:
Martin Ball
2026-11-18 14:37:48 +00:00
parent c9803a6ea1
commit 14bb90a109
3 changed files with 17 additions and 1 deletions
+5 -1
View File
@@ -18,8 +18,12 @@ const CENTRE: Point = Point::new(300.0, 400.0);
const DRAG_THRESHOLDS: f32 = 12.0;
fn drag_left_edge(fixture: &mut Fixture) {
let Some(target) = fixture.by_label("Left Margin") else { return };
let Some(target) = fixture.by_label("Left Margin") else {
eprintln!("DIAG drives: margin_handles_on_rulers: no node labelled Left Margin");
return;
};
let travel = DRAG_THRESHOLDS * craft_ui::testing::input::slop(fixture.ctx());
eprintln!("DIAG drives: margin_handles_on_rulers: dragging Left Margin by {travel}");
fixture.drag(&target, Vec2::new(travel, 0.0));
}
@@ -149,6 +149,15 @@ fn declared_actions_are_handled(subject: &Subject) -> Result<(), String> {
|| signature(fixture.tree()) != before
|| fixture.focused() != focus;
if !acted {
eprintln!(
"DIAG activation: {} {kind:?} on {:?} named {:?}: focus {focus:?} -> {:?}, outputs {}, disabled {:?}",
story.name,
fixture.tree().role_of(key),
fixture.tree().name_of(key),
fixture.focused(),
outputs.len(),
fixture.tree().data_of(key).map(|node| node.is_disabled()),
);
return Err(format!("{}: {kind:?} on {:?} did nothing", story.name, fixture.tree().role_of(key)));
}
}
@@ -323,6 +323,9 @@ fn runs_of(story: &Story, probe: &Probe, plan: Plan) -> Runs {
continue;
}
if !changed {
if story.name.starts_with("margin_handles") {
eprintln!("DIAG drives: {} {name} changed nothing: edits {kinds:?}, lent {lent}, focus {:?}", story.name, fixture.focused());
}
unchanged_by.push(name);
continue;
}