Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
fix(ui): check for metadataAccumulator before connecting to it
Fixes an edge case in graph building.
feat(ui): fix a lot of model-related crashes/bugs
We were storing all types of models by their model ID, which is a format like
sd-1/main/deliberate.This meant we had to do a lot of extra parsing, because nodes actually wants something like
{base_model: 'sd-1', model_name: 'deliberate'}.Some of this parsing was done with zod's error-throwing
parse()method, and in other places it was done with brittle string parsing.This commit refactors the state to use the object form of models.
There is still a bit of string parsing done in the to construct the ID from the object form, but it's far less complicated.
Also, the zod parsing is now done using
safeParse(), which does not throw. This requires a few more conditional checks, but should prevent further crashes.feat(ui): update node editor to use model object format
similar to the previous commit, update the node editor to not just store models as strings - instead, store the model object.
the model select components in nodes are now just kinda copy-pastes over the linear UI versions of the same components, but they were different enough that we can't just share them.
i explored adding some props to override the linear ui components' logic, but it was too brittle. so just copy/paste.