-
Notifications
You must be signed in to change notification settings - Fork 161
Replace text inputs with checkboxes in the bootstrap wizard UI #2931
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
Replace text inputs with checkboxes in the bootstrap wizard UI #2931
Conversation
79b4471
to
e21e63d
Compare
bootstrapWizardInput
and related types.e21e63d
to
29eee0e
Compare
Replace text fields with checkboxes for Boolean values in the bootstrap wizard. Add local variables for input lookup. Removed unnecessary copying of styles.
29eee0e
to
713aeb1
Compare
Tested that params are built properly with checkboxes.
|
for i := range m.inputs { | ||
input := m.inputs[i] |
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.
💡
for i := range m.inputs { | |
input := m.inputs[i] | |
for i, input := range m.inputs { |
There's a few other for loops that can be simplified by just grabbing the second argument from range.
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.
Good catch! JS habits die hard. 🤣
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.
Refactored the loops.
} | ||
|
||
return ti | ||
return fmt.Sprintf("%s%s%s", open, checkmark, close) |
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.
[x]
I panic that I don't know what it's asking me to do and refuse to read the help text above until I've figured it out, whereas [x] private
would calm me down enough to pay attention.
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.
Added checkbox placeholders.
Closes #2870
Added type
bootstrapWizardInput
and related types.Replaced text fields with checkboxes for Boolean values in the bootstrap wizard. Checkboxes can be toggles with the Space key when focused.
Minor refactoring:
-- added local variables for input lookup (
input := inputs[i]
) for readability-- removed unnecessary copying of styles. I previously copied it from Bubble Tea examples, so I'm not sure why
style.Copy()
was used not only when creating new styles based on old styles but also when just rendering elements with in this style. So, removed it and tested it locally, it seems to work fine without the redundant copying. If anything goes wrong, we can always put it back, but it should work fine.Questions:
Checkbox toggled with space:
Greyed out underscore marks false value. The color of the underscore can be changed or or the underscore can be removed easily if needed.
Focuses checkbox with true value + unfocused checkbox: