Skip to content

Made the graph's Info tooltip screen reader and keyboard accessible - #1852

Open
danielrafailov wants to merge 3 commits into
Courseography:masterfrom
danielrafailov:info-tooltip-accessibility
Open

danielrafailov wants to merge 3 commits into
Courseography:masterfrom
danielrafailov:info-tooltip-accessibility

Conversation

@danielrafailov

@danielrafailov danielrafailov commented Dec 2, 2026 •

Copy link
Copy Markdown
Contributor

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:

  • Screen readers could reach it while it was invisible. After the mouse leaves, the tooltip is only made transparent (opacity: 0), so VoiceOver could still land on an invisible "Info" for whichever course was hovered last.
  • It didn't say which course it belonged to. It was announced as just "Info", and not as something you can activate.
  • The invisible tooltip still caught clicks. Clicking where the faded-out "Info" had been opened that course's popup.

Changes:

  • InfoBox.tsx:
    • The tooltip is now 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.
    • While hidden, it's aria-hidden and 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 to InfoBox as a new courseLabel prop.
  • app.scss:
  • Tests (InfoBox.test.js): the label (including a combined course and the node id fallback), that the hidden tooltip is aria-hidden and 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:
Screenshot 2026-12-02 at 1 41 42 PM
VoiceOver on the Info tooltip, after the change:
Screenshot 2026-12-02 at 1 24 56 PM
Info tooltip focused with the keyboard, after the change:
Screenshot 2026-12-02 at 1 27 04 PM

Type of Change

(Write an X or a brief description next to the type or types that best describe your changes.)

Type Applies?
🚨 Breaking change (fix or feature that would cause existing functionality to change)
✨ New feature (non-breaking change that adds functionality) X
🐛 Bug fix (non-breaking change that fixes an issue) X
🎨 User interface change (change to user interface; provide screenshots) X
♻️ Refactoring (internal change to codebase, without changing functionality)
🚦 Test update (change that only adds or modifies tests)
📦 Dependency update (change that updates a dependency)
🔧 Internal (change that only affects developers or continuous integration)

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:

  • I have performed a self-review of my changes.
    • Check that all changed files included in this pull request are intentional changes.
    • Check that all changes are relevant to the purpose of this pull request, as described above.
  • I have added tests for my changes, if applicable.
    • This is required for all bug fixes and new features.
  • I have updated the project documentation, if applicable.
    • This is required for new features.
  • If this is my first contribution, I have added myself to the list of contributors.
  • I have updated the project Changelog (this is required for all changes).

After opening your pull request:

  • I have verified that the CI checks have passed.
  • I have reviewed the test coverage changes reported by Coveralls.
  • I have requested a review from a project maintainer.

Questions and Comments

@coveralls

coveralls commented Dec 2, 2026 •

Copy link
Copy Markdown

Coverage Report for CI Build 46940327639

Coverage increased (+0.1%) to 63.227%

Details

  • Coverage increased (+0.1%) from the base build.
  • Patch coverage: 6 of 6 lines across 2 files are fully covered (100%).
  • No coverage regressions found.

Uncovered Changes

No uncovered changes found.

Coverage Regressions

No coverage regressions found.


Coverage Stats

Coverage Status
Relevant Lines: 4342
Covered Lines: 2790
Line Coverage: 64.26%
Relevant Branches: 1026
Covered Branches: 604
Branch Coverage: 58.87%
Branches in Coverage %: Yes
Coverage Strength: 149.28 hits per line

💛 - Coveralls

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.

2 participants