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
feat: knobs with nullable values #74
Conversation
Hey, thanks for the PR, looks interesting. I'll take a look at the code later this week. |
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.
Looks really good! Just a couple of small points from me.
@Kirpal UI tests are failing, can you please take a look? Keep in mind that they are running on Linux instance, so there can be differences if you launch them on another OS. You can download the results of golden tests as an artifact of CI run. Most probably, they shouldn't change at all as an outcome of this PR. |
Yes, they are failing because of differences in font rendering. How do you usually do it, are you on a Linux machine? I'm on a Mac and don't have a machine to generate them on. |
I usually download CI build artifact (it generates diffs and full files there) and just replace my local files with the generated ones and do another commit. Not an ideal flow, but I don't know any better solution for now 🤷 |
@ookami-kb any way we could get a new release with these changes? |
@Kirpal sure, will prepare a release today. |
Description
This PR adds the ability for knobs to have a nullable value. This is useful to see what a widget looks like in its default state. To use a nullable knob, the public API is very similar to the existing API, except you use an extra nullable prefix when accessing knobs, ie
context.knobs.nullable.boolean
rather thancontext.knobs.boolean
. The rest of the public API remains the same.For the UI, knobs now have a leading switch to toggle whether or not they're null. If they aren't nullable, this switch is shown but disabled.
Screen.Recording.2022-03-01.at.2.48.43.PM.mov