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
Show file status tooltip on keyboard navigation #17192
Conversation
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.
✨ Works great!
I really like how you narrowed it to keyboard focus so it less noisy for mouse users.
I think this change broke how you can select files to commit using spacebar, because now when pressing spacebar it checks and immediately unchecks the checkbox. |
} | ||
|
||
private onRowKeyUp = (e: React.KeyboardEvent<HTMLDivElement>) => { | ||
this.props.onRowKeyDown(this.props.rowIndex, e) |
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.
Shouldn't this be calling this.props.onRowKeyUp
?
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.
Yep, you're right 😭 Nice catch!
xref. https://github.com/github/accessibility-audits/issues/4938
Description
In #17144 we added the file status to the aria label of our file list items. However that won't be of any use for keyboard-only users that don't use screen readers. Inspired by the work done in #16487, this PR attempts to improve the experience for those users by automatically showing a tooltip over that icon when those list entries get the focus via keyboard interaction.
Compared to #16487, where the tooltip is shown no matter how the changes list header obtained the focus, in this case we will only do that for keyboard interaction because otherwise it gets excessively noisy when the user clicks on these files.
In order to detect when a row gets focused via keyboard, I had to use some heuristics and detect some key events before and after being focused. It's not absolutely perfect, I'm sure of that, but should be enough for our purposes.
Screenshots
Screen.Recording.2023-08-08.at.10.02.22.mov
Release notes
Notes: [Fixed] Improve readability of file statuses for keyboard-only users