Repository navigation
Made the graph's Info tooltip screen reader and keyboard accessible - #1852
Open
danielrafailov wants to merge 5 commits into
Open
danielrafailov wants to merge 5 commits into
danielrafailov wants to merge 5 commits into
Conversation
Coverage Report for CI Build 47008983953Coverage increased (+0.1%) to 63.432%Details
Uncovered ChangesNo uncovered changes found. Coverage RegressionsNo coverage regressions found. Coverage Stats
💛 - Coveralls |
david-yz-liu
previously approved these changes
Dec 3, 2026
david-yz-liu
left a comment
Contributor
There was a problem hiding this comment.
Nice work, @danielrafailov! I'll merge in this PR now, but you can make a small new PR to move the infobox label string into the new a11y.ts module.
| yPos={this.state.infoBoxYPos} | ||
| nodeId={this.state.infoBoxNodeId} | ||
| courseLabel={this.state.nodesJSON[this.state.infoBoxNodeId]?.text | ||
| .map(textTag => textTag.text) |
Contributor
There was a problem hiding this comment.
Use ?. for chaining method calls after the previous ?.
david-yz-liu
dismissed
their stale review
December 3, 2026 00:50
Whoops, I meant to leave a comment on this one. I'll redo it.
Contributor
|
Sorry @danielrafailov, I made a mistake in my review: please address the inline comment
and also merge from master and move the label text into |
…ts label text into a11y.ts
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 and will follow this one. 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>.a11y.ts: newgetInfoBoxA11yLabelbuilds the label, with its wording inGRAPH_A11Y_TEXTalongside the graph's other screen reader text.Graph.js: passes the hovered node's displayed text toInfoBoxas a newcourseLabelprop, built withgetNodeA11yLabelso it always matches the node's own label.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.a11y.test.js: the label helper.InfoBox.test.js: the label on the tooltip (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