Fix opacity attributes from defaulting to 0 rather than 1#4219
Conversation
There was a problem hiding this comment.
Code Review
This pull request introduces implicit attribute defaults for list attributes in node-graph/libraries/core-types/src/list.rs, specifically defaulting opacity attributes to 1.0 (fully opaque) instead of the type's default 0.0 to prevent items from vanishing during list operations. The feedback focuses on performance optimizations: first, optimizing pad_with_implicit_default by downcasting to Attribute<f64> and using Vec::resize to avoid excessive heap allocations and dynamic dispatch; second, pre-allocating vectors with appropriate capacities in into_attribute and new_attribute_padded to prevent unnecessary reallocations.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
There was a problem hiding this comment.
1 issue found across 1 file
Confidence score: 5/5
- This looks low risk and safe to merge: the reported issue in
node-graph/libraries/core-types/src/list.rsis a small performance optimization rather than a correctness or user-facing bug. - The suggestion to use
Vec::with_capacity(preceding_defaults + 1)instead ofVec::new()reduces potential reallocations during padding/push, but does not indicate functional breakage. - Pay close attention to
node-graph/libraries/core-types/src/list.rs- preallocating vector capacity can avoid unnecessary reallocations in this code path.
Reply with feedback, questions, or to request a fix.
Re-trigger cubic
Fixes a regression introduced in 62203cb where the Painted Dreams demo artwork's "Top Right Black - Dots" and "Bottom Black - Dots" layers had a 0 opacity.