refactor(entities): collocate ui_name + dxf_name into entities/names.rs
Two near-identical match-on-EntityType tables lived far apart: scene/properties.rs::entity_type_name returned mixed-case UI labels; app/commands.rs::entity_type_name returned uppercase DXF record names. Both enumerated ~30 variants; adding a new entity meant remembering to touch two files in two crates' worth of source layout. Move both into a single entities/names.rs as `ui_name()` and `dxf_name()`. Adjacent so a new variant gets both labels added at once; function names make the intended audience explicit at the callsite. scene/properties.rs and app/commands.rs each lose their local match plus one re-export, gaining a `crate::entities::names::*` call. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
parent
9b5073752d
commit
5da32ff202
5 changed files with 104 additions and 87 deletions
|
|
@ -164,7 +164,7 @@ pub(super) fn next_group_auto_name(scene: &crate::scene::Scene) -> String {
|
|||
// ── Entity type labels ─────────────────────────────────────────────────────
|
||||
|
||||
pub(super) fn entity_type_label(entity: &acadrust::EntityType) -> String {
|
||||
crate::scene::properties::entity_type_name(entity).to_string()
|
||||
crate::entities::names::ui_name(entity).to_string()
|
||||
}
|
||||
|
||||
pub(super) fn entity_type_key(entity: &acadrust::EntityType) -> String {
|
||||
|
|
|
|||
Loading…
Reference in a new issue