Skip to content

SolidCraft: an open-source parametric 3D CAD application built in pure Rust. Desktop, web, and automation through MCP.

Parameters: reach the end of a long expression the same way on every OS in its test (#12104)

Danielde1db6fb8c28
diff --git a/crates/ui-egui/src/params_dialog.rs b/crates/ui-egui/src/params_dialog.rs
index bfe4bc43fa..c99efc04af 100644
--- a/crates/ui-egui/src/params_dialog.rs
+++ b/crates/ui-egui/src/params_dialog.rs
@@ -1828,8 +1828,9 @@ mod tests {
assert!(wide.width() > cell.width() * 1.5, "the edited formula opens wide: {wide:?} vs {cell:?}");
assert!((wide.left() - cell.left()).abs() < 1.0, "it opens from its own cell: {wide:?} vs {cell:?}");
- // The open field wraps, so the end of the text is Ctrl+End.
- h.run(&json!([{"key":"End","cmd":true}, {"text":" * 2"}, {"key":"Enter"}])).unwrap();
+ // The open field wraps, so the end of the text is Command+Down. Not Ctrl+End:
+ // egui ignores that on macOS, and the typed tail would land where the click put the cursor.
+ h.run(&json!([{"key":"ArrowDown","cmd":true,"ctrl":false}, {"text":" * 2"}, {"key":"Enter"}])).unwrap();
h.frames(2);
assert_eq!(h.app.session.doc.param("length").unwrap().expr, format!("{long} * 2"));
let after = crate::scenario::rect_of("param:length").unwrap();