Skip to content

Fix Shaking a Text layer breaks its type signature#3899

Open
Annonnymmousss wants to merge 1 commit intoGraphiteEditor:masterfrom
Annonnymmousss:fix/sign_break_shake
Open

Fix Shaking a Text layer breaks its type signature#3899
Annonnymmousss wants to merge 1 commit intoGraphiteEditor:masterfrom
Annonnymmousss:fix/sign_break_shake

Conversation

@Annonnymmousss
Copy link
Contributor

closes #3896

Screen.Recording.2026-03-14.at.1.22.26.PM.mov

Copilot AI review requested due to automatic review settings March 14, 2026 07:56
@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request resolves a bug where manipulating a text layer could lead to its type signature being incorrectly broken within the node graph. The fix involves a precise adjustment to the node graph's input disconnection logic. Previously, inputs might have been disconnected even when no upstream connector was present, or under conditions that incorrectly identified an upstream node as unselected. The updated logic now ensures that disconnections only occur when an upstream connector exists and its associated node is explicitly not among the currently selected nodes, thereby preserving the integrity of the graph's connections.

Highlights

  • Node Graph Connection Logic: Refined the logic for disconnecting node inputs, specifically preventing unintended disconnections when no upstream connector exists and ensuring disconnections only occur for inputs whose upstream nodes are not selected. This addresses a bug where manipulating text layers could incorrectly break their type signatures.
Changelog
  • editor/src/messages/portfolio/document/node_graph/node_graph_message_handler.rs
    • Modified the input disconnection logic to prevent incorrect disconnections when no upstream connector is present and to accurately identify unselected upstream nodes.
Activity
  • No human activity has been recorded for this pull request yet.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
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.

No issues found across 1 file

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Fixes the ShakeNode behavior in the node graph so shaking selected nodes (notably Text layers) doesn’t inadvertently alter their inferred/serialized type signature by issuing disconnects for inputs that aren’t actually connected.

Changes:

  • Adjust the shake-time input disconnection condition to only disconnect when an upstream connector exists.
  • Preserve unconnected inputs (those without an upstream output connector) during ShakeNode.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

You can also share your feedback on Copilot code review. Take the survey.

Copy link
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 fixes an issue where shaking a Text layer could break its type signature. The change correctly adjusts the logic for disconnecting node inputs during a 'shake' operation. Previously, it would attempt to disconnect inputs that were not connected, which could lead to issues. The new logic ensures that a disconnection is only attempted if there is an upstream connection, and that connection is to a node that is not part of the selection being shaken.

Comment on lines +1524 to +1526
if network_interface
.upstream_output_connector(&input_connector, selection_network_path)
.and_then(|connector| connector.node_id())
.is_some_and(|node_id| all_selected_nodes.contains(&node_id))
.is_some_and(|connector| connector.node_id().map_or(true, |node_id| !all_selected_nodes.contains(&node_id)))
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

This refactoring clarifies the disconnection logic. The condition now explicitly checks for an upstream connector before deciding to disconnect. This avoids attempting to disconnect inputs that are already disconnected (like value inputs), making the logic more robust.

@Annonnymmousss Annonnymmousss changed the title fix: Shaking a Text layer breaks its type signature Fix Shaking a Text layer breaks its type signature Mar 15, 2026
@Keavon Keavon force-pushed the master branch 3 times, most recently from e58c1de to df8001f Compare March 17, 2026 00:10
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.

Shaking a Text layer breaks its type signature

2 participants