GraphiteEditor / Graphite

2D vector & raster editor that melds traditional layers & tools with a modern node-based, non-destructive, procedural workflow.
https://graphite.rs
Apache License 2.0
7.29k stars 385 forks source link

Hidden inputs not added to BorrowTree inputs_source_map #1767

Open adamgerhant opened 3 weeks ago

adamgerhant commented 3 weeks ago

Resolved types for the Import node (which is derived from the parent node) are not available for hidden node inputs. This is because although the hidden Type's are stored in the TypingContext, the document_node_types(&self) -> ResolvedDocumentNodeTypes function only gets types for inputs in the BorrowTree inputs_source_map. To fix this, all inputs need to be added to the inputs_source_map. I believe this will require a rework to how exposed inputs are handled. Is there even a reason to consider whether the input is hidden when compiling into proto nodes? Hiding an input is a UI only concept, the value node still has the same functionality.

This image shows the error. The Type is a (Concrete(())->Concrete(bool)), and is correctly passed to the next node, but it is displayed as General ApplicationFrameHost_Tip9Bq6YOi

I think this is purely visual, and doesn't affect any functionality. There is also some strange behavior where the last type becomes the type for the first hidden. In this example the location input has resolved type Concrete(())->Concrete(bool).