Skip to content
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

Merged
merged 5 commits into from Mar 9, 2022

Conversation

Kirpal
Copy link
Contributor

@Kirpal Kirpal commented Mar 1, 2022

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 than context.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

@ookami-kb
Copy link
Owner

Hey, thanks for the PR, looks interesting. I'll take a look at the code later this week.

Copy link
Owner

@ookami-kb ookami-kb left a 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 Kirpal requested a review from ookami-kb March 7, 2022 14:47
@ookami-kb
Copy link
Owner

@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.

@Kirpal
Copy link
Contributor Author

Kirpal commented Mar 9, 2022

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.

@ookami-kb
Copy link
Owner

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 ookami-kb merged commit b1674c4 into ookami-kb:master Mar 9, 2022
@Kirpal
Copy link
Contributor Author

Kirpal commented Mar 11, 2022

@ookami-kb any way we could get a new release with these changes?

@ookami-kb
Copy link
Owner

@Kirpal sure, will prepare a release today.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants