add table semantics to workspace data tables for screen readers#93335
add table semantics to workspace data tables for screen readers#93335aimane-chnaif wants to merge 18 commits into
Conversation
Codecov Report✅ Changes either increased or maintained existing code coverage, great job!
|
|
hey @aimane-chnaif this PR hasn't been updated since 3 weeks. Can you please give us an ETA |
|
ETA today or tomorrow |
…o aimane-chnaif/fix-76914-table-a11y
|
@codex review |
|
@MelvinBot review |
|
🤖 Reviewed the change. This is a clean, well-documented, and consistently applied approach — the 1. Verify the semantics actually reach a screen reader (highest priority)The body rows are rendered inside a 2. The container
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 2e4235226a
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
|
@codex review |
|
@MelvinBot review |
|
🤖 Re-reviewed after the
Tests are green (all 8 1. Still need screen-reader evidence (the main gate)The 2. Minor / confirm intent: interactive rows report
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: c8b6922ed4
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
|
I've still been testing all affected pages but this is ready for initial review |
|
@parasharrajat Please copy/paste the Reviewer Checklist from here into a new comment on this PR and complete it. If you have the K2 extension, you can simply click: [this button] |
|
🚧 jasperhuangg has triggered a test Expensify/App build. You can view the workflow run here. |
This comment has been minimized.
This comment has been minimized.
|
Accessibility shortcuts on Windows are great but buggy on MacOS. I'll post list of bugs below. |
|
Ctrl + Option and arrows should navigate between the cells in the table but it only navigates the cells in a row. For example:
shortcut.movExpected behavior
This works perfectly on Windows but not on MacOS. Windows.Shortcuts.mp4 |
This comment was marked as low quality.
This comment was marked as low quality.
…o aimane-chnaif/fix-76914-table-a11y
|
Column header is not focused when announced (it only focuses on the column sort icon) via Ctrl + Option + arrows: Header.not.focused.movThe column header is also announced as: |
|
The Default.group.movPlease fix this for any other badges in other pages as well. |
Reviewer Checklist
Screenshots/VideosMacOS: Chrome / SafariWindows: ChromeWindows.Row.Navigation.mp4Windows.Shortcuts.mp4 |
|
Enter.table.movSteps:
|
|
🚧 jasperhuangg has triggered a test Expensify/App build. You can view the workflow run here. |
|
🧪🧪 Use the links below to test this adhoc build on Android, iOS, and Web. Happy testing! 🧪🧪
|
|
@gijoe0295 it's fixed now |
|
We did not find an internal engineer to review this PR, trying to assign a random engineer to #76914 as well as to this PR... Please reach out for help on Slack if no one gets assigned! |







Explanation of Change
The workspace data tables (Categories, Distance rates, Company cards, Workspaces list, Rooms, and Domains list) are built from generic
View/Pressableelements, so on web they were exposed to screen readers as a flat list of generic containers with no table structure. Screen reader users had no way to perceive row/column relationships, the total number of rows, which column a value belonged to, or how a column was currently sorted.This PR adds proper ARIA table semantics to those tables:
src/components/Table/tableAccessibility.tsthat centralizes the accessibility prop-builders (role="table",rowgroup,row,columnheader,cell, plusaria-label,aria-rowcount,aria-colcount,aria-rowindex, andaria-sort).role="table"), the body wrapper (role="rowgroup"), the header and data rows (role="row"), the column headers (role="columnheader"with livearia-sortstate), and each cell within a row (role="cell").aria-rowcountis set on the container andaria-rowindexon each row so screen readers can announce the correct position even when only a subset of rows is in the DOM. The header row is index 1, so data rows start at 2.ROWGROUPentry toCONST.ROLEfor the body wrapper.The semantics are gated behind
shouldUseTableSemantics(), which applies them only on web (where React Native Web forwardsrole/aria-*to the DOM) and only in the wide/grid layout. They are intentionally skipped on native — where these roles are no-ops and would strip the existingbutton/presentationroles that VoiceOver and TalkBack rely on to announce interactive rows — and in the narrow layout, which already renders a single-column card list that reads correctly.Fixed Issues
$ #76914
Tests
role="table"witharia-label(the table title),aria-rowcount= number of categories + 1 (for the header), andaria-colcount= number of visible columns.role="rowgroup", the header row hasrole="row"witharia-rowindex="1", and each data row hasrole="row"witharia-rowindexstarting at2and incrementing. Confirm each cell inside a row hasrole="cell"and each header cell hasrole="columnheader".aria-sort): Click a sortable column header to sort ascending. Verify that header now hasaria-sort="ascending"; click again and verifyaria-sort="descending". Verify non-active sortable headers reportaria-sort="none"and non-sortable headers have noaria-sort.Ctrl+Option+arrows). Verify it announces "table", row/column position (e.g. "row 3 of 12, column 2"), the column header when entering a cell, and the sort state on headers.role="table"/"row"/"cell"attributes are present (semantics are intentionally disabled here).role="cell".Offline tests
role="row"/aria-rowindex(accessibility props are static and unaffected by network state).QA Steps
Same as Tests, with emphasis on:
Viewaround the table body should not shift spacing).PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectioncanBeMissingparam foruseOnyxtoggleReportand notonIconClick)src/languages/*files and using the translation methodSTYLE.md) were followedAvatar, I verified the components usingAvatarare working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG))npm run compress-svg)Avataris modified, I verified thatAvataris working as expected in all cases)Designlabel and/or tagged@Expensify/designso the design team can review the changes.ScrollViewcomponent to make it scrollable when more elements are added to the page.mainbranch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTeststeps.Screenshots/Videos
Android: Native
Android: mWeb Chrome
iOS: Native
iOS: mWeb Safari
MacOS: Chrome / Safari
web.mov