-
Notifications
You must be signed in to change notification settings - Fork 809
SOLR-17936: add focus indicator to navigation sidebar entries #3744
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
SOLR-17936: add focus indicator to navigation sidebar entries #3744
Conversation
Rather than using Tab, which does not have colors for our various states, we use Button, which has all colors except for the Selected state. Material 3's new "Expressive" version also provides an experiment ToggleButton component, but our version of the Material 3 dependency is not new enough to be able to use it (and if I understand correctly, we can't use the very newest material 3 release, since Compose Multiplatform does not yet support it). With thanks to @malliaridis for the guidance getting started, and for suggesting that we try a component other than Tab.
malliaridis
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.
Changes look great and work perfectly on both light and dark theme. I tested them on windows and mac, and run the browser version too.
The only thing I would probably look into at some point in the future is to extract the implementation to a reusable Composable (like a SolrToggleButton) once we need a similar "toggle" effect in other places. Maybe then we can also look into additional semantics for screen readers for the selected state. But these are topics that are out of scope in my opinion and would explicit testing.
About testing this, I looked into retrieving the background in a test, but this seems quite difficult without rewriting the library's composables right now (so I think). Only the selected state could be applied via the semantics and retrieved in a test if we do something like modifier = modifier.semantics { this.selected = selected }.
So it is fine for now not to have an explicit test for the background change when focused.
@sandbergja if you give me the final go I will merge this change for you. :)
|
Thanks for the review and guidance, @malliaridis ! I think this is ready from my perspective. |
|
Thanks again for the contribution @sandbergja! I am planning to update the Changelog in a separate PR and add all contributors to the new UI for the next release. Are you fine if I add you as well? |
Rather than using Tab, which does not have colors for our various states, we use Button, which has all colors except for the Selected state. Material 3's new "Expressive" version also provides an experiment ToggleButton component, but our version of the Material 3 dependency is not new enough to be able to use it (and if I understand correctly, we can't use the very newest material 3 release, since Compose Multiplatform does not yet support it). With thanks to @malliaridis for the guidance getting started, and for suggesting that we try a component other than Tab. (cherry picked from commit d6be7a4)
Rather than using Tab, which does not have colors for our various states, we use Button, which has all colors except for the Selected state. Material 3's new "Expressive" version also provides an experiment ToggleButton component, but our version of the Material 3 dependency is not new enough to be able to use it (and if I understand correctly, we can't use the very newest material 3 release, since Compose Multiplatform does not yet support it). With thanks to @malliaridis for the guidance getting started, and for suggesting that we try a component other than Tab. (cherry picked from commit d6be7a4)
|
Thanks, @malliaridis ! That is fine, hopefully I can contribute a bit more soon! |
https://issues.apache.org/jira/browse/SOLR-17936
Description
In the new ui, add a focus indicator around the sidebar entry that has focus.
Here is a demonstration of me using Tab and Shift-Tab to navigate between the various items, and Enter to select the item I want:
Solution
Rather than using
Tab, which does not have colors for our various states, we useButton, which has all colors except for the Selected state. Material 3's new "Expressive" version also provides an experimentToggleButtoncomponent, but our version of the Material 3 dependency is not new enough to be able to use it (and if I understand correctly, we can't use the very newest Material 3 release, since Compose Multiplatform does not yet support it).Many thanks to @malliaridis for the guidance getting started, and for suggesting that we try a component other than
Tab.Tests
I tested this manually in both light mode and dark mode, on both desktop and web versions of the new admin UI. I used
TabandShift+Tabto navigate between the items in the side navigation and confirmed that the item I navigated to was always clearly marked.Checklist
Please review the following and check all that apply:
mainbranch../gradlew check.