Add UI for editing type definitions #1352
Draft
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.
After #1351, which this is based on top of, this is the final major feature for the new frontend. We can now build any program!
UI is again proof-of-concept, but I don't expect to make major changes there for now. In fact, I think that while it's hardly intuitive in its current form (better labels would help for a start, but this is true for much of the current UI), this is the direction we should be heading in. The choice we've made to only show one definition at a time frees us from worrying about showing the whole type definition as connected, which was always a bit weird in the React frontend. So we now get back some of the clarity of the form-based UI we had in our PureScript frontend, but with the ability to actually create arbitrarily-complex type defs (the fully form-based approach was never going to generalise properly, as I argued a lot back in the day).
Code needs some fairly minor tidying up, which will be done once #1351 is merged.
There is also at least one bug: selecting a kind node in a constructor field type causes the root node to be selected for some reason.
Some examples:



Note that seeing as we don't actually have buttons for adding definitions yet, I had to add this temporary code in order to get one to play around with: