Skip to content

Fix Gradient tool inserting new nodes in the wrong position when updating a Fill node's gradient chain#4203

Merged
Keavon merged 2 commits into
masterfrom
fix-gradient-node-positioning
Jun 6, 2026
Merged

Fix Gradient tool inserting new nodes in the wrong position when updating a Fill node's gradient chain#4203
Keavon merged 2 commits into
masterfrom
fix-gradient-node-positioning

Conversation

@Keavon
Copy link
Copy Markdown
Member

@Keavon Keavon commented Jun 6, 2026

Fixes a bug/limitation of #4177.

Copy link
Copy Markdown
Contributor

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

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 a new helper method insert_node_before_input to simplify and improve node splicing on wires feeding input connectors, especially for unencapsulated secondary-input branches where the upstream branch needs to be shifted to make room. A test was also added to verify this behavior. The review feedback highlights a potential issue where shared upstream nodes could be shifted multiple times due to a lack of deduplication in upstream_flow_back_from_nodes, and suggests querying node positions before mutating the network to ensure safety.

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.

Copy link
Copy Markdown
Contributor

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

Choose a reason for hiding this comment

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

2 issues found across 3 files

Confidence score: 3/5

  • There is a concrete regression risk in editor/src/messages/portfolio/document/utility_types/network_interface.rs: insert_node_before_input may rewire a downstream input even when the inserted node lacks input 0, which can break the splice and drop the upstream connection.
  • upstream_flow_back_from_nodes in editor/src/messages/portfolio/document/utility_types/network_interface.rs may emit duplicate NodeIds in shared/diamond subgraphs, which can lead to incorrect or repeated downstream processing behavior.
  • The score is 3 because both findings are user-impacting graph wiring/traversal issues with moderate-to-high severity and good confidence, so this is not a low-risk merge until addressed.
  • Pay close attention to editor/src/messages/portfolio/document/utility_types/network_interface.rs - node rewiring and upstream traversal may mis-handle missing input 0 and shared-path deduplication.

Reply with feedback, questions, or to request a fix.

Re-trigger cubic

Comment thread editor/src/messages/portfolio/document/utility_types/network_interface.rs Outdated
@Keavon Keavon merged commit 2c29d2c into master Jun 6, 2026
10 checks passed
@Keavon Keavon deleted the fix-gradient-node-positioning branch June 6, 2026 04:02
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