feat: strengthen sketches, feature editing, and independent assemblies

This commit is contained in:
bherbruck committed 2026-10-11 02:44:31 -04:00
1 parent 07932d0f42
commit 0398a813c8
65 files changed
+7082 -268

No files matched your search

+5 -7
View File
@@ -819,13 +819,11 @@ pub fn world_preview(s: &Session, cmds: &[(String, Value)], colors: Colors) -> O
if cmds.is_empty() || !(moves || solvecraft_engine::frames::placed(s)) {
return None;
}
let mut scratch = s.scratch();
for (id, p) in cmds {
if let Err(e) = scratch.execute(id, p) {
return Some(Err(e.to_string()));
}
}
let (before, after) = (s.world_state(), scratch.world_state());
let preview = match s.preview_visible_world(cmds) {
Ok(preview) => preview,
Err(error) => return Some(Err(error.to_string())),
};
let (before, after) = (preview.before, preview.after);
// A moved component looks like itself (no new surface), with its old place as the ghost.
let colors = Colors { added: colors.body, ..colors };
let built = std::panic::catch_unwind(std::panic::AssertUnwindSafe(|| crate::preview::build(&before, &after, colors)));