Skip to content

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

Preferences: the File view entry and the search field carry the window's name (#8318) (#8432)

Colin Faulkingham90ef106e5f24
diff --git a/assets/locales/en.json b/assets/locales/en.json
index 29132e69f0..7e7b8e70c1 100644
--- a/assets/locales/en.json
+++ b/assets/locales/en.json
@@ -720,7 +720,7 @@
"a picked edge is gone": "a picked edge is gone",
"a picked edge's body is gone": "a picked edge's body is gone",
"add a key for a joint first": "add a key for a joint first",
- "ai.connected_toast": "SolidCraft is now available in {clients}. Restart them to use it (Settings > Assistant).",
+ "ai.connected_toast": "SolidCraft is now available in {clients}. Restart them to use it (Preferences > Assistant).",
"ai.prefs.allow_control": "Let AI agents connect (control channel / MCP)",
"ai.prefs.allow_control_note": "Opens a control channel on this computer only (127.0.0.1, port 27878 or the next free one). A program that connects must also show a secret token that only your user account can read, made fresh at every start. Takes effect the next time SolidCraft starts. Off: nothing listens unless you start SolidCraft with --control.",
"ai.prefs.availability": "Assistant controls",
@@ -1416,7 +1416,7 @@
"home.recovery_hint": "SolidCraft closed before these designs were saved.",
"home.report_issue": "Report an Issue",
"home.samples": "Samples",
- "home.settings": "Settings",
+ "home.settings": "Preferences",
"home.short_date": "{day} {month}",
"home.shortcuts": "Keyboard shortcuts",
"home.start_hint": "Create a design, open a recent file, or explore a sample.",
@@ -1837,8 +1837,8 @@
"prefs.saving": "Autosave and recovery",
"prefs.scale_note": "Also Ctrl + / Ctrl − in the window. Buttons are 28 px at 100%.",
"prefs.scale_text": "Scale and text",
- "prefs.search": "Search settings",
- "prefs.search_empty": "No matching settings",
+ "prefs.search": "Search preferences",
+ "prefs.search_empty": "No matching preferences",
"prefs.select": "Select",
"prefs.select_one_item": "Select one item",
"prefs.selecting": "Selecting",
diff --git a/crates/ui-egui/src/home.rs b/crates/ui-egui/src/home.rs
index 9f1e5613c7..75a0d54dc7 100644
--- a/crates/ui-egui/src/home.rs
+++ b/crates/ui-egui/src/home.rs
@@ -1490,6 +1490,17 @@ mod tests {
assert!(!h.app.home.open);
}
+ /// The entry that opens Preferences (Cmd / Ctrl + `,`) carries the window's own name
+ /// (#8318): beside the File menu's "Preferences…" it read "Settings" for the same window.
+ #[test]
+ fn the_entry_that_opens_preferences_carries_the_windows_name() {
+ let mut h = crate::scenario::Harness::new();
+ h.app.home.show(0);
+ assert_eq!(crate::i18n::tr("home.settings"), crate::i18n::tr("ui.preferences"), "one name for the window");
+ click_file(&mut h, "home:settings");
+ assert!(h.app.prefs_window.open, "the entry opens Preferences");
+ }
+
#[test]
fn file_view_narrow_navigation_and_content_stay_inside_the_window() {
for dark in [false, true] {
diff --git a/crates/ui-egui/src/prefs_search.rs b/crates/ui-egui/src/prefs_search.rs
index ef78e332fe..6eca73243c 100644
--- a/crates/ui-egui/src/prefs_search.rs
+++ b/crates/ui-egui/src/prefs_search.rs
@@ -696,6 +696,17 @@ mod tests {
assert!(!matches_text("dark", &["Units of new designs"]));
}
+ /// The search field and its empty result name the window they search (#8318): "Search
+ /// settings" under a "Preferences" title read as two names for one window.
+ #[test]
+ fn the_search_field_names_the_window_it_searches() {
+ let name = crate::i18n::tr("ui.preferences").to_lowercase();
+ for id in ["prefs.search", "prefs.search_empty"] {
+ let text = crate::i18n::tr(id).to_lowercase();
+ assert!(text.contains(&name), "`{text}` should name the window `{name}`");
+ }
+ }
+
/// Typing focuses the field, Enter opens that setting, and Escape returns to the page
/// that was up when the search started. Recording a shortcut keeps the key.
#[test]
@@ -803,7 +814,7 @@ mod tests {
assert!(h.widget("Mouse mapping").is_some(), "the dropdown's current value counts");
h.app.prefs_window.filter = "zzzz-no-setting".into();
h.frames(2);
- assert!(h.widget("No matching settings").is_some());
+ assert!(h.widget("No matching preferences").is_some());
h.app.prefs_window.filter = "units".into();
h.frames(2);
h.step(&serde_json::json!({"click": {"handle": "prefs:page:Design"}})).expect("design page");
diff --git a/crates/ui-egui/tests/scenarios/preferences_search.json b/crates/ui-egui/tests/scenarios/preferences_search.json
index e72079d1ac..e635dfc327 100644
--- a/crates/ui-egui/tests/scenarios/preferences_search.json
+++ b/crates/ui-egui/tests/scenarios/preferences_search.json
@@ -1,5 +1,5 @@
[
- {"note": "With Preferences open and nothing being edited, typing focuses Search settings and the letters are the query. Enter opens that setting on its own page."},
+ {"note": "With Preferences open and nothing being edited, typing focuses Search preferences and the letters are the query. Enter opens that setting on its own page."},
{"click": {"handle": "titlebar:preferences"}},
{"expect": {"shown": "Restore Defaults", "prefs": {"dialog": "General"}}},
{"text": "zo"},