Skip to content

Commit 8b665d1

Browse files
committed
Simplify compilation
1 parent f5c6b65 commit 8b665d1

File tree

24 files changed

+855
-1004
lines changed

24 files changed

+855
-1004
lines changed

editor/src/dispatcher.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -161,8 +161,8 @@ impl Dispatcher {
161161
Message::EndIntrospectionQueue => {
162162
self.queueing_introspection_messages = false;
163163
}
164-
Message::ProcessIntrospectionQueue(introspected_inputs) => {
165-
let update_message = PortfolioMessage::ProcessIntrospectionResponse { introspected_inputs }.into();
164+
Message::ProcessIntrospectionQueue(introspection_response) => {
165+
let update_message = PortfolioMessage::ProcessIntrospectionResponse { introspection_response }.into();
166166
// Update the state with the render output and introspected inputs
167167
Self::schedule_execution(&mut self.message_queues, true, [update_message]);
168168

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

Lines changed: 67 additions & 67 deletions
Original file line numberDiff line numberDiff line change
@@ -455,73 +455,73 @@ fn static_nodes() -> Vec<DocumentNodeDefinition> {
455455
description: Cow::Borrowed("Creates a new Artboard which can be used as a working surface."),
456456
properties: None,
457457
},
458-
DocumentNodeDefinition {
459-
identifier: "Load Image",
460-
category: "Web Request",
461-
node_template: NodeTemplate {
462-
document_node: DocumentNode {
463-
implementation: DocumentNodeImplementation::Network(NodeNetwork {
464-
exports: vec![NodeInput::node(NodeId(1), 0)],
465-
nodes: [
466-
DocumentNode {
467-
inputs: vec![NodeInput::value(TaggedValue::None, false), NodeInput::scope("editor-api"), NodeInput::network(concrete!(String), 1)],
468-
manual_composition: Some(concrete!(Context)),
469-
implementation: DocumentNodeImplementation::ProtoNode(wasm_application_io::load_resource::IDENTIFIER),
470-
..Default::default()
471-
},
472-
DocumentNode {
473-
inputs: vec![NodeInput::node(NodeId(0), 0)],
474-
manual_composition: Some(concrete!(Context)),
475-
implementation: DocumentNodeImplementation::ProtoNode(wasm_application_io::decode_image::IDENTIFIER),
476-
..Default::default()
477-
},
478-
]
479-
.into_iter()
480-
.enumerate()
481-
.map(|(id, node)| (NodeId(id as u64), node))
482-
.collect(),
483-
..Default::default()
484-
}),
485-
inputs: vec![NodeInput::value(TaggedValue::None, false), NodeInput::value(TaggedValue::String("graphite:null".to_string()), false)],
486-
..Default::default()
487-
},
488-
persistent_node_metadata: DocumentNodePersistentMetadata {
489-
input_metadata: vec![("Empty", "TODO").into(), ("URL", "TODO").into()],
490-
output_names: vec!["Image".to_string()],
491-
network_metadata: Some(NodeNetworkMetadata {
492-
persistent_metadata: NodeNetworkPersistentMetadata {
493-
node_metadata: [
494-
DocumentNodeMetadata {
495-
persistent_metadata: DocumentNodePersistentMetadata {
496-
display_name: "Load Resource".to_string(),
497-
node_type_metadata: NodeTypePersistentMetadata::node(IVec2::new(0, 0)),
498-
..Default::default()
499-
},
500-
..Default::default()
501-
},
502-
DocumentNodeMetadata {
503-
persistent_metadata: DocumentNodePersistentMetadata {
504-
display_name: "Decode Image".to_string(),
505-
node_type_metadata: NodeTypePersistentMetadata::node(IVec2::new(7, 0)),
506-
..Default::default()
507-
},
508-
..Default::default()
509-
},
510-
]
511-
.into_iter()
512-
.enumerate()
513-
.map(|(id, node)| (NodeId(id as u64), node))
514-
.collect(),
515-
..Default::default()
516-
},
517-
..Default::default()
518-
}),
519-
..Default::default()
520-
},
521-
},
522-
description: Cow::Borrowed("Loads an image from a given URL"),
523-
properties: None,
524-
},
458+
// DocumentNodeDefinition {
459+
// identifier: "Load Image",
460+
// category: "Web Request",
461+
// node_template: NodeTemplate {
462+
// document_node: DocumentNode {
463+
// implementation: DocumentNodeImplementation::Network(NodeNetwork {
464+
// exports: vec![NodeInput::node(NodeId(1), 0)],
465+
// nodes: [
466+
// DocumentNode {
467+
// inputs: vec![NodeInput::value(TaggedValue::None, false), NodeInput::scope("editor-api"), NodeInput::network(concrete!(String), 1)],
468+
// manual_composition: Some(concrete!(Context)),
469+
// implementation: DocumentNodeImplementation::ProtoNode(wasm_application_io::load_resource::IDENTIFIER),
470+
// ..Default::default()
471+
// },
472+
// DocumentNode {
473+
// inputs: vec![NodeInput::node(NodeId(0), 0)],
474+
// manual_composition: Some(concrete!(Context)),
475+
// implementation: DocumentNodeImplementation::ProtoNode(wasm_application_io::decode_image::IDENTIFIER),
476+
// ..Default::default()
477+
// },
478+
// ]
479+
// .into_iter()
480+
// .enumerate()
481+
// .map(|(id, node)| (NodeId(id as u64), node))
482+
// .collect(),
483+
// ..Default::default()
484+
// }),
485+
// inputs: vec![NodeInput::value(TaggedValue::None, false), NodeInput::value(TaggedValue::String("graphite:null".to_string()), false)],
486+
// ..Default::default()
487+
// },
488+
// persistent_node_metadata: DocumentNodePersistentMetadata {
489+
// input_metadata: vec![("Empty", "TODO").into(), ("URL", "TODO").into()],
490+
// output_names: vec!["Image".to_string()],
491+
// network_metadata: Some(NodeNetworkMetadata {
492+
// persistent_metadata: NodeNetworkPersistentMetadata {
493+
// node_metadata: [
494+
// DocumentNodeMetadata {
495+
// persistent_metadata: DocumentNodePersistentMetadata {
496+
// display_name: "Load Resource".to_string(),
497+
// node_type_metadata: NodeTypePersistentMetadata::node(IVec2::new(0, 0)),
498+
// ..Default::default()
499+
// },
500+
// ..Default::default()
501+
// },
502+
// DocumentNodeMetadata {
503+
// persistent_metadata: DocumentNodePersistentMetadata {
504+
// display_name: "Decode Image".to_string(),
505+
// node_type_metadata: NodeTypePersistentMetadata::node(IVec2::new(7, 0)),
506+
// ..Default::default()
507+
// },
508+
// ..Default::default()
509+
// },
510+
// ]
511+
// .into_iter()
512+
// .enumerate()
513+
// .map(|(id, node)| (NodeId(id as u64), node))
514+
// .collect(),
515+
// ..Default::default()
516+
// },
517+
// ..Default::default()
518+
// }),
519+
// ..Default::default()
520+
// },
521+
// },
522+
// description: Cow::Borrowed("Loads an image from a given URL"),
523+
// properties: None,
524+
// },
525525
#[cfg(feature = "gpu")]
526526
DocumentNodeDefinition {
527527
identifier: "Create Canvas",

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

Lines changed: 17 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2279,18 +2279,23 @@ impl NodeGraphMessageHandler {
22792279
let locked = network_interface.is_locked(&node_id, breadcrumb_network_path);
22802280

22812281
let errors = None; // TODO: Recursive traversal from export over all protonodes and match metadata with error
2282-
// self
2283-
// .node_graph_errors
2284-
// .iter()
2285-
// .find(|error| error.stable_node_id == node_id_path)
2286-
// .map(|error| format!("{:?}", error.error.clone()))
2287-
// .or_else(|| {
2288-
// if self.node_graph_errors.iter().any(|error| error.node_path.starts_with(&node_id_path)) {
2289-
// Some("Node graph type error within this node".to_string())
2290-
// } else {
2291-
// None
2292-
// }
2293-
// });
2282+
self.node_graph_errors
2283+
.iter()
2284+
.find(|error| match &error.original_location {
2285+
graph_craft::proto::OriginalLocation::Value(_) => false,
2286+
graph_craft::proto::OriginalLocation::Node(node_ids) => node_ids == &node_id_path,
2287+
})
2288+
.map(|error| format!("{:?}", error.error.clone()))
2289+
.or_else(|| {
2290+
if self.node_graph_errors.iter().any(|error| match &error.original_location {
2291+
graph_craft::proto::OriginalLocation::Value(_) => false,
2292+
graph_craft::proto::OriginalLocation::Node(node_ids) => node_ids.starts_with(&node_id_path),
2293+
}) {
2294+
Some("Node graph type error within this node".to_string())
2295+
} else {
2296+
None
2297+
}
2298+
});
22942299

22952300
nodes.push(FrontendNode {
22962301
id: node_id,

editor/src/messages/portfolio/document/properties_panel/properties_panel_message_handler.rs

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,6 @@ pub struct PropertiesPanelMessageHandlerData<'a> {
1313
pub document_name: &'a str,
1414
}
1515

16-
use crate::messages::portfolio::document::utility_types::network_interface::NodeNetworkInterface;
17-
use graph_craft::document::NodeId;
18-
pub struct PropertiesPanelMessageHandlerData<'a> {
19-
pub network_interface: &'a mut NodeNetworkInterface,
20-
pub selection_network_path: &'a [NodeId],
21-
pub document_name: &'a str,
22-
}
23-
2416
#[derive(Debug, Clone, Default, ExtractField)]
2517
pub struct PropertiesPanelMessageHandler {}
2618

0 commit comments

Comments
 (0)