@@ -878,7 +878,7 @@ impl<'a> MessageHandler<NodeGraphMessage, NodeGraphMessageContext<'a>> for NodeG
878878 } ;
879879 let Some ( output_connector) = output_connector else { return } ;
880880 self . wire_in_progress_from_connector = network_interface. output_position ( & output_connector, selection_network_path) ;
881- self . wire_in_progress_type = FrontendGraphDataType :: from_type ( & network_interface. input_type ( clicked_input, breadcrumb_network_path) . 0 ) ;
881+ self . wire_in_progress_type = FrontendGraphDataType :: displayed_type ( & network_interface. input_type ( clicked_input, breadcrumb_network_path) ) ;
882882 return ;
883883 }
884884
@@ -888,8 +888,8 @@ impl<'a> MessageHandler<NodeGraphMessage, NodeGraphMessageContext<'a>> for NodeG
888888 self . initial_disconnecting = false ;
889889
890890 self . wire_in_progress_from_connector = network_interface. output_position ( & clicked_output, selection_network_path) ;
891- let ( output_type, source ) = & network_interface. output_type ( & clicked_output, breadcrumb_network_path) ;
892- self . wire_in_progress_type = FrontendGraphDataType :: displayed_type ( output_type, source ) ;
891+ let output_type = network_interface. output_type ( & clicked_output, breadcrumb_network_path) ;
892+ self . wire_in_progress_type = FrontendGraphDataType :: displayed_type ( & output_type) ;
893893
894894 self . update_node_graph_hints ( responses) ;
895895 return ;
@@ -1207,16 +1207,12 @@ impl<'a> MessageHandler<NodeGraphMessage, NodeGraphMessageContext<'a>> for NodeG
12071207 }
12081208
12091209 // Get the output types from the network interface
1210- let ( output_type, type_source) = network_interface. output_type ( & output_connector, selection_network_path) ;
12111210 let Some ( network_metadata) = network_interface. network_metadata ( selection_network_path) else {
12121211 warn ! ( "No network_metadata" ) ;
12131212 return ;
12141213 } ;
12151214
1216- let compatible_type = match type_source {
1217- TypeSource :: RandomProtonodeImplementation | TypeSource :: Error ( _) => None ,
1218- _ => Some ( format ! ( "type:{}" , output_type. nested_type( ) ) ) ,
1219- } ;
1215+ let compatible_type = network_interface. output_type ( & output_connector. unwrap ( ) , selection_network_path) . add_node_string ( ) ;
12201216
12211217 let appear_right_of_mouse = if ipp. mouse . position . x > ipp. viewport_bounds . size ( ) . x - 173. { -173. } else { 0. } ;
12221218 let appear_above_mouse = if ipp. mouse . position . y > ipp. viewport_bounds . size ( ) . y - 34. { -34. } else { 0. } ;
@@ -1990,12 +1986,7 @@ impl<'a> MessageHandler<NodeGraphMessage, NodeGraphMessageContext<'a>> for NodeG
19901986 responses. add ( NodeGraphMessage :: SendGraph ) ;
19911987 }
19921988 NodeGraphMessage :: UpdateTypes { resolved_types, node_graph_errors } => {
1993- for ( path, node_type) in resolved_types. add {
1994- network_interface. resolved_types . types . insert ( path. to_vec ( ) , node_type) ;
1995- }
1996- for path in resolved_types. remove {
1997- network_interface. resolved_types . types . remove ( & path. to_vec ( ) ) ;
1998- }
1989+ network_interface. resolved_types . update ( resolved_types) ;
19991990 self . node_graph_errors = node_graph_errors;
20001991 }
20011992 NodeGraphMessage :: UpdateActionButtons => {
@@ -2109,16 +2100,7 @@ impl NodeGraphMessageHandler {
21092100 . popover_layout( {
21102101 // Showing only compatible types
21112102 let compatible_type = match ( selection_includes_layers, has_multiple_selection, selected_layer) {
2112- ( true , false , Some ( layer) ) => {
2113- let graph_layer = graph_modification_utils:: NodeGraphLayer :: new( layer, network_interface) ;
2114- let node_type = graph_layer. horizontal_layer_flow( ) . nth( 1 ) ;
2115- if let Some ( node_id) = node_type {
2116- let ( output_type, _) = network_interface. output_type( & OutputConnector :: node( node_id, 0 ) , & [ ] ) ;
2117- Some ( format!( "type:{}" , output_type. nested_type( ) ) )
2118- } else {
2119- None
2120- }
2121- }
2103+ ( true , false , Some ( layer) ) => network_interface. output_type( & OutputConnector :: node( node_id, 0 ) , & [ ] ) . add_node_string( ) ,
21222104 _ => None ,
21232105 } ;
21242106
@@ -2431,17 +2413,10 @@ impl NodeGraphMessageHandler {
24312413 . icon( Some ( "Node" . to_string( ) ) )
24322414 . tooltip( "Add an operation to the end of this layer's chain of nodes" )
24332415 . popover_layout( {
2434- let layer_identifier = LayerNodeIdentifier :: new( layer, context. network_interface) ;
2435- let compatible_type = {
2436- let graph_layer = graph_modification_utils:: NodeGraphLayer :: new( layer_identifier, context. network_interface) ;
2437- let node_type = graph_layer. horizontal_layer_flow( ) . nth( 1 ) ;
2438- if let Some ( node_id) = node_type {
2439- let ( output_type, _) = context. network_interface. output_type( & OutputConnector :: node( node_id, 0 ) , & [ ] ) ;
2440- Some ( format!( "type:{}" , output_type. nested_type( ) ) )
2441- } else {
2442- None
2443- }
2444- } ;
2416+ let compatible_type = context
2417+ . network_interface
2418+ . upstream_output_connector( & InputConnector :: node( layer, 1 ) , & [ ] )
2419+ . and_then( |upstream_output| context. network_interface. output_type( & upstream_output, & [ ] ) . add_node_string( ) ) ;
24452420
24462421 let mut node_chooser = NodeCatalog :: new( ) ;
24472422 node_chooser. intial_search = compatible_type. unwrap_or( "" . to_string( ) ) ;
0 commit comments