Edit Sketch no longer shows bodies a later feature deletes (#1329)

Fixes #1167. While a sketch is edited, a body that a rolled-off, unsuppressed Remove deletes is not shown (unless the sketch is built on it); the history stays rolled back, only the view changes. Drawing, picking, screenshots, thumbnails and the browser's Bodies folder agree; document.inspect reports removed_later. Checked on main + this branch: cargo check --workspace, the engine sketch_edit_removed/occurrences tests and the UI viewport/browser tests.
This commit is contained in:
Lasse Lian authored and GitHub committed 2026-10-15 06:34:01 -04:00
1 parent 5fa8e7d60a
commit 9fbbf8dc3a
9 files changed
+332 -4

No files matched your search

+7 -1
View File
@@ -1248,7 +1248,7 @@ fn entries(app: &SolveApp, comp: u64, folder: &str) -> Vec<Entry> {
.state()
.bodies
.iter()
.filter(|b| doc.model_body_component(b) == comp)
.filter(|b| doc.model_body_component(b) == comp && !app.session.body_removed_later(&b.name))
.map(|b| Entry {
key: b.name.clone(),
row_key: format!("b:{}", b.name),
@@ -1960,6 +1960,12 @@ fn occurrence_origin(app: &SolveApp, occurrence: u64) -> Option<solidcraft_engin
Some(solidcraft_engine::doc::apply_point(&solidcraft_engine::doc::mat_mul(&parent, &own), solidcraft_engine::geom::Vec3::ZERO))
}
/// The names the Bodies folder lists at the top level, for tests.
#[cfg(test)]
pub(crate) fn body_rows(app: &SolveApp) -> Vec<String> {
entries(app, 0, "bodies").into_iter().map(|e| e.key).collect()
}
#[cfg(test)]
#[path = "section_browser_tests.rs"]
mod section_browser_tests;