Repository navigation
Made the graph's Info tooltip screen reader and keyboard accessible - #1852
Open
danielrafailov wants to merge 3 commits into
Open
danielrafailov wants to merge 3 commits into
danielrafailov wants to merge 3 commits into
Conversation
Coverage Report for CI Build 46940327639Coverage increased (+0.1%) to 63.227%Details
Uncovered ChangesNo uncovered changes found. Coverage RegressionsNo coverage regressions found. Coverage Stats💛 - Coveralls |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Proposed Changes
The fourth of the graph accessibility PRs from the plan (the Info tooltip), following #1849 and #1850. The third, per-node descriptions, builds on #1850, so it will follow once that's merged. Before this change:
opacity: 0), so VoiceOver could still land on an invisible "Info" for whichever course was hovered last.Changes:
InfoBox.tsx:role="button", labelled with its course, e.g. "More information about CSC236H1". The label uses the course's text as shown on its node, so combined nodes read correctly (e.g. "More information about MAT224H1/MAT247H1"), with the node id as a fallback.aria-hiddenand out of the tab order. While shown, it's focusable (tabIndex={0}), and Enter or Space opens the course's popup, like a native button. A<button>can't be used here because the tooltip is drawn inside the graph's<svg>.Graph.js: passes the hovered node's displayed text toInfoBoxas a newcourseLabelprop.app.scss:.tooltip-group-hiddennow haspointer-events: none, so the faded-out tooltip no longer catches clicks.:focus-visibleoutline to the tooltip, matching the graph controls in Made the graph controls and sidebar toggle keyboard and screen reader accessible #1849.InfoBox.test.js): the label (including a combined course and the node id fallback), that the hidden tooltip isaria-hiddenand not focusable, that Enter and Space open it only while shown, and an end-to-end test on the test graph: hover a course, focus "More information about AAA100", press Enter, and the course popup opens. The snapshot only changes by the new attributes.I tested with VoiceOver in Safari and Chrome. For mouse users, the only difference is that clicking where the faded-out tooltip was no longer opens the popup.
Screenshots of your changes (if applicable)
VoiceOver on the Info tooltip after it has faded out, before the change:



VoiceOver on the Info tooltip, after the change:
Info tooltip focused with the keyboard, after the change:
Type of Change
(Write an
Xor a brief description next to the type or types that best describe your changes.)Checklist
(Complete each of the following items for your pull request. Indicate that you have completed an item by changing the
[ ]into a[x]in the raw text, or by clicking on the checkbox in the rendered description on GitHub.)Before opening your pull request:
After opening your pull request:
Questions and Comments
InfoBox.tsx(getInfoBoxA11yLabel) rather than in thea11y.tsmodule from Added accessible names and descriptions to the graph SVG and hid its decorative parts from screen readers #1850, since that isn't merged yet. I can move it there once Added accessible names and descriptions to the graph SVG and hid its decorative parts from screen readers #1850 is in.