Skip to content
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

Keyboard and Screenreader a11y improvements #666

Merged
merged 11 commits into from
Feb 21, 2025

Conversation

bgareth
Copy link
Contributor

@bgareth bgareth commented Feb 6, 2025

This PR is about implementing keyboard and screenreader a11y improvements.

Notable changes:

  • Added screen reader only elements
    • Shortcut list element (before the toolbar / workbook in DOM)
    • Alert element to read out selection coordinates clearly when navigating the grid
    • Alert element to read when sheet focus lock is toggled
  • Added ability to toggle sheet focus lock as some screen readers, such as NVDA, conflict with the sheet keyboard controls and cannot access the toolbar and other elements easily. Most sheet specific shortcuts and keyboard navigation is ignored when toggle off, allowing for regular keyboard navigation to take place
  • Added more aria-label depth to toolbar items and other intractable elements to improve reading
  • Added shortcuts for keyboard support for "drag and drop auto-fill"
  • Removed default Canvas "image" aria reading as it was unhelpful
  • Added strings and translations to account for the above
  • On sheet mount focus on cell A1 allows for keyboard initial navigation to the sheet, as before the navigation controls were nullified without any selection in focus.
  • eslint fixes and update to delete test in order to account for changes and runner errors
  • Addressed some A11y DOM standards flagged by Axe Dev tools

Notes:

  • This is not intended to change the experience for non screen reader and keyboard users, but only to improve the clarity and available functionality for screen reader and keyboard users.
  • New shortcuts were chosen to avoid popular Mac, Windows and Chrome actions as best as possible while keeping in Google Sheet and standard practices.
  • Tested using NVDA, MacVO and Chrome screen reader.

@sanchit3008
Copy link
Collaborator

thanks for this @bgareth , please let me know when this is ready for review!

@bgareth bgareth marked this pull request as ready for review February 10, 2025 16:14
@bgareth
Copy link
Contributor Author

bgareth commented Feb 10, 2025

thanks for this @bgareth , please let me know when this is ready for review!

Thank you so much, @sanchit3008. This is ready for review. Please let me know if you have any questions or requests.
I will also get another set of eyes from my team.

Separate note: once we are happy with the state of a11y for this project, we intend to add significant translation support as discussed last year.

@sanchit3008
Copy link
Collaborator

thanks @bgareth , i will start reviewing this tomorrow

@Corbe30 you can review this as well

@bgareth
Copy link
Contributor Author

bgareth commented Feb 14, 2025

I noticed another weakness in keyboard functionality around accessing the cell range context menu. I will get working on a commit, but if this review is complete by the time I am done, then I will separate it out to a new PR.

@sanchit3008
Copy link
Collaborator

sanchit3008 commented Feb 14, 2025 via email

@bgareth
Copy link
Contributor Author

bgareth commented Feb 16, 2025

You can include this in the pr itself, however it's going to take me some time to review due to personal commitments

Thanks, @sanchit3008. No rush.

@Corbe30
Copy link
Contributor

Corbe30 commented Feb 17, 2025

Thanks @bgareth. I'll review the PR today ✨

@Corbe30
Copy link
Contributor

Corbe30 commented Feb 17, 2025

image

In this PR, adding new sheets pushes the new sheet tabs vertically instead of horizontally. Can you please fix it @bgareth

@bgareth
Copy link
Contributor Author

bgareth commented Feb 17, 2025

image In this PR, adding new sheets pushes the new sheet tabs vertically instead of horizontally. Can you please fix it @bgareth

Thanks for catching this, @Corbe30. I have pushed a commit that addresses this.

@bgareth
Copy link
Contributor Author

bgareth commented Feb 19, 2025

Thanks for all the assistance, @Corbe30 and @sanchit3008.

I will address the context menu keyboard improvements in another PR. So this can be merged if you are happy.

@@ -682,6 +768,37 @@ export function handleGlobalKeyDown(
// return;
// }

// Toggle focus with Ctrl + Shift + F (independent of sheet focus state)
if (e.ctrlKey && e.shiftKey && kstr === "F") {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this should also occur in e.metaKey + e.shiftKey + F, right @sanchit3008?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if so, we can move this inside handleWithCtrlOrMetaKey() itself.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm happy to explore improvements here if needed. However, I left this action in a different scope so it can happen despite ctx.sheetFocused and the if (!ctx.sheetFocused) {return} could catch everything else.

@Corbe30
Copy link
Contributor

Corbe30 commented Feb 19, 2025

Thanks for fixing the sheet tabs bug @bgareth! I've left some new comments, can you please fix those too

@bgareth
Copy link
Contributor Author

bgareth commented Feb 19, 2025

Thanks for fixing the sheet tabs bug @bgareth! I've left some new comments, can you please fix those too

Thanks again, @Corbe30. I have addressed the feedback. I have left responses on a couple individual comments.

@sanchit3008 sanchit3008 merged commit e0f527a into ruilisi:master Feb 21, 2025
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants