refactor(ui): enqueue/graph-building meta-logic #8155
Merged
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.
Summary
Revise the logic that prepares to build graphs to work with the new Generate tab. This fixes an issue where the canvas's layers would be used on the Generate tab in the v6 alphas.
Move logic for building and enqueuing from of RTK listeners to simple functions, removing a layer of indirection that served no purpose.
Create hooks to enqueue on each tab.
Fix some awkwardness around the hooks that consume the redux store. We had two
useAppStorehooks - one consumed a nanostores atom and the other was provided by RTK but had wrong types. I figured out how to fix the types on the RTK-provided hook and removed the nanostores hook.In a future PR, we should aim to get rid of the nanostores atom entirely, but it's consumed in a lot of places and will require some restructuring. It's not a big deal because we only have the one redux store, but it still bothers me.
Related Issues / Discussions
Caught by a few users on discord.
QA Instructions
There should be no functional changes, besides fixing the issue.
Merge Plan
n/a
Checklist
What's Newcopy (if doing a release after this PR)