Skip to content

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

Save: the status line says where the design was saved (#8693) (#8705)

semmelrinde883f8e8e9028
diff --git a/assets/locales/pending/design-saved-status.json b/assets/locales/pending/design-saved-status.json
new file mode 100644
index 0000000000..cf982b3679
--- /dev/null
+++ b/assets/locales/pending/design-saved-status.json
@@ -0,0 +1,68 @@
+{
+ "en": {
+ "ui.design_saved": "Saved {path}"
+ },
+ "ar": {
+ "ui.design_saved": "تم الحفظ في {path}"
+ },
+ "cs": {
+ "ui.design_saved": "Uloženo do {path}"
+ },
+ "de": {
+ "ui.design_saved": "Gespeichert unter {path}"
+ },
+ "es": {
+ "ui.design_saved": "Guardado en {path}"
+ },
+ "fr": {
+ "ui.design_saved": "Enregistré dans {path}"
+ },
+ "gl": {
+ "ui.design_saved": "Gardado en {path}"
+ },
+ "he": {
+ "ui.design_saved": "נשמר ב־{path}"
+ },
+ "hu": {
+ "ui.design_saved": "Mentve ide: {path}"
+ },
+ "id": {
+ "ui.design_saved": "Disimpan ke {path}"
+ },
+ "it": {
+ "ui.design_saved": "Salvato in {path}"
+ },
+ "ja": {
+ "ui.design_saved": "{path} に保存しました"
+ },
+ "ms": {
+ "ui.design_saved": "Disimpan ke {path}"
+ },
+ "nb": {
+ "ui.design_saved": "Lagret i {path}"
+ },
+ "nl": {
+ "ui.design_saved": "Opgeslagen in {path}"
+ },
+ "ro": {
+ "ui.design_saved": "Salvat în {path}"
+ },
+ "sv": {
+ "ui.design_saved": "Sparad i {path}"
+ },
+ "tr": {
+ "ui.design_saved": "{path} konumuna kaydedildi"
+ },
+ "uk": {
+ "ui.design_saved": "Збережено в {path}"
+ },
+ "vi": {
+ "ui.design_saved": "Đã lưu vào {path}"
+ },
+ "zh": {
+ "ui.design_saved": "已保存到 {path}"
+ },
+ "zh-TW": {
+ "ui.design_saved": "已儲存至 {path}"
+ }
+}
diff --git a/crates/ui-egui/src/file_picker.rs b/crates/ui-egui/src/file_picker.rs
index a2f0c64cdd..3ce98a589f 100644
--- a/crates/ui-egui/src/file_picker.rs
+++ b/crates/ui-egui/src/file_picker.rs
@@ -287,6 +287,19 @@ mod tests {
}
}
+ /// Saving the design says where it went, as an export does (#8693).
+ #[test]
+ fn saving_the_design_says_where_it_went() {
+ let mut h = crate::scenario::Harness::new();
+ let path = h.dir.join("Bracket.sc").to_string_lossy().into_owned();
+ h.app.run("file.save", json!({"path": path})).unwrap();
+ assert!(h.app.status.as_ref().is_some_and(|(text, _, error)| *text == format!("Saved {path}") && !error), "{:?}", h.app.status);
+ // A save that fails says so instead.
+ let missing = h.dir.join("missing").join("Bracket.sc").to_string_lossy().into_owned();
+ assert!(h.app.run("file.save", json!({"path": missing})).is_err());
+ assert!(h.app.status.as_ref().is_some_and(|(_, _, error)| *error), "{:?}", h.app.status);
+ }
+
#[test]
fn sheet_exports_without_a_sheet_report_an_error_without_a_picker() {
let mut h = crate::scenario::Harness::new();
diff --git a/crates/ui-egui/src/lib.rs b/crates/ui-egui/src/lib.rs
index 9404ec32fa..ee7e7bdf53 100644
--- a/crates/ui-egui/src/lib.rs
+++ b/crates/ui-egui/src/lib.rs
@@ -1290,6 +1290,9 @@ impl SolveApp {
self.home.add_recent(&p);
if matches!(id, "file.save" | "file.save_as") {
home::remember_session(&mut self.home, &self.session);
+ // Say where it went, as an export does (#8693).
+ let saved = self.tr("ui.design_saved").replace("{path}", &p);
+ self.set_status(saved, false);
}
}
}