refactor(properties): entity property groups return Vec<PropSection>

Groundwork for making the Properties panel conform to the per-entity group/row
spec (PROPERTIES.md). The panel already renders a Vec of sections, but each
entity could only express a single geometry section.

Change PropertyEditable::geometry_properties (and the EntityTypeOps enum
dispatch) to return Vec<PropSection>, update the two impl macros, and flatten
in properties_sectioned so the panel shows [General] + the entity's groups.
Every entity builder is wrapped to return its existing section as a one-element
Vec — pure mechanical change, no rows or titles altered, panel output identical.

Enables Phase 2: rewriting each entity's groups/rows to match the spec.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
Hakan SevenandClaude Opus 4.8 committed 2026-07-02 22:46:19 +03:00
1 parent 8164e14a19
commit b2b2bfb246
31 files changed
+147 -139

No files matched your search

+4 -4
View File
@@ -8,7 +8,7 @@ use crate::scene::model::object::{GripApply, GripDef, PropSection, PropValue, Pr
use crate::scene::convert::tess_util::{arc_segments, arc_signed_span, wire_chord_tol, FallbackGeometry};
use crate::scene::model::wire_model::SnapHint;
fn properties(h: &Hatch) -> PropSection {
fn properties(h: &Hatch) -> Vec<PropSection> {
let pattern_type = match h.pattern_type {
acadrust::entities::HatchPatternType::Predefined => "Predefined",
acadrust::entities::HatchPatternType::UserDefined => "User Defined",
@@ -39,7 +39,7 @@ fn properties(h: &Hatch) -> PropSection {
.sum::<usize>()
})
.sum();
PropSection {
vec![PropSection {
title: "Geometry".into(),
props: vec![
ro("Fill Type", "fill_type", fill_type),
@@ -73,7 +73,7 @@ fn properties(h: &Hatch) -> PropSection {
format!("{:.3}, {:.3}, {:.3}", h.normal.x, h.normal.y, h.normal.z),
),
],
}
}]
}
fn apply_geom_prop(h: &mut Hatch, field: &str, value: &str) {
@@ -103,7 +103,7 @@ fn apply_transform(h: &mut Hatch, t: &EntityTransform) {
}
impl PropertyEditable for Hatch {
fn geometry_properties(&self, _text_style_names: &[String]) -> PropSection {
fn geometry_properties(&self, _text_style_names: &[String]) -> Vec<PropSection> {
properties(self)
}