SOLR-17936: add focus indicator to navigation sidebar entries in new UI #3716
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
https://issues.apache.org/jira/browse/SOLR-17936
Description
In the new ui, add a focus indicator around the sidebar entry that has focus.
Before (light mode) -- the cluster element has keyboard focus but there is no way to know that:

Before (dark mode):
After (light mode):

After (dark mode):

Solution
Use Compose's
onFocusChanged
functionality to determine when an element has focus, and add a border around it if so. Thanks to this guidance for the approach.Tests
I wasn't sure how to write an effective automated test for this; I couldn't find a way to make assertions about modifiers or color alpha values in compose -- it seemed like screenshot testing is encouraged more for this type of thing? I'd be happy to add a test if there are some ideas about the approach (or if I could write this functionality in a more testable way)!
I tested this manually by:
./gradlew :solr:ui:run
, connecting to my local solr, and tabbing through the various sidebar entriesChecklist
Please review the following and check all that apply:
main
branch../gradlew check
.