Skip to content

Fix opacity attributes from defaulting to 0 rather than 1#4219

Merged
Keavon merged 2 commits into
masterfrom
attribute-implicit-defaults
Jun 10, 2026
Merged

Fix opacity attributes from defaulting to 0 rather than 1#4219
Keavon merged 2 commits into
masterfrom
attribute-implicit-defaults

Conversation

@Keavon

@Keavon Keavon commented Jun 10, 2026

Copy link
Copy Markdown
Member

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.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread node-graph/libraries/core-types/src/list.rs
Comment thread node-graph/libraries/core-types/src/list.rs Outdated
Comment thread node-graph/libraries/core-types/src/list.rs Outdated

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.rs is a small performance optimization rather than a correctness or user-facing bug.
  • The suggestion to use Vec::with_capacity(preceding_defaults + 1) instead of Vec::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

Comment thread node-graph/libraries/core-types/src/list.rs Outdated
@Keavon Keavon merged commit 863b1f9 into master Jun 10, 2026
11 checks passed
@Keavon Keavon deleted the attribute-implicit-defaults branch June 10, 2026 06:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant