Skip to content

Commit 118c587

Browse files
adamgerhantKeavon
authored andcommitted
Reduce displayed invalid inputs
1 parent 6e66c79 commit 118c587

File tree

2 files changed

+11
-4
lines changed

2 files changed

+11
-4
lines changed

editor/src/messages/portfolio/document/node_graph/node_properties.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2002,7 +2002,7 @@ impl<'a> ParameterWidgetsInfo<'a> {
20022002
let (name, description) = context.network_interface.displayed_input_name_and_description(&node_id, index, context.selection_network_path);
20032003
let input_type = context
20042004
.network_interface
2005-
.input_type(&InputConnector::node(node_id, index), context.selection_network_path)
2005+
.input_type_not_invalid(&InputConnector::node(node_id, index), context.selection_network_path)
20062006
.displayed_type();
20072007
let document_node = context.network_interface.document_node(&node_id, context.selection_network_path);
20082008

editor/src/messages/portfolio/document/utility_types/network_interface/resolved_types.rs

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ use std::collections::{HashMap, HashSet};
22

33
use graph_craft::document::value::TaggedValue;
44
use graph_craft::document::{DocumentNodeImplementation, InlineRust, NodeInput};
5-
use graph_craft::proto::GraphErrors;
5+
use graph_craft::proto::{GraphErrorType, GraphErrors};
66
use graph_craft::{Type, concrete};
77
use graphene_std::uuid::NodeId;
88
use interpreted_executor::dynamic_executor::{NodeTypes, ResolvedDocumentNodeTypesDelta};
@@ -129,15 +129,22 @@ impl NodeNetworkInterface {
129129
InputConnector::Export(_) => false,
130130
})
131131
}
132-
DocumentNodeImplementation::ProtoNode(_) => self.resolved_types.node_graph_errors.iter().any(|error| error.node_path == node_path),
132+
DocumentNodeImplementation::ProtoNode(_) => self.resolved_types.node_graph_errors.iter().any(|error| {
133+
error.node_path == node_path
134+
&& match &error.error {
135+
GraphErrorType::InvalidImplementations { error_inputs, .. } => error_inputs.iter().any(|solution| solution.iter().any(|(index, _)| index == input_index)),
136+
_ => true,
137+
}
138+
}),
139+
133140
DocumentNodeImplementation::Extract => false,
134141
}
135142
}
136143
InputConnector::Export(_) => false,
137144
}
138145
}
139146

140-
fn input_type_not_invalid(&mut self, input_connector: &InputConnector, network_path: &[NodeId]) -> TypeSource {
147+
pub fn input_type_not_invalid(&mut self, input_connector: &InputConnector, network_path: &[NodeId]) -> TypeSource {
141148
let Some(input) = self.input_from_connector(input_connector, network_path) else {
142149
return TypeSource::Error("Could not get input from connector");
143150
};

0 commit comments

Comments
 (0)