-
Notifications
You must be signed in to change notification settings - Fork 64
Add input bindings for toolbar buttons and select components #1273
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
base: feat/toolbar-epic
Are you sure you want to change the base?
Conversation
gadenbuie
left a comment
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! I have a handful of comments but they're all mostly pretty small 😄
R/toolbar.R
Outdated
| label_text <- paste(unlist(find_characters(label)), collapse = " ") | ||
| # Verifies the label contains non-empty text |
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.
Given how we now handle label in toolbar_input_select(), I think we might want to bump this up to an error as well. I.e. require that label is provided for accessibility reasons, even if not shown.
Although now I'm remembering that the difference is that in the select input we could also enforce label being a scalar string, where here it could be tags that do meet accessibility requirements. Hmmm 🤔
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.
Yeah, I think that had been why we warned instead of errored, since we didn't want to make a strict string requirement on people's labels in the buttons because they're more likely to actually use visible labels, vs. in the select, we're assuming the vast majority of people will use no visible label, which means the tooltip/accessible annotations are way more important.
Co-authored-by: Garrick Aden-Buie <garrick@adenbuie.com>
Co-authored-by: Garrick Aden-Buie <garrick@adenbuie.com>
Co-authored-by: Garrick Aden-Buie <garrick@adenbuie.com>
Fixes #1266
Objectives:
Create input for single select and action button, including update functions.
Todo: Create an issue to deal with validation as specified below
Decision Log:
Update tooltip will remain a separate function call, not a part of update_toolbar_*()
Resolved. Question: Right now, if the options are changed using
update_toolbar_input_select(), there is not a selected choice set by default unless it is also specified using the selected argument. This is consistent with the standardinput_select()s behavior. An alternative would be to automatically select the new choices' first value on update, clearing any selection already made.If current choice is not in choices, clear it and select the first in the new choice list
Implemented a small mocking function for testing the errors with blank labels
Additional test and failure cases:
Select Input:
Input Action Button:
Examples and recordings:
Action Button Test App
Screen.Recording.2026-01-05.at.1.01.47.PM.mov
Select Test App
Screen.Recording.2026-01-05.at.1.19.54.PM.mov