Skip to content

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

History: show the origin and bodies at the top (#6490) (#6495)

Lars Jansen5fc23436ca53
diff --git a/assets/locales/pending/history-origin-bodies.json b/assets/locales/pending/history-origin-bodies.json
new file mode 100644
index 0000000000..432b40dbab
--- /dev/null
+++ b/assets/locales/pending/history-origin-bodies.json
@@ -0,0 +1,30 @@
+{
+ "en": {
+ "prefs.history_origin_bodies": "Show origin and bodies at the top",
+ "prefs.history_origin_bodies_note": "The History on the left or under the browser starts with the active component's Bodies folder and the Origin, with their eyes and menus as in the browser. The History at the bottom is unchanged."
+ },
+ "ja": {
+ "prefs.history_origin_bodies": "原点とボディを先頭に表示",
+ "prefs.history_origin_bodies_note": "左側またはブラウザー下の履歴の先頭に、アクティブなコンポーネントのボディフォルダーと原点を、ブラウザーと同じ表示切り替えとメニュー付きで表示します。下部の履歴は変わりません。"
+ },
+ "zh": {
+ "prefs.history_origin_bodies": "在顶部显示原点和实体",
+ "prefs.history_origin_bodies_note": "左侧或浏览器下方的历史以活动组件的实体文件夹和原点开头,并带有与浏览器相同的显示切换和菜单。底部的历史保持不变。"
+ },
+ "ar": {
+ "prefs.history_origin_bodies": "إظهار الأصل والأجسام في الأعلى",
+ "prefs.history_origin_bodies_note": "يبدأ السجل على اليسار أو تحت المستعرض بمجلد الأجسام للمكوّن النشط وبالأصل، مع أيقونات الإظهار والقوائم كما في المستعرض. لا يتغير السجل في الأسفل."
+ },
+ "he": {
+ "prefs.history_origin_bodies": "הצגת הראשית והגופים למעלה",
+ "prefs.history_origin_bodies_note": "ההיסטוריה משמאל או מתחת לדפדפן מתחילה בתיקיית הגופים של הרכיב הפעיל ובראשית, עם סמלי העין והתפריטים כמו בדפדפן. ההיסטוריה למטה לא משתנה."
+ },
+ "de": {
+ "prefs.history_origin_bodies": "Ursprung und Körper oben zeigen",
+ "prefs.history_origin_bodies_note": "Der Verlauf links oder unter dem Browser beginnt mit dem Körper-Ordner der aktiven Komponente und dem Ursprung, mit Augen und Menüs wie im Browser. Der Verlauf unten bleibt unverändert."
+ },
+ "ko": {
+ "prefs.history_origin_bodies": "원점과 바디를 맨 위에 표시",
+ "prefs.history_origin_bodies_note": "왼쪽 또는 브라우저 아래의 히스토리가 활성 구성 요소의 바디 폴더와 원점으로 시작하며, 브라우저처럼 표시 아이콘과 메뉴가 있습니다. 아래쪽 히스토리는 바뀌지 않습니다."
+ }
+}
diff --git a/crates/ui-egui/src/browser.rs b/crates/ui-egui/src/browser.rs
index ee5592ebfc..b5f2bdab84 100644
--- a/crates/ui-egui/src/browser.rs
+++ b/crates/ui-egui/src/browser.rs
@@ -130,6 +130,9 @@ pub struct TreeState {
pub timeline_reveal: Option<u64>,
/// The Edit Canvas / Calibrate panel.
pub canvas_panel: Option<CanvasPanel>,
+ /// The bodies a row at the top of the history lights this frame (`history_rows`), for the
+ /// browser, drawn after it, to keep.
+ history_hover: Vec<String>,
/// A Section Analysis hidden with its eye in the Analysis folder: its plane (origin,
/// normal), so the eye can bring it back (#822).
pub hidden_section: Option<(solidcraft_engine::geom::Vec3, solidcraft_engine::geom::Vec3)>,
@@ -1218,12 +1221,53 @@ fn rows_scrolling(app: &mut SolveApp, ui: &mut egui::Ui, acts: &mut Actions, shr
app.tree.cache = Some(cache);
}
+/// The Bodies folder and the Origin at the top of the vertical History (Preferences › Interface:
+/// Show origin and bodies at the top, #6490): the browser's own rows, with their eyes, selection,
+/// menus and fold state. The bodies are the active component's, in the placement being edited,
+/// as that component's folder in the browser lists them. The rows stay out of the browser's row
+/// order, automation list and reveal, which the browser keeps for its own rows.
+pub(crate) fn history_rows(app: &mut SolveApp, ui: &mut egui::Ui) {
+ prepare_model(app);
+ let mut acts = Actions { lit: Lit::of(app), ..Default::default() };
+ let reveal = app.tree.reveal.take();
+ let order = app.tree.order_len;
+ let drawn = DRAWN.with(|d| d.borrow().len());
+ let component = app.session.active_component;
+ let path = (component != 0)
+ .then(|| app.session.active_occurrence_path.clone().unwrap_or_else(|| app.session.doc.first_path(component)))
+ .filter(|path| !path.is_empty());
+ // The Bodies folder as the browser draws it for that component or placement (`browser_cache`).
+ let mut cache = app.tree.cache.take().unwrap_or_default();
+ cache.prepare(app);
+ let bodies = cache.folder(app, component, path.as_deref(), "bodies");
+ app.tree.cache = Some(cache);
+ ui.scope(|ui| {
+ ui.spacing_mut().item_spacing.y = 0.0;
+ folder_rows_at(app, ui, component, path.as_deref(), "bodies", 0, &mut acts, &bodies);
+ origin_rows(app, ui, 0, &acts);
+ });
+ app.tree.reveal = reveal;
+ // The browser's own rows reuse these order slots (`TreeState::remember`).
+ app.tree.order_len = order;
+ DRAWN.with(|d| d.borrow_mut().truncate(drawn));
+ app.viewport.hover_bodies = acts.hover_bodies.clone();
+ app.tree.history_hover = acts.hover_bodies;
+ if let Some(d) = acts.drop {
+ apply_drop(app, d);
+ }
+ if let Some((at, target)) = acts.menu {
+ crate::context_menu::open_for(app, at, target);
+ }
+}
+
fn finish_browser(app: &mut SolveApp, ui: &mut egui::Ui, mut acts: Actions) {
app.tree.order.truncate(app.tree.order_len);
if !acts.hovered {
acts.hover_bodies.clear();
}
- app.viewport.hover_bodies = acts.hover_bodies;
+ // The history's rows, drawn before the browser, light bodies too (`history_rows`).
+ let history = std::mem::take(&mut app.tree.history_hover);
+ app.viewport.hover_bodies = if acts.hover_bodies.is_empty() { history } else { acts.hover_bodies };
if let Some(d) = acts.drop {
apply_drop(app, d);
}
diff --git a/crates/ui-egui/src/i18n.rs b/crates/ui-egui/src/i18n.rs
index 146e15efa9..e855bec045 100644
--- a/crates/ui-egui/src/i18n.rs
+++ b/crates/ui-egui/src/i18n.rs
@@ -326,7 +326,9 @@ mod tests {
let pending: BTreeMap<String, Messages> = serde_json::from_str(&std::fs::read_to_string(entry.path()).unwrap()).unwrap();
for (locale, messages) in pending {
for (id, text) in messages {
- assert_eq!(Locale::for_language(&locale).text(&id), text, "{locale}: {id}");
+ // The catalogs hand right-to-left text out in display order (`crate::bidi`);
+ // pending files hold it in reading order, as the catalogs do (#7527).
+ assert_eq!(Locale::for_language(&locale).text(&id), crate::bidi::visual_template(&text), "{locale}: {id}");
}
}
}
diff --git a/crates/ui-egui/src/prefs.rs b/crates/ui-egui/src/prefs.rs
index 5e12de4636..db332f59b5 100644
--- a/crates/ui-egui/src/prefs.rs
+++ b/crates/ui-egui/src/prefs.rs
@@ -654,6 +654,9 @@ preference_settings! {
timeline_left_browser_collapsed: bool = false, PAGE_INTERFACE;
/// Whether the History at the left lists a sketch under the feature built from it.
history_sketches: HistorySketches = HistorySketches::default(), PAGE_INTERFACE;
+ /// The vertical history (left, or under the browser) starts with the active component's Bodies
+ /// folder and the Origin, as the browser shows them (#6490). The bottom strip is unchanged.
+ timeline_origin_bodies: bool = false, PAGE_INTERFACE;
/// Width of the browser sidebar, which
/// the user drags wider or narrower at its right edge.
browser_width: f32 = DEFAULT_BROWSER_WIDTH, PAGE_INTERFACE;
diff --git a/crates/ui-egui/src/prefs/interface.rs b/crates/ui-egui/src/prefs/interface.rs
index 6d02ce0828..3f8660ba8d 100644
--- a/crates/ui-egui/src/prefs/interface.rs
+++ b/crates/ui-egui/src/prefs/interface.rs
@@ -95,6 +95,15 @@ pub(super) fn interface(app: &mut SolveApp, ui: &mut egui::Ui, t: &Tokens) {
}
});
});
+ // Only the history on the left or under the browser has room for these rows.
+ ui_kit::row(ui, "", |ui| {
+ ui.add_enabled_ui(app.preferences.timeline_left, |ui| {
+ let check = ui_kit::checkbox(ui, app.tr("prefs.history_origin_bodies"), &mut app.preferences.timeline_origin_bodies)
+ .on_hover_text(app.tr("prefs.history_origin_bodies_note"))
+ .on_disabled_hover_text(app.tr("prefs.history_origin_bodies_note"));
+ crate::scenario::publish_target("prefs:history_origin_bodies", check.rect);
+ });
+ });
ui_kit::row(ui, app.tr("prefs.browser"), |ui| {
ui.add_enabled_ui(app.ui.layout == crate::shell::LayoutMode::Floating, |ui| {
let mut selected = usize::from(app.preferences.browser_float);
diff --git a/crates/ui-egui/src/timeline_left.rs b/crates/ui-egui/src/timeline_left.rs
index c3f7403b87..fef8b0eb7c 100644
--- a/crates/ui-egui/src/timeline_left.rs
+++ b/crates/ui-egui/src/timeline_left.rs
@@ -1007,6 +1007,17 @@ struct Rows<'a> {
fn vertical_features(app: &mut SolveApp, ui: &mut egui::Ui, names: bool) {
let t = Tokens::get();
+ // Show origin and bodies at the top (#6490): the browser's Bodies folder and Origin rows lead
+ // the history when it is wide enough for names. They are not places in the history: nothing
+ // drags or drops among them, and the features start below them.
+ let features_top = (names && app.preferences.timeline_origin_bodies).then(|| {
+ crate::browser::history_rows(app, ui);
+ ui.add_space(t.space_3);
+ t.secondary_hline(ui.painter(), ui.max_rect().x_range(), ui.cursor().top(), t.border);
+ ui.add_space(t.space_3);
+ ui.cursor().top()
+ });
+ let among_features = |y: f32| features_top.is_none_or(|top| y >= top);
ui.spacing_mut().item_spacing.y = if names { t.space_2 } else { t.space_4 };
let features: Vec<_> = app
.session
@@ -1142,6 +1153,7 @@ fn vertical_features(app: &mut SolveApp, ui: &mut egui::Ui, names: bool) {
}
// The marker dropped where it already is needs no bar: the marker shows the spot.
if let (Some(active), Some(pointer)) = (drag.as_ref(), pointer)
+ && among_features(pointer.y)
&& let Some(slot) = nearest_vertical_slot(&slots, pointer.y)
&& !(matches!(active, Drag::Marker) && slot.position == marker.min(n))
{
@@ -1170,7 +1182,7 @@ fn vertical_features(app: &mut SolveApp, ui: &mut egui::Ui, names: bool) {
}
if ui.input(|input| input.pointer.any_released())
&& let Some(active) = drag.take()
- && let Some(pointer) = pointer
+ && let Some(pointer) = pointer.filter(|pointer| among_features(pointer.y))
&& let Some(slot) = nearest_vertical_slot(&slots, pointer.y)
{
match active {
@@ -1887,6 +1899,101 @@ mod tests {
assert_eq!(harness.app.session.selection, vec![solidcraft_engine::Sel::Feature { id: base }]);
}
+ /// The handle `name` drawn inside the vertical history (the browser publishes the same names).
+ fn in_history(name: &str) -> Option<egui::Pos2> {
+ let card = crate::scenario::rect_of("history:vertical")?;
+ crate::scenario::handles(name).into_iter().filter(|(n, _)| n == name).map(|(_, at)| at).find(|at| card.contains(*at))
+ }
+
+ /// Show origin and bodies at the top (#6490): off by default; on, the vertical history starts
+ /// with the active component's Bodies folder and the Origin, the browser's rows with their
+ /// folds, eyes, selection and menus; they take no drops; too narrow for names, it leaves them out.
+ #[test]
+ fn origin_and_bodies_lead_the_vertical_history_when_asked() {
+ let mut h = Harness::new();
+ h.app.preferences.timeline_left = true;
+ h.app.preferences.timeline_left_width = 240.0;
+ h.app.run("solid.box", json!({"length": 10, "width": 10, "height": 10, "name": "First", "body_name": "Block"})).unwrap();
+ h.app
+ .run("solid.box", json!({"length": 10, "width": 10, "height": 10, "corner": [20, 0, 0], "operation": "new_body", "name": "Second", "body_name": "Other"}))
+ .unwrap();
+ h.frames(4);
+ assert!(in_history("row:Origin").is_none() && in_history("row:Bodies").is_none(), "off by default");
+ h.call("ui.prefs", json!({"timeline_origin_bodies": true}));
+ h.frames(3);
+ let bodies = in_history("row:Bodies").expect("the Bodies folder");
+ let origin = in_history("row:Origin").expect("the Origin");
+ let first = handle_at("timeline:First").unwrap();
+ assert!(bodies.y < origin.y && origin.y < first.y, "Bodies, Origin, then the features");
+ assert!(in_history("row:Block").is_some() && in_history("row:Other").is_some(), "the Bodies folder starts open, as in the browser");
+ assert!(in_history("row:XY").is_none(), "the Origin starts closed, as in the browser");
+
+ // The fold is the browser's: opening it here opens it there.
+ h.call("ui.click", json!({"x": origin.x, "y": origin.y}));
+ h.frames(2);
+ assert!(crate::browser::is_open(&h.app, "origin", false));
+ let xy = in_history("row:XY").expect("the origin planes");
+ let eye = in_history("eye:XY").unwrap();
+ h.call("ui.click", json!({"x": eye.x, "y": eye.y}));
+ h.frames(2);
+ assert!(h.app.session.visibility.hidden_origin.iter().any(|p| p == "XY"), "the plane's eye hides it");
+ let eye = in_history("eye:Block").unwrap();
+ h.call("ui.click", json!({"x": eye.x, "y": eye.y}));
+ h.frames(2);
+ assert!(h.app.session.visibility.hidden_bodies.iter().any(|b| b == "Block"), "the body's eye hides it");
+ h.call("ui.click", json!({"x": xy.x, "y": xy.y, "button": "right"}));
+ h.frames(2);
+ assert_eq!(h.app.menu.target, crate::context_menu::Target::OriginPlane { name: "XY".into() }, "the plane's own menu");
+ crate::context_menu::close(&mut h.app);
+ h.frames(2);
+ let other = in_history("row:Other").unwrap();
+ h.call("ui.click", json!({"x": other.x, "y": other.y}));
+ h.frames(2);
+ assert_eq!(h.app.session.selection, vec![solidcraft_engine::Sel::Body { name: "Other".into() }]);
+
+ // Neither the marker nor a feature drops among these rows.
+ let order = |h: &Harness| h.app.session.doc.features.iter().map(|f| f.name.clone()).collect::<Vec<_>>();
+ let before = order(&h);
+ h.step(&json!({"drag": [{"handle": "timeline:rollback"}, [origin.x, origin.y]]})).unwrap();
+ assert_eq!(h.app.session.doc.marker, None, "the marker stays at the end");
+ h.step(&json!({"drag": [{"handle": "timeline:Second"}, [bodies.x, bodies.y]]})).unwrap();
+ assert_eq!(order(&h), before, "the feature keeps its place");
+ let first = handle_at("timeline:First").unwrap();
+ h.step(&json!({"drag": [{"handle": "timeline:Second"}, [first.x, first.y - 8.0]]})).unwrap();
+ assert_eq!(order(&h), vec!["Second".to_string(), "First".to_string()], "the first feature's top is still a place");
+
+ // Under the browser too; not in the icons-only width, nor in the bottom strip.
+ h.app.preferences.timeline_under_browser = true;
+ h.frames(4);
+ assert!(in_history("row:Origin").is_some());
+ h.app.preferences.timeline_under_browser = false;
+ h.app.preferences.timeline_left_width = crate::ui_kit::history_width(false);
+ h.frames(4);
+ assert!(in_history("row:Origin").is_none(), "no room for the rows without names");
+ h.app.preferences.timeline_left = false;
+ h.frames(4);
+ assert_eq!(crate::scenario::handles("row:Origin").into_iter().filter(|(n, _)| n == "row:Origin").count(), 1, "only the browser's");
+ }
+
+ /// In a design with components, the Bodies folder is the active component's, in the
+ /// placement being edited, as the browser lists it under that placement.
+ #[test]
+ fn the_history_lists_the_active_components_bodies() {
+ let mut h = Harness::new();
+ h.app.preferences.timeline_left = true;
+ h.app.preferences.timeline_left_width = 240.0;
+ h.app.preferences.timeline_origin_bodies = true;
+ h.app.run("solid.box", json!({"length": 10, "width": 10, "height": 10, "body_name": "RootBlock"})).unwrap();
+ h.app.run("component.create", json!({"name": "Part"})).unwrap();
+ h.app.run("solid.box", json!({"length": 10, "width": 10, "height": 10, "corner": [20, 0, 0], "body_name": "Inside"})).unwrap();
+ h.frames(4);
+ assert!(in_history("row:Inside").is_some() && in_history("row:RootBlock").is_none(), "the active component's bodies");
+ assert!(in_history("row:Origin").is_some());
+ h.app.run("component.activate", json!({"component": "root"})).unwrap();
+ h.frames(4);
+ assert!(in_history("row:RootBlock").is_some() && in_history("row:Inside").is_none(), "the root's own bodies");
+ }
+
#[test]
fn rollback_bar_above_last_feature_can_be_dragged_to_the_end() {
let mut harness = Harness::new();
diff --git a/crates/ui-egui/tests/scenarios/history_origin_bodies.json b/crates/ui-egui/tests/scenarios/history_origin_bodies.json
new file mode 100644
index 0000000000..7b2ba70c5f
--- /dev/null
+++ b/crates/ui-egui/tests/scenarios/history_origin_bodies.json
@@ -0,0 +1,22 @@
+[
+ {"note": "#6490: Show origin and bodies at the top. The History on the left starts with the Bodies folder and the Origin, the browser's own rows; their folds and eyes work there. The browser is hidden so every row handle below is the History's."},
+ {"call": "engine.execute", "params": {"command": "solid.box", "params": {"length": 10, "width": 10, "height": 10, "body_name": "Block"}}},
+ {"call": "ui.set", "params": {"showBrowser": false}},
+ {"call": "engine.execute", "params": {"command": "view.history_layout", "params": {"dock": "left"}}},
+ {"frames": 3},
+ {"note": "Off by default: the History lists only the features."},
+ {"expect": {"hidden_handles": ["row:Bodies", "row:Origin"]}},
+ {"call": "ui.prefs", "params": {"timeline_origin_bodies": true}},
+ {"frames": 3},
+ {"expect": {"shown_handles": ["row:Bodies", "row:Block", "row:Origin"], "hidden_handles": ["row:XY"]}},
+ {"click": {"handle": "row:Origin"}},
+ {"frames": 2},
+ {"expect": {"shown_handles": ["row:XY", "row:XZ", "row:YZ", "eye:XY"]}},
+ {"click": {"handle": "eye:Block"}},
+ {"frames": 2},
+ {"expect": {"hidden": ["Block"]}},
+ {"note": "The History at the bottom is unchanged."},
+ {"call": "engine.execute", "params": {"command": "view.history_layout", "params": {"dock": "bottom"}}},
+ {"frames": 3},
+ {"expect": {"hidden_handles": ["row:Bodies", "row:Origin"]}}
+]
diff --git a/docs/book/src/guide/ui-tour.md b/docs/book/src/guide/ui-tour.md
index a0a4664cd4..dcddfb5bda 100644
--- a/docs/book/src/guide/ui-tour.md
+++ b/docs/book/src/guide/ui-tour.md
@@ -129,6 +129,12 @@ General › **Show text under ribbon icons** is a separate, saved option for eit
layout. Turn it off for shorter icon-only command buttons; tooltips, section names
and command menus remain available.
+Interface › Layout › **Show origin and bodies at the top** (off by default) puts the active
+component's Bodies folder and the Origin (planes, axes and point) at the top of the History when
+it sits on the left or under the browser and is wide enough for names. They are the browser's own
+rows: the same eyes, folds and right-click menus, so one list is enough for single-part work. The
+History at the bottom is unchanged.
+
### Colour themes
Interface › **Theme** lists Dark, Light and System (follows the operating system), the built-in
diff --git a/docs/control-protocol.md b/docs/control-protocol.md
index 5eb7728edc..456e420136 100644
--- a/docs/control-protocol.md
+++ b/docs/control-protocol.md
@@ -303,7 +303,7 @@ labels; `prefs:measure_axis_distances` identifies the checkbox.
| `ui.home` | `open?`: bool; `sample?`: index | the start page: show or hide it, open a built-in sample (once built); returns `open` and the recent designs |
| `ui.shortcut` | `command`, `key?`, `replace?` | a command's key, or rebinds it (`""` clears; a key another command uses is refused unless `replace`) |
| `ui.help` | `item?`: `about`, `shortcuts` (read only), `report` (opens a report draft for review), `crashes` (the Crash Reports window) | the version, commit, build date and diagnostic text |
-| `ui.prefs` | any of `default_units`, `nav` (`fusion`, `solidworks`, `inventor`, `alias`, `blender`, `tinkercad`, `openscad`, `touchpad`), `zoom_reverse`, `pan_reverse_x` (default false: horizontal scrolling pans the other way), `zoom_to_cursor`, `smooth_wheel_zoom` (default true), `trackpad_pan` (default true: two-finger scroll pans, except Touchpad always zooms; pinch zooms), `orbit_around` (`view_centre` (default: what Pan moves and Fit frames), `origin` (the world origin stays still on screen), `cursor` (the model point under the pointer when the drag began); the older `orbit_cursor` boolean still sets `cursor` when true), `sketch_exit_view` (`keep` (default: the view stays where it is when a sketch ends), `previous` (back to the view from before the sketch), `unless_rotated` (back unless the sketch view was turned)), `look_at_anim`, `look_at_speed`, `middle_double_click` (`home` (default), `fit`, `off`), `msaa`, `show_frame_rate` (default false: frames per second in the view's bottom-right corner, counting the frames the view draws anyway; it reads 0 FPS once the view is idle), `window_system` (Linux: `auto` (default: XWayland whenever there is an X display, native Wayland on niri), `wayland`, `x11`; saved in `graphics.json`, applies at the next start; `SOLIDCRAFT_WAYLAND` overrides it), `graphics_adapter` (exact card name, or empty for Automatic; applies after restart; `WGPU_ADAPTER_NAME` takes precedence), `frame_rate_details` (default false: with the frame rate, a frame-time graph of the frames drawn with the triangles over it, a frame-time histogram and what the GPU drew; clicking the readout switches it), `length_decimals`, `angle_decimals`, `step_values` (default false: Up/Down and the wheel step a plain number in a focused value field), `theme` (`dark`, `light`, `system` or a theme file's id: a built-in one such as `gruvbox-dark`, or an imported one; the reply's `theme_ids` lists them), `viewport_theme` (`theme` (default: the theme's own), `light`, `dark`: the 3D view in the Light or Dark theme's colours whatever the window uses, #4146), `theme_import` (a `solidcraft-theme/1` file's JSON or text: adds the theme and turns it on; the reply's `theme_imported` is its id), `theme_remove` (an imported theme's id), `theme_export: true` (the reply's `theme_file` is the theme on now as a complete file; see [colour themes](book/src/guide/ui-tour.md#colour-themes)), `language` (`en`, `ar`, `ja`, `de`, `fr`, `he`, `ko`, `ms`, `ru`, `uk`, `zh`; see [localization](localization.md)), `ui_scale`, `ui_font` (an installed font family or a font file for the interface; empty for the built-in font), `up_axis` (`z`, `y`), `offer_stand_up`, `extrude_auto_to_object` (default false: in the Extrude dialog, with a profile picked, a face, vertex or parallel plane picked off its plane switches the extent to To Object; it applies to Extrude dialogs opened afterwards), `hole_snaps` (default false: a Single hole snaps to its face's middle and round edges' centres), `hole_moves` (default false: a placed Single hole has a drag handle (`hole:<n>`), and a pick on a face that has a hole moves it there), `placement_handles` (default false: handles on the preview of a Rest, Boss or Snap Fit that move it across the model and turn it), `color_vision` (`off` (default), `protan`, `deutan`, `tritan`: colour vision modes, #778), `view_confirm_corner` (default false: while a dialog or a sketch is open, a check and a cross at the view's top right, handles `view:confirm:ok` and `view:confirm:cancel`, do what the dialog's OK and Cancel do, or Finish Sketch and Cancel Sketch; the axis view or cube moves down below them, #6709), `history_sketches` (`in_order` (default), `under_feature`: the History at the left lists a sketch under the first feature built from it, #6489; the timeline at the bottom keeps the creation order), `dialog_buttons` (`bottom` (default), `top`: a feature dialog's OK, Cancel and Apply sit in its title row instead of under its inputs, #6708; the buttons keep their handles, and `dialog:close` is then Cancel's), `check_updates` (default true; [updates](book/src/guide/updates.md)), `nav_bridge_enabled` (default false) and `nav_bridge_port` (default 8765: a device's own app on this computer moves the view, [the navigation bridge](3d-mouse.md#device-apps-the-navigation-bridge)); `open` (a page: General, Interface, Design, Navigation, Keyboard Shortcuts, Sketch, Graphics, AI, Plugins; Shortcuts, Assistant and Sketch & selection are aliases, and the former Selection page opens Sketch) opens the Preferences dialog there; `button`: `ok`, `cancel`, `apply`, `defaults`; `stand_up: true` stands up a just-opened Y-up file, `stand_up: false` leaves it as it is ("Leave it": the offer closes and `offer_stand_up` stays on); the offer's buttons are the handles `stand_up:stand`, `stand_up:leave` and `stand_up:never` | sets preferences (kept between runs), returns them all plus `dialog` (the open page or null), `dark`, `viewport_dark` (whether the 3D view is dark) and `stand_up_offer` |
+| `ui.prefs` | any of `default_units`, `nav` (`fusion`, `solidworks`, `inventor`, `alias`, `blender`, `tinkercad`, `openscad`, `touchpad`), `zoom_reverse`, `pan_reverse_x` (default false: horizontal scrolling pans the other way), `zoom_to_cursor`, `smooth_wheel_zoom` (default true), `trackpad_pan` (default true: two-finger scroll pans, except Touchpad always zooms; pinch zooms), `orbit_around` (`view_centre` (default: what Pan moves and Fit frames), `origin` (the world origin stays still on screen), `cursor` (the model point under the pointer when the drag began); the older `orbit_cursor` boolean still sets `cursor` when true), `sketch_exit_view` (`keep` (default: the view stays where it is when a sketch ends), `previous` (back to the view from before the sketch), `unless_rotated` (back unless the sketch view was turned)), `look_at_anim`, `look_at_speed`, `middle_double_click` (`home` (default), `fit`, `off`), `msaa`, `show_frame_rate` (default false: frames per second in the view's bottom-right corner, counting the frames the view draws anyway; it reads 0 FPS once the view is idle), `window_system` (Linux: `auto` (default: XWayland whenever there is an X display, native Wayland on niri), `wayland`, `x11`; saved in `graphics.json`, applies at the next start; `SOLIDCRAFT_WAYLAND` overrides it), `graphics_adapter` (exact card name, or empty for Automatic; applies after restart; `WGPU_ADAPTER_NAME` takes precedence), `frame_rate_details` (default false: with the frame rate, a frame-time graph of the frames drawn with the triangles over it, a frame-time histogram and what the GPU drew; clicking the readout switches it), `length_decimals`, `angle_decimals`, `step_values` (default false: Up/Down and the wheel step a plain number in a focused value field), `theme` (`dark`, `light`, `system` or a theme file's id: a built-in one such as `gruvbox-dark`, or an imported one; the reply's `theme_ids` lists them), `viewport_theme` (`theme` (default: the theme's own), `light`, `dark`: the 3D view in the Light or Dark theme's colours whatever the window uses, #4146), `theme_import` (a `solidcraft-theme/1` file's JSON or text: adds the theme and turns it on; the reply's `theme_imported` is its id), `theme_remove` (an imported theme's id), `theme_export: true` (the reply's `theme_file` is the theme on now as a complete file; see [colour themes](book/src/guide/ui-tour.md#colour-themes)), `language` (`en`, `ar`, `ja`, `de`, `fr`, `he`, `ko`, `ms`, `ru`, `uk`, `zh`; see [localization](localization.md)), `ui_scale`, `ui_font` (an installed font family or a font file for the interface; empty for the built-in font), `up_axis` (`z`, `y`), `offer_stand_up`, `extrude_auto_to_object` (default false: in the Extrude dialog, with a profile picked, a face, vertex or parallel plane picked off its plane switches the extent to To Object; it applies to Extrude dialogs opened afterwards), `hole_snaps` (default false: a Single hole snaps to its face's middle and round edges' centres), `hole_moves` (default false: a placed Single hole has a drag handle (`hole:<n>`), and a pick on a face that has a hole moves it there), `placement_handles` (default false: handles on the preview of a Rest, Boss or Snap Fit that move it across the model and turn it), `color_vision` (`off` (default), `protan`, `deutan`, `tritan`: colour vision modes, #778), `view_confirm_corner` (default false: while a dialog or a sketch is open, a check and a cross at the view's top right, handles `view:confirm:ok` and `view:confirm:cancel`, do what the dialog's OK and Cancel do, or Finish Sketch and Cancel Sketch; the axis view or cube moves down below them, #6709), `history_sketches` (`in_order` (default), `under_feature`: the History at the left lists a sketch under the first feature built from it, #6489; the timeline at the bottom keeps the creation order), `dialog_buttons` (`bottom` (default), `top`: a feature dialog's OK, Cancel and Apply sit in its title row instead of under its inputs, #6708; the buttons keep their handles, and `dialog:close` is then Cancel's), `timeline_origin_bodies` (default false: the History on the left or under the browser starts with the active component's Bodies folder and the Origin, the browser's rows with their eyes, folds and menus; the bottom History is unchanged), `check_updates` (default true; [updates](book/src/guide/updates.md)), `nav_bridge_enabled` (default false) and `nav_bridge_port` (default 8765: a device's own app on this computer moves the view, [the navigation bridge](3d-mouse.md#device-apps-the-navigation-bridge)); `open` (a page: General, Interface, Design, Navigation, Keyboard Shortcuts, Sketch, Graphics, AI, Plugins; Shortcuts, Assistant and Sketch & selection are aliases, and the former Selection page opens Sketch) opens the Preferences dialog there; `button`: `ok`, `cancel`, `apply`, `defaults`; `stand_up: true` stands up a just-opened Y-up file, `stand_up: false` leaves it as it is ("Leave it": the offer closes and `offer_stand_up` stays on); the offer's buttons are the handles `stand_up:stand`, `stand_up:leave` and `stand_up:never` | sets preferences (kept between runs), returns them all plus `dialog` (the open page or null), `dark`, `viewport_dark` (whether the 3D view is dark) and `stand_up_offer` |
| `ui.capture` | `action?`: `capture`, `revert`, `cancel` | answers the Capture Position question (asked when a command starts or the design is saved while components were moved without capturing); without `action`, what waits |
| `ui.window` | `action`: minimize, maximize, restore, toggle, close | what the title bar's caption buttons do (on Windows and Linux the application bar is the title bar); close asks about unsaved designs first |
| `ui.agent_cursor` | `show` (bool), `speed`: a number from 1 to 5 (times the normal speed) or `"instant"` (no animation: the command runs at once and the pointer jumps to where it acted), `follow_camera` (bool); all optional | the settings. While the cursor is shown, `engine.execute` first glides to the command's toolbar button and to each pick, then runs and replies; later requests wait their turn. The pointer shows the command's localized name, including commands inside a closed toolbar group; an animated batch names each command it visits. It also follows the pointer input sent with `ui.move`, `ui.click`, `ui.drag` and `ui.scroll`, as each event reaches the app, and a press leaves a ripple. `"animate": false` on a call skips it |