feat(block-editor): isolate session history and add save checkpoints

This commit is contained in:
Karim Jerbi committed 2026-10-13 15:35:24 +01:00
1 parent 535710e5d1
commit f39fb31137
15 files changed
+1002 -255

No files matched your search

+6
View File
@@ -700,6 +700,9 @@ impl OpenCADStudio {
};
match req["op"].as_str().unwrap_or("") {
"new" => {
if self.tabs[self.active_tab].block_edit_history.is_some() {
return err("Close the block editor before replacing the drawing.");
}
if let Some(template) = req["template"].as_str() {
let purged = match self.apply_template(template) {
Ok(purged) => purged,
@@ -723,6 +726,9 @@ impl OpenCADStudio {
}
#[cfg(not(target_arch = "wasm32"))]
"open" => {
if self.tabs[self.active_tab].block_edit_history.is_some() {
return err("Close the block editor before replacing the drawing.");
}
let Some(path) = req["path"].as_str() else {
return err("open: missing \"path\"");
};