Skip to content

Frontend type constraints#4334

Open
0HyperCube wants to merge 2 commits into
GraphiteEditor:masterfrom
0HyperCube:frontend-type-constraints
Open

Frontend type constraints#4334
0HyperCube wants to merge 2 commits into
GraphiteEditor:masterfrom
0HyperCube:frontend-type-constraints

Conversation

@0HyperCube

Copy link
Copy Markdown
Contributor

Closes #4330

Note that this adds some warnings:

The default value for input index 1 node Color Overlay is Color[], but does not satisfy Limited({"Color"})
The default value for input index 1 node Color Overlay GPU is Color[], but does not satisfy Limited({"Color"})

I guess maybe these nodes should be updated to use the tables so that they don't produce errors when instantiated. Alternatively the list thing could be removed.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces a structured FrontendTypeConstraintForInput enum to handle complex type constraints for node inputs, replacing the previous simple string representation. It includes logic to compute, intersect, and validate these constraints, along with comprehensive unit tests and corresponding frontend updates in NodeCatalog.svelte. The review feedback highlights several instances where the unqualified warn! macro should be replaced with log::warn! to prevent compilation errors, identifies a few typos in comments, and suggests using optional chaining in the frontend to safely access nested properties.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment thread editor/src/messages/portfolio/document/node_graph/document_node_definitions.rs Outdated
Comment thread editor/src/messages/portfolio/document/node_graph/document_node_definitions.rs Outdated
Comment thread editor/src/messages/portfolio/document/node_graph/document_node_definitions.rs Outdated
Comment thread editor/src/messages/portfolio/document/node_graph/document_node_definitions.rs Outdated
Comment thread frontend/src/components/floating-menus/NodeCatalog.svelte
@0HyperCube 0HyperCube force-pushed the frontend-type-constraints branch from 558bba1 to b5d20e4 Compare July 13, 2026 10:18
Comment thread editor/src/messages/portfolio/document/node_graph/utility_types.rs Outdated
DOCUMENT_NODE_TYPES.get(identifier)
}

impl FrontendTypeConstraintForInput {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe just InputTypeConstraint?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems reasonable. Thanks for the review.

@0HyperCube 0HyperCube force-pushed the frontend-type-constraints branch from b5d20e4 to 5fcaffe Compare July 15, 2026 15:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Filtering based on types false negatives

2 participants