Skip to content
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

Improved node docs #1900

Merged
merged 4 commits into from
Jun 29, 2023
Merged

Conversation

RunDevelopment
Copy link
Member

You might to review this PR with whitespace changes hidden. Prettier went wild in some places.

Changes:

  • Improved type printing. false | true will now be bool, and small integer intervals will now be unfolded (e.g. 1 | int(3..4) -> 1 | 3 | 4).
  • Added "optional" tag for option inputs and removed null from type.
  • Don't show outputs users can't connect to. This only affects the large image output of View Image.
  • Don't show auto iterator input in helper nodes.
  • Fixed example inputs not being the default inputs.

The last point needs a bit more explanation. The issue was that a number input always retained its previous value if the input id was the same as the in the previously looked-at node. E.g. go to Crop Edges and then to Crop Offsets and Width and Height were set to 0 (which is invalid). This was a bug in NumberInput and I fixed it.

But that wasn't good enough for me. Input still reset to their default values when we show example nodes. This changes the global node state, which really isn't ideal here. So to prevent future bugs, I changed the way groups and SchemaInput (= the abstraction layer on top of input components) set input data. They previously got setNodeInputValue from global node state, but now they get a setInputValue function passed in as a prop. This allows us to control the way inputData is modified. In the case of doc examples, we manage our own inputData state separate from global node state.

image
image

@joeyballentine joeyballentine merged commit 4d37c0c into chaiNNer-org:main Jun 29, 2023
4 checks passed
@RunDevelopment RunDevelopment deleted the docs-impr branch June 29, 2023 17:06
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.

None yet

2 participants