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

fix(chart table in dashboard): improve screen reading of table #26453

Conversation

ncar285
Copy link
Contributor

@ncar285 ncar285 commented Jan 11, 2024

SUMMARY

Enhancing Accessibility with Unified Table Structure and Sticky Header

This PR addresses accessibility concerns by merging the header and body of our tables into a single unified structure. This change significantly improves screen reader compatibility, ensuring a more inclusive user experience. Previously, the header and body of a chart were seperate tables. Visually this worked but caused issues with screen reader functionality.

Key Change:

  • The table now consists of a single, unified structure, as opposed to separate elements for the header and body. This enhances accessibility, particularly for screen reader users.
  • The header is made sticky using CSS, allowing it to remain visible while the table body is scrollable.

Technical Challenge:
A notable challenge was maintaining a scrollable body while keeping the header fixed. Setting overflow directly on tbody proved unfeasible. Wrapping tbody in a div with an overflow disrupted the column grouping, as the table would then interpret the entire tbody as a single column. The implemented solution achieves the desired layout without compromising the table's integrity or accessibility.

TESTING INSTRUCTIONS

  1. Navigate to a page featuring the modified table structure.
  2. Use a screen reader to ensure that the table content is read correctly and in a logical order and doesn't read end of table early.
  3. Scroll through the table to check that the header remains fixed while the body is scrollable.
  4. Visually inspect the table across different browsers for consistent rendering.

ADDITIONAL INFORMATION

Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

Congrats on making your first PR and thank you for contributing to Superset! 🎉 ❤️

We hope to see you in our Slack community too! Not signed up? Use our Slack App to self-register.

@eschutho
Copy link
Member

@ncar285 looks like there are some linting errors that are causing the tests to fail. I can comment on some in the PR, but you can also run npm run lint-fix from superset-frontend folder and that will catch some of the indentation ones.

Copy link
Member

@eschutho eschutho left a comment

Choose a reason for hiding this comment

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

Thanks @ncar285! Looks really good. Just some small suggestions for linting and cleanup.

ncar285 and others added 3 commits January 16, 2024 17:47
…ks/useSticky.tsx

Co-authored-by: Elizabeth Thompson <eschutho@gmail.com>
…ks/useSticky.tsx

Co-authored-by: Elizabeth Thompson <eschutho@gmail.com>
@pull-request-size pull-request-size bot added size/S and removed size/M labels Jan 16, 2024
Copy link

codecov bot commented Jan 16, 2024

Codecov Report

Attention: 1 lines in your changes are missing coverage. Please review.

Comparison is base (46e6778) 69.18% compared to head (8d11cc1) 69.16%.
Report is 219 commits behind head on master.

Files Patch % Lines
...ugin-chart-table/src/DataTable/hooks/useSticky.tsx 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master   #26453      +/-   ##
==========================================
- Coverage   69.18%   69.16%   -0.03%     
==========================================
  Files        1945     1948       +3     
  Lines       75948    76037      +89     
  Branches     8460     8493      +33     
==========================================
+ Hits        52546    52591      +45     
- Misses      21217    21266      +49     
+ Partials     2185     2180       -5     
Flag Coverage Δ
javascript 56.50% <0.00%> (-0.02%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@yousoph
Copy link
Member

yousoph commented Jan 19, 2024

/testenv up

Copy link
Contributor

@yousoph Ephemeral environment spinning up at http://54.184.85.44:8080. Credentials are admin/admin. Please allow several minutes for bootstrapping and startup.

Copy link
Member

@eschutho eschutho left a comment

Choose a reason for hiding this comment

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

This looks great @ncar285. I'll leave the PR open for testing, and then we'll merge. Thank you!

@eschutho eschutho added the hold:testing! On hold for testing label Jan 25, 2024
@eschutho eschutho merged commit 71a950f into apache:master Jan 29, 2024
32 checks passed
Copy link
Contributor

Ephemeral environment shutdown and build artifacts deleted.

sadpandajoe pushed a commit to preset-io/superset that referenced this pull request Jan 29, 2024
…e#26453)

Co-authored-by: Elizabeth Thompson <eschutho@gmail.com>
(cherry picked from commit 71a950f)
eschutho added a commit to preset-io/superset that referenced this pull request Jan 31, 2024
…e#26453)

Co-authored-by: Elizabeth Thompson <eschutho@gmail.com>
@kgabryje
Copy link
Member

@ncar285 @eschutho I think after this PR the Totals are not sticky anymore 🙁

Screen.Recording.2024-01-31.at.17.01.57.mov

@eschutho
Copy link
Member

eschutho commented Feb 1, 2024

Thanks for catching @kgabryje! We'll take a look. 🙏

@ncar285
Copy link
Contributor Author

ncar285 commented Feb 1, 2024 via email

sadpandajoe pushed a commit to preset-io/superset that referenced this pull request Feb 2, 2024
sfirke pushed a commit to sfirke/superset that referenced this pull request Mar 22, 2024
…e#26453)

Co-authored-by: Elizabeth Thompson <eschutho@gmail.com>
sfirke pushed a commit to sfirke/superset that referenced this pull request Mar 22, 2024
@mistercrunch mistercrunch added 🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels 🚢 4.0.0 labels Apr 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels hold:testing! On hold for testing size/S 🚢 4.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants