If I search for nodes based on the query "search for nodes filtering for 'type:Vector[] Repeat Array", I get no results:
![search for nodes filtering for 'type:Vector[] Repeat Array with no results'](https://private-user-images.githubusercontent.com/78500760/620589954-5b667574-5fb0-49b6-86a3-bc3e82ff0c5b.png?jwt=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3ODQxMjA2MDYsIm5iZiI6MTc4NDEyMDMwNiwicGF0aCI6Ii83ODUwMDc2MC82MjA1ODk5NTQtNWI2Njc1NzQtNWZiMC00OWI2LTg2YTMtYmMzZTgyZmYwYzViLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNjA3MTUlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjYwNzE1VDEyNTgyNlomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTMyMzQ5YTQwNWI4MjAzNWJlYTA5YzhhZjg4MDdiNWVjZjhmZmMxZGJiMmFiYzFhMjM1YzcyODAxYzc5NjZhZjkmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JnJlc3BvbnNlLWNvbnRlbnQtdHlwZT1pbWFnZSUyRnBuZyJ9.4fkMQcxlEakOuHr-qiezVEAJHa0VVMpFjtj8Ol3QTvE)
This is rather unexpected as there is a node with the name « Repeat Array » that accepts List<Vector> as an input.
This bug occurs because only the type of the default inputs are sent to the frontend:
|
let input_types = definition |
|
.node_template |
|
.document_node |
|
.inputs |
|
.iter() |
|
.map(|node_input| node_input.as_value().map(|node_value| node_value.ty().nested_type().to_string()).unwrap_or_default()) |
|
.collect::<Vec<String>>(); |
Default types are (unless otherwise specified) based on the first implementation. This means for the « Repeat Array » node it will be a List<Graphic>:
|
let default_types: Vec<_> = regular_fields |
|
.iter() |
|
.map(|field| match &field.ty { |
|
ParsedFieldType::Regular(RegularParsedField { implementations, .. }) => match implementations.first() { |
This is then used for the filtering in the svelte node catalogue:
|
matchesTypeSearch = node.inputTypes?.some((inputType) => inputType.toLowerCase().includes(typeSearchTerm)) || false; |
A proper solution would be to send all possible input types for the purposes of filtering.
If I search for nodes based on the query "search for nodes filtering for 'type:Vector[] Repeat Array", I get no results:
![search for nodes filtering for 'type:Vector[] Repeat Array with no results'](https://private-user-images.githubusercontent.com/78500760/620589954-5b667574-5fb0-49b6-86a3-bc3e82ff0c5b.png?jwt=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3ODQxMjA2MDYsIm5iZiI6MTc4NDEyMDMwNiwicGF0aCI6Ii83ODUwMDc2MC82MjA1ODk5NTQtNWI2Njc1NzQtNWZiMC00OWI2LTg2YTMtYmMzZTgyZmYwYzViLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNjA3MTUlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjYwNzE1VDEyNTgyNlomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTMyMzQ5YTQwNWI4MjAzNWJlYTA5YzhhZjg4MDdiNWVjZjhmZmMxZGJiMmFiYzFhMjM1YzcyODAxYzc5NjZhZjkmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JnJlc3BvbnNlLWNvbnRlbnQtdHlwZT1pbWFnZSUyRnBuZyJ9.4fkMQcxlEakOuHr-qiezVEAJHa0VVMpFjtj8Ol3QTvE)
This is rather unexpected as there is a node with the name « Repeat Array » that accepts
List<Vector>as an input.This bug occurs because only the type of the default inputs are sent to the frontend:
Graphite/editor/src/messages/portfolio/document/node_graph/document_node_definitions.rs
Lines 2098 to 2104 in 97f8113
Default types are (unless otherwise specified) based on the first implementation. This means for the « Repeat Array » node it will be a
List<Graphic>:Graphite/node-graph/node-macro/src/codegen.rs
Lines 188 to 191 in 97f8113
This is then used for the filtering in the svelte node catalogue:
Graphite/frontend/src/components/floating-menus/NodeCatalog.svelte
Line 49 in 97f8113
A proper solution would be to send all possible input types for the purposes of filtering.