Skip to content

Filtering based on types false negatives #4330

Description

@0HyperCube

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'

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions