From 6ecabc34511a26e617014fcd8e8192b74ff4b920 Mon Sep 17 00:00:00 2001 From: lforgiarini <97414997+lforgiarini@users.noreply.github.com> Date: Wed, 28 Oct 2026 19:50:08 +0100 Subject: [PATCH] fix(ui): several block references show the dynamic block's name; gaps.md status line The Name row of the several-objects Properties palette used the block's own name, which for a dynamic block is an anonymous `*U..` that differs from one reference to the next. It now resolves each reference's name as the single-object palette does. docs/gaps.md: status line updated for the revision entry. Co-Authored-By: Claude Sonnet 5.5 --- crates/ui-egui/src/palettes.rs | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/crates/ui-egui/src/palettes.rs b/crates/ui-egui/src/palettes.rs index 63e18c8f9..8ab4508b1 100644 --- a/crates/ui-egui/src/palettes.rs +++ b/crates/ui-egui/src/palettes.rs @@ -1327,8 +1327,21 @@ pub(crate) fn properties_section(app: &mut CadApp, ui: &mut egui::Ui) { } EntityKind::Insert(_) => { let insert = |k: &EntityKind| if let EntityKind::Insert(i) = k { Some(i.clone()) } else { None }; + // A dynamic block reference shows its dynamic block's name, as with one reference; + // its anonymous blocks (`*U12`) differ from one reference to the next. + let names: Vec = sel + .iter() + .filter_map(|h| match d.entity(*h).map(|x| &x.kind) { + Some(EntityKind::Insert(i)) => Some(custom_properties(ui, app, *h).map_or_else(|| i.block.clone(), |(n, _)| n)), + _ => None, + }) + .collect(); + let name = match names.first() { + Some(n0) if names.iter().all(|n| n == n0) => n0.clone(), + _ => VARIES.to_string(), + }; for (label, value) in [ - ("Name", shared(&|k| insert(k).map(|i| i.block))), + ("Name", name), ("Position X", shared(&|k| insert(k).map(|i| len(i.insert.x)))), ("Position Y", shared(&|k| insert(k).map(|i| len(i.insert.y)))), ("Position Z", shared(&|k| insert(k).map(|i| len(i.insert.z)))),