Skip to content

Fixed Execution number node not working when collapsed #2766

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

Conversation

RunDevelopment
Copy link
Member

The Execution Number node didn't work when collapsed because its value was set using a useEffect in its input element. Since that input element wasn't rendered when collapsed, the side effect didn't happen, and so the execution number didn't update.

The same bug of input/output side effects not working could so be observed for other nodes. E.g. Load Image would stop updating the output type of the image when collapsed.

This PR fixes this by always rendering input and output element, which ensures that their side effects happen. Since we don't actually want to show them, elements are rendered into a box with display: none and contain: strict. This ensures that the browser can basically ignore the rendered input/output elements, so there won't be a perf impact.

Lastly, I had to disable handles for the collapsed input/output elements. ReactFlow also uses side effects for its handles, but we don't want those side effects.

@joeyballentine joeyballentine merged commit 6759527 into chaiNNer-org:main Apr 8, 2024
@RunDevelopment RunDevelopment deleted the collapsed-exec-number branch April 8, 2024 16:30
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.

2 participants