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

[4.x] Improve UX of Field Conditions Builder for Select & Toggle fields #9379

Merged
merged 9 commits into from
Jan 31, 2024

Conversation

duncanmcclean
Copy link
Member

This pull request makes some small improvements to the UX of the Field Conditions Builder.

This PR also does a little bit of refactoring around how the conditions builder works. Essentially moving the logic of "building" each condition into a new Condition component so the computed data/methods can be more easily scoped to a single condition.

Select / Button Group / Radios / Checkboxes fields

Previously, when you were configuring a condition for a Select field (or similar), you had to know the key of the option you wanted to use in your condition.

If you didn't know that key, you'd have to cancel out of that field's settings, find that select field, find the option you're looking for, copy its key, cancel out of it's field settings, go back and find the field with the new condition and paste in the key there.

This PR improves that by actually giving you the available options in a dropdown to pick from:

CleanShot 2024-01-23 at 16 54 55

The dropdown will only show when using the equals/not/===/!== operators.

Toggle fields

This one is a much smaller quality-of-life improvement. When you're building a condition for a Toggle field, you'll now see an actual toggle to represent true/false without needing to type true/false yourself.

CleanShot 2024-01-23 at 17 01 41

@duncanmcclean duncanmcclean changed the title [4.x] Improve field conditions UX: show dropdown for select/button group/radio options & toggle for toggle fields [4.x] Improve field conditions UX for Select & Toggle fields Jan 23, 2024
@duncanmcclean duncanmcclean changed the title [4.x] Improve field conditions UX for Select & Toggle fields [4.x] Improve UX of Field Conditions Builder for Select & Toggle fields Jan 23, 2024
Copy link
Member

@jasonvarga jasonvarga left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is great. So close though.

When you are targeting a toggle, you can't select false.

CleanShot.2024-01-30.at.16.47.43.mp4

@duncanmcclean
Copy link
Member Author

duncanmcclean commented Jan 31, 2024

@jasonvarga Whoops, should be fixed now!

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.

2 participants