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

commit5e4881dbf9fa4eadc7719be829ac88031fd5088e
parentccffd62156
authorLucas Galante <lsgalante12@gmail.com>
date2026-10-06 08:42
fix: the Attribute node's Group row is shown only where it is read

Delete removes the attribute's whole column and Promote reads every
point, so neither honours Group; the row now names the operations that
do (Create, Modify, Remap, Clip, Normalize, Composite).

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

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

diff --git a/nodes/attribute.json b/nodes/attribute.json
index 238a660..038e335 100644
--- a/nodes/attribute.json
+++ b/nodes/attribute.json
@@ -104,7 +104,7 @@
       "label": "Group",
       "type": "group",
       "default": "",
-      "show_when": "operation != Promote",
+      "show_when": "operation == Create|Modify|Remap|Clip|Normalize|Composite",
       "description": "A point group limiting which points are changed or measured. Empty means every point.",
       "group": "where"
     },
diff --git a/src/main.rs b/src/main.rs
index dbdf75d..2825721 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -6855,6 +6855,25 @@ mod tests {
         assert!(checked > 20, "only {checked} conditions checked — did the templates lose them?");
     }
 
+    #[test]
+    fn the_attribute_nodes_group_row_is_shown_where_it_is_read() {
+        // Delete removes the attribute's whole column — there is no deleting
+        // it from some points — and Promote reads every point, so neither
+        // reads Group, and a row shown there would be a filter that filters
+        // nothing. Every other operation limits its work to the group.
+        let root = crate::app::load_fs_tree();
+        let template = root.children.iter().find(|t| t.node_type == "attribute").expect("attribute template");
+        let group = template.params.iter().find(|p| p.name == "group").expect("attribute has a group row");
+        for (op, shown) in [
+            ("Create", true), ("Modify", true), ("Remap", true), ("Clip", true),
+            ("Normalize", true), ("Composite", true), ("Delete", false), ("Promote", false),
+        ] {
+            let mut params = template.params.clone();
+            params.iter_mut().find(|p| p.name == "operation").unwrap().set_text(op);
+            assert_eq!(crate::app::param_visible(&params, &group.show_when), shown, "Group on {op}");
+        }
+    }
+
     #[test]
     fn test_hiding_a_row_does_not_lose_its_value() {
         use crate::app::param_display;