git.lucas.co / cce-designer
graphic design tool
git clone https://git.lucas.co/cce-designer.git

commit007c81b3450ca67e9a10a0403a7def2d4c8b0c9f
parent1e36689108
authorLucas Galante <lsgalante12@gmail.com>
date2026-10-01 19:18
feat: the Attribute node's Attribute Name row is labelled Name

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

 nodes/attribute.json |  1 +
 src/main.rs          | 12 +++++++++++-
 2 files changed, 12 insertions(+), 1 deletion(-)

diff --git a/nodes/attribute.json b/nodes/attribute.json
index 46cabea..2ab52f3 100644
--- a/nodes/attribute.json
+++ b/nodes/attribute.json
@@ -18,6 +18,7 @@
     },
     {
       "name": "Attribute Name",
+      "label": "Name",
       "type": "attribute",
       "default": "attr1",
       "description": "The point attribute to work on. Pos and Col are the built-in position and colour; they can be modified but not created or deleted."
diff --git a/src/main.rs b/src/main.rs
index d272d90..f51bb51 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -4575,12 +4575,22 @@ mod tests {
         let row = |name: &str| {
             rows.iter().find(|r| r.0 == name).unwrap_or_else(|| panic!("row {name}")).2.clone()
         };
-        let attr_ty = row("Attribute Name");
+        let attr_ty = row("Name");
         assert!(attr_ty.starts_with("textpick:"), "got {attr_ty}");
         for expected in ["N", "uv", "Pos", "Col"] {
             assert!(attr_ty.contains(expected), "{expected} missing from {attr_ty}");
         }
         assert_eq!(row("Group"), "textpick:group1");
+        assert!(!rows.iter().any(|r| r.0 == "Attribute Name"), "the row shows its label, not its name");
+        // An edit to the labelled row lands on the parameter it names.
+        let mut edited = rows.clone();
+        edited.iter_mut().find(|r| r.0 == "Name").unwrap().1 = "weight".into();
+        state.param_mut().set_display_params(&edited);
+        state.sync_parameters_to_project();
+        let attr = &state.fs_root.children[2];
+        assert_eq!(attr.params.iter().find(|p| p.name == "Attribute Name").unwrap().text(), "weight");
+        state.sync_parameters_pane();
+        let rows = state.param_mut().node_params();
         // The Input row stays plain text.
         assert_eq!(row("Input"), "text");