fix(dock): block palette reflects new blocks without reopening

Creating a block from selected entities now bumps the geometry epoch, so the
block palette's per-update stale check notices the new definition and refreshes
its list in place instead of requiring the user to close and reopen the panel.
This commit is contained in:
Karim Jerbi committed 2026-08-14 21:21:40 +01:00
1 parent bd33600ee7
commit dceb9626ae
2 files changed
+49 -1

No files matched your search

+6 -1
View File
@@ -698,7 +698,12 @@ impl Scene {
let mut insert = DxfInsert::new(name, acadrust::types::Vector3::ZERO);
acadrust::Entity::apply_transform(&mut insert, block_to_world);
Ok(self.add_entity(EntityType::Insert(insert)))
let insert_handle = self.add_entity(EntityType::Insert(insert));
// A new block definition landed in the document; advance the block
// epoch so consumers (the block palette stale check) notice it even
// when the panel stays open. Mirrors `define_block_from_owned_entities`.
self.bump_geometry();
Ok(insert_handle)
}
/// Define a new block named `name` from `entities` (owned, not yet in the