Skip to content

Premium Analytics: Name each widget chart for screen readers - #53333

Draft
adamwoodnz wants to merge 8 commits into
charts-251-charts-pie-semi-circle-charts-have-no-keyboard-access-and-nofrom
stats-521-premium-analytics-name-each-widget-chart-for-screen-readers
Draft

adamwoodnz wants to merge 8 commits into
charts-251-charts-pie-semi-circle-charts-have-no-keyboard-access-and-nofrom
stats-521-premium-analytics-name-each-widget-chart-for-screen-readers

Conversation

@adamwoodnz

@adamwoodnz adamwoodnz commented Oct 7, 2026 •

Copy link
Copy Markdown
Contributor

Fixes https://linear.app/a8c/issue/STATS-521

Why

On the Premium Analytics dashboard, a screen reader announces every line and bar chart as just "Line chart" or "Bar chart", so a user moving through a dashboard of a dozen widgets cannot tell which chart they are on. After this PR, each chart is announced by its widget's title, such as "Traffic summary chart" or "Sales by device chart".

The word "chart" is part of the name because the chart's role is application, so nothing else tells a screen reader user it is a chart. It also keeps the chart's name from repeating the name of the widget section around it.

Proposed changes

  • The toolkit chart wrappers (ComparativeLineChart, ComparativeBarChart, the toolkit BarChart and MetricTabsChart) take an optional chartTitle. The leaf wrappers name the chart through one translatable %s chart string, so each locale can put the word where its grammar needs it. Without a title, the chart keeps its default name. ComparativeLineChart no longer accepts the charts package's ariaLabel, which it took in its type but dropped.
  • Each line and bar widget passes its own title from widget.json: Author performance, Email performance, Post views, Store performance, Subscriber summary, Traffic summary, Video performance, Revenue by customer type, Bookings revenue by customer type, Sales by coupon, Sales by coupon usage, Sales by device, Bookings by device and Total returns. Widgets that share one component each get their own title.
  • One test per wrapper. The leaf wrappers assert the formatted name; the toolkit BarChart also asserts that no title keeps the default. MetricTabsChart is covered in all three layouts (single metric, tabs and the narrow dropdown) for both chart types. The shared @wordpress/compose test mock can now report a width, which is how the dropdown test is reached.
  • The wrapper READMEs list the new prop.
  • Changelog entries for the package and for the premium-analytics, jetpack and wpcomsh plugins.

Stacked on #53202, which adds ariaLabel to the charts package's line, area and bar charts; retarget to trunk once it merges. The pie, semi-circle and donut widgets follow in this PR after #53274 (CHARTS-251) merges.

Related product discussion/links

Does this pull request change what data or activity we track or use?

No.

Testing instructions

  1. On a site with Premium Analytics enabled, open the dashboard.
  2. In Chrome DevTools, select any line or bar chart's focusable container (role="application") and open the Accessibility pane. Confirm its name is the widget's title followed by "chart", such as "Traffic summary chart", not "Line chart" or "Bar chart".
  3. With VoiceOver on, Tab through the dashboard. Confirm each chart is announced as " chart".
  4. Resize a metric-tab widget (Traffic summary, Store performance or Subscriber summary) narrow enough to show the metric dropdown, and repeat step 2.

Verified locally: the Premium Analytics test suite and typecheck pass.

🤖 Generated with Claude Code

https://claude.ai/code/session_01EtJ3LkpDhDoFRY6BpADpoU

@github-actions

github-actions Bot commented Oct 7, 2026 •

Copy link
Copy Markdown
Contributor

Are you an Automattician? Please test your changes on all WordPress.com environments to help mitigate accidental explosions.

  • To test on WoA, go to the Plugins menu on a WoA dev site. Click on the "Upload" button and follow the upgrade flow to be able to upload, install, and activate the Jetpack Beta plugin. Once the plugin is active, go to Jetpack > Jetpack Beta, select your plugin (Jetpack or WordPress.com Site Helper), and enable the stats-521-premium-analytics-name-each-widget-chart-for-screen-readers branch.
  • To test on Simple, run the following command on your sandbox:
bin/jetpack-downloader test jetpack stats-521-premium-analytics-name-each-widget-chart-for-screen-readers

Interested in more tips and information?

  • In your local development environment, use the jetpack rsync command to sync your changes to a WoA dev blog.
  • Read more about our development workflow here: PCYsg-eg0-p2
  • Figure out when your changes will be shipped to customers here: PCYsg-eg5-p2

@github-actions

github-actions Bot commented Oct 7, 2026 •

Copy link
Copy Markdown
Contributor

Thank you for your PR!

When contributing to Jetpack, we have a few suggestions that can help us test and review your patch:

  • ✅ Include a description of your PR changes.
  • ✅ Add a "[Status]" label (In Progress, Needs Review, ...).
  • ✅ Add testing instructions.
  • ✅ Specify whether this PR includes any changes to data or privacy.
  • ✅ Add changelog entries to affected projects

This comment will be updated as you work on your PR and make changes. If you think that some of those checks are not needed for your PR, please explain why you think so. Thanks for cooperation 🤖


Follow this PR Review Process:

  1. Ensure all required checks appearing at the bottom of this PR are passing.
  2. Make sure to test your changes on all platforms that it applies to. You're responsible for the quality of the code you ship.
  3. You can use GitHub's Reviewers functionality to request a review.
  4. When it's reviewed and merged, you will be pinged in Slack to deploy the changes to WordPress.com simple once the build is done.

If you have questions about anything, reach out in #jetpack-developers for guidance!


Jetpack plugin:

No scheduled milestone found for this plugin.

If you have any questions about the release process, please ask in the #jetpack-releases channel on Slack.


Boost plugin:

No scheduled milestone found for this plugin.

If you have any questions about the release process, please ask in the #jetpack-releases channel on Slack.


Social plugin:

No scheduled milestone found for this plugin.

If you have any questions about the release process, please ask in the #jetpack-releases channel on Slack.


Videopress plugin:

No scheduled milestone found for this plugin.

If you have any questions about the release process, please ask in the #jetpack-releases channel on Slack.


Wpcomsh plugin:

  • Next scheduled release: Atomic deploys happen twice daily on weekdays (p9o2xV-2EN-p2)

If you have any questions about the release process, please ask in the #jetpack-releases channel on Slack.


Premium Analytics plugin:

No scheduled milestone found for this plugin.

If you have any questions about the release process, please ask in the #jetpack-releases channel on Slack.


Stats Data plugin:

No scheduled milestone found for this plugin.

If you have any questions about the release process, please ask in the #jetpack-releases channel on Slack.

@adamwoodnz adamwoodnz added the DO NOT MERGE don't merge it! label Oct 7, 2026
@jp-launch-control

jp-launch-control Bot commented Oct 7, 2026 •

Copy link
Copy Markdown

Code Coverage Summary

No summary data is available for parent commit 20ee1c2, so cannot calculate coverage changes. 😴

If that commit is a feature branch rather than a trunk commit, this is expected. Otherwise, this should be updated once coverage for 20ee1c2 is available.

Full summary · PHP report · JS report

@adamwoodnz
adamwoodnz force-pushed the charts-233-charts-critical-aria-required-children-violation-on branch from 969e802 to 89bf1ba Compare October 8, 2026 02:58
@adamwoodnz
adamwoodnz force-pushed the stats-521-premium-analytics-name-each-widget-chart-for-screen-readers branch from 2ef0641 to aa38faf Compare October 8, 2026 02:59
Base automatically changed from charts-233-charts-critical-aria-required-children-violation-on to trunk October 8, 2026 03:34
@github-actions github-actions Bot added [JS Package] Charts [Plugin] Boost A feature to speed up the site and improve performance. [Plugin] Social Issues about the Jetpack Social plugin [Plugin] Stats Data [Plugin] VideoPress A standalone plugin to add high-quality VideoPress videos to your site. E2E Tests RNA labels Oct 8, 2026
@adamwoodnz
adamwoodnz force-pushed the stats-521-premium-analytics-name-each-widget-chart-for-screen-readers branch from aa38faf to ce2a2da Compare October 8, 2026 03:48
@adamwoodnz
adamwoodnz changed the base branch from trunk to charts-251-charts-pie-semi-circle-charts-have-no-keyboard-access-and-no October 8, 2026 03:48
The charts package can now name a chart for screen readers. The toolkit wrappers dropped the prop, so widgets had no way to supply a name.
Screen reader users can tell the dashboard's charts apart.
Screen reader users can tell the dashboard's charts apart.
Screen reader users on the package and both plugins that ship the dashboard need to see the fix in their changelogs.
Atomic sites reach the Premium Analytics dashboard through wpcomsh, so its users need the entry too.
The tabbed branch passes ariaLabel separately and production widgets use it, so it needs its own coverage; the READMEs and a redundant default are tidied alongside.
The dropdown branch passes ariaLabel separately from the tabs branch, so it needs its own coverage, which the mocked resize observer can now reach by reporting a width.
The chart's role is application, so a screen reader never says it is a chart, and a bare widget title repeats the name of the section around it. The wrappers now take chartTitle and build the name through one translatable string, so each locale can place the word for chart where its grammar needs it.
@adamwoodnz
adamwoodnz force-pushed the charts-251-charts-pie-semi-circle-charts-have-no-keyboard-access-and-no branch from 096d632 to 20ee1c2 Compare October 8, 2026 03:51
@adamwoodnz
adamwoodnz force-pushed the stats-521-premium-analytics-name-each-widget-chart-for-screen-readers branch from ce2a2da to d6007f0 Compare October 8, 2026 03:51

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Accessibility DO NOT MERGE don't merge it! Docs E2E Tests [JS Package] Charts [Package] Premium Analytics [Plugin] Boost A feature to speed up the site and improve performance. [Plugin] Jetpack Issues about the Jetpack plugin. https://wordpress.org/plugins/jetpack/ [Plugin] Premium Analytics [Plugin] Social Issues about the Jetpack Social plugin [Plugin] Stats Data [Plugin] VideoPress A standalone plugin to add high-quality VideoPress videos to your site. [Plugin] Wpcomsh RNA [Status] In Progress [Tests] Includes Tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant