From bf486b4cb57d66e98b3500020edb93c64b40619a Mon Sep 17 00:00:00 2001 From: Jatin Bharti Date: Sun, 22 Mar 2026 11:55:21 +0530 Subject: [PATCH] Fix bug where nodes (like Text) with a non-visible primary input would gain a primary input when shaken (#3899) * fix: Shaking a Text layer breaks its type signature * Add a second fix for the same issue --------- Co-authored-by: Keavon Chambers --- .../document/node_graph/node_graph_message_handler.rs | 5 ++--- .../portfolio/document/utility_types/network_interface.rs | 4 ++-- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/editor/src/messages/portfolio/document/node_graph/node_graph_message_handler.rs b/editor/src/messages/portfolio/document/node_graph/node_graph_message_handler.rs index 8c068678..f8a9b373 100644 --- a/editor/src/messages/portfolio/document/node_graph/node_graph_message_handler.rs +++ b/editor/src/messages/portfolio/document/node_graph/node_graph_message_handler.rs @@ -1521,10 +1521,9 @@ impl<'a> MessageHandler> for NodeG for input_index in 0..network_interface.number_of_inputs(selected_node, selection_network_path) { let input_connector = InputConnector::node(*selected_node, input_index); // Only disconnect inputs to non selected nodes - if !network_interface + 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))) { responses.add(NodeGraphMessage::DisconnectInput { input_connector }); } diff --git a/editor/src/messages/portfolio/document/utility_types/network_interface.rs b/editor/src/messages/portfolio/document/utility_types/network_interface.rs index ac95dfce..4f8abf2f 100644 --- a/editor/src/messages/portfolio/document/utility_types/network_interface.rs +++ b/editor/src/messages/portfolio/document/utility_types/network_interface.rs @@ -4068,8 +4068,8 @@ impl NodeNetworkInterface { log::error!("Could not get current input in disconnect_input"); return; }; - // Do not disconnect an already disconnected input - if matches!(current_input, NodeInput::Value { .. }) { + // Only disconnect inputs that are actual wire connections (Node or Import) + if !matches!(current_input, NodeInput::Node { .. } | NodeInput::Import { .. }) { return; }