-
-
Notifications
You must be signed in to change notification settings - Fork 9.4k
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
Addon-controls: Add JSON tree editor for Object/Array Type args #12824
Addon-controls: Add JSON tree editor for Object/Array Type args #12824
Conversation
I'm not sure how to debug the CI failures because I don't have access to any of the TeamCity URLs in the Github status checks. I can look into any issues, but I wasn't able to pick up any glaring issues in my diff, since this runs without error when I build locally. Is there anything else I should do before this can be reviewed? cc @shilman |
Don't worry about it. Sorry i missed this PR first time around. Looking amazing! I'll test and review later today 🙏 |
Alright so I had to pull in the code from That also means that we now have full control over how it's rendered, so I was able to lay it out as @domyen requested. Screenshot.2021-02-22.at.17.41.47.mov |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking great @ghengeveld @hydrosquall 💯
Hmm, the UI is kind of strange for undefined values. @ghengeveld WDYT? |
…ui-editable-json-tree-knob
Issue: #12599 , reimplements #12685
What I did
Replaced the existing text form control with the
react-editable-json
lib (public demo here: https://oxyno-zeta.github.io/react-editable-json-tree/ ). I also added typings for the library to the closest typings file so we can safely use it in typescript.Made a first pass at customizing the styles (spacing and colors) based on @domyen's feedback here and looking at the colors available in Storybook here . The "dark/light mode toggles" aren't toggling the styles in the control pane (just inside the main component body area), so I'm not exactly how this will look in Dark Mode yet, but I set up the style customization function such that it should be easy to replace things
Updated the
official-storybook
story about usingaddon-controls
to make use of the fact that we now handle nested objects.Demo GIF: https://a.cl.ly/geuqpZrq
How to test
It's possible, but I'm not sure that it's necessary.
We could, but I think updating the main storybook story may be sufficient, as this change should benefit most users without needing them to customize anything.
We could update this page to indicate that tree view is used instead of a text view.
FAQ
Why not some other JSON tree viewer library XYZ?
What terminal commands did you use that you might use again next time?
1 change in
examples/official-storybook/main.ts
to speed up build time: