-
Notifications
You must be signed in to change notification settings - Fork 3.4k
Ivanmartynau/sep 1837 accessibility improvement #27194
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
base: master
Are you sure you want to change the base?
Ivanmartynau/sep 1837 accessibility improvement #27194
Conversation
Add proper navigation. Add proper readability for canvas and link
Add propeties for better readability in the voice reader Add proper navigation. Add proper readability for canvas and link
|
Thank you for your pull request and welcome to the Trino community. We require contributors to sign our Contributor License Agreement, and we don't seem to have you on file. Continue to work with us on the review and improvements in this PR, and submit the signed CLA to [email protected]. Photos, scans, or digitally-signed PDF files are all suitable. Processing may take a few days. The CLA needs to be on file before we merge your changes. For more information, see https://github.com/trinodb/cla |
Reviewer's GuideThis PR enhances the accessibility of the Trino Web UI by adding ARIA attributes to sparkline charts, HUD metric labels, and the logo link to improve screen reader readability. File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey there - I've reviewed your changes and they look great!
Prompt for AI Agents
Please address the comments from this code review:
## Individual Comments
### Comment 1
<location> `core/trino-web-ui/src/main/resources/webapp/src/components/ClusterHUD.jsx:150-151` </location>
<code_context>
$.extend({}, SPARKLINE_PROPERTIES, { chartRangeMin: 0 })
)
+ // Apply ARIA attributes to the generated canvas
+ $('#running-queries-sparkline canvas').attr({
+ 'aria-label': `Running queries over time. Current value: ${this.state.runningQueries[this.state.runningQueries.length - 1]} queries`,
+ 'role': 'img',
+ 'id': 'running-queries-chart'
</code_context>
<issue_to_address>
**issue:** Consider handling empty data arrays to avoid undefined values in ARIA labels.
Accessing the last element of an empty array returns 'undefined', which may be read incorrectly by screen readers. Use a default value like 0 when the array is empty.
</issue_to_address>
### Comment 2
<location> `core/trino-web-ui/src/main/resources/webapp/src/components/ClusterHUD.jsx:153-154` </location>
<code_context>
+ $('#running-queries-sparkline canvas').attr({
+ 'aria-label': `Running queries over time. Current value: ${this.state.runningQueries[this.state.runningQueries.length - 1]} queries`,
+ 'role': 'img',
+ 'id': 'running-queries-chart'
+ })
$('#blocked-queries-sparkline').sparkline(
this.state.blockedQueries,
</code_context>
<issue_to_address>
**issue (bug_risk):** Using static IDs for multiple charts may cause DOM conflicts.
Using a static 'id' for each chart's canvas can result in duplicate IDs if multiple ClusterHUD instances are rendered. Use a unique ID per instance or remove the 'id' if it's not required.
</issue_to_address>
### Comment 3
<location> `core/trino-web-ui/src/main/resources/webapp/src/components/ClusterHUD.jsx:268-269` </location>
<code_context>
data-toggle="tooltip"
data-placement="right"
title="Total number of queries currently running"
+ tabIndex="0"
+ aria-label="Running queries - Total number of queries currently running"
+ aria-describedby="running-queries-chart"
>
</code_context>
<issue_to_address>
**suggestion:** tabIndex="0" may affect keyboard navigation order.
Evaluate if each span should be focusable, as excessive use of tabIndex="0" can make keyboard navigation cumbersome. Limit focusable elements to those that require user interaction.
Suggested implementation:
```javascript
data-toggle="tooltip"
data-placement="right"
title="Total number of queries currently running"
aria-label="Running queries - Total number of queries currently running"
aria-describedby="running-queries-chart"
>
```
```javascript
data-toggle="tooltip"
data-placement="right"
title="Total number of active worker nodes"
aria-label="Active workers - Total number of active worker nodes"
aria-describedby="active-workers-chart"
>
```
</issue_to_address>Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
| $('#running-queries-sparkline canvas').attr({ | ||
| 'aria-label': `Running queries over time. Current value: ${this.state.runningQueries[this.state.runningQueries.length - 1]} queries`, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
issue: Consider handling empty data arrays to avoid undefined values in ARIA labels.
Accessing the last element of an empty array returns 'undefined', which may be read incorrectly by screen readers. Use a default value like 0 when the array is empty.
| 'id': 'running-queries-chart' | ||
| }) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
issue (bug_risk): Using static IDs for multiple charts may cause DOM conflicts.
Using a static 'id' for each chart's canvas can result in duplicate IDs if multiple ClusterHUD instances are rendered. Use a unique ID per instance or remove the 'id' if it's not required.
| tabIndex="0" | ||
| aria-label="Running queries - Total number of queries currently running" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
suggestion: tabIndex="0" may affect keyboard navigation order.
Evaluate if each span should be focusable, as excessive use of tabIndex="0" can make keyboard navigation cumbersome. Limit focusable elements to those that require user interaction.
Suggested implementation:
data-toggle="tooltip"
data-placement="right"
title="Total number of queries currently running"
aria-label="Running queries - Total number of queries currently running"
aria-describedby="running-queries-chart"
> data-toggle="tooltip"
data-placement="right"
title="Total number of active worker nodes"
aria-label="Active workers - Total number of active worker nodes"
aria-describedby="active-workers-chart"
>|
@ivanmartynau-oss Hi, could you remove the jira link in the release note, it’s not really helpful for open-source folks :) |
Description
We do have a11y Audit, some of the issues in this audit connected with Trino
This PR is created to fix those. We have to add couple of properties to improve readability of voice readers
Additional context and related issues
Release notes
( ) This is not user-visible or is docs only, and no release notes are required.
Summary by Sourcery
Enhance web UI accessibility by adding ARIA attributes and keyboard focus to charts and updating image/link labels.
Enhancements: