Skip to content

feat: charts a11y improvements#2193

Open
graphieros wants to merge 11 commits intomainfrom
vue-data-ui-a11y-updates
Open

feat: charts a11y improvements#2193
graphieros wants to merge 11 commits intomainfrom
vue-data-ui-a11y-updates

Conversation

@graphieros
Copy link
Contributor

@graphieros graphieros commented Mar 22, 2026

This PR is part of #2153

  • Bump vue-data-ui to 3.16.0 (release notes)

    • keyboard navigation in the chart areas to cycle through datapoints when charts are in focus
    • sr hidden data tables & hints
  • Add translations for hints & sr sections

  • Update focus styles

Updated charts:

  • sparkline (weekly downloads on package page)
  • downloads chart in modal (package page)
  • versions chart in modal (package page=
  • downloads charts (compare page)
  • bar charts (compare page)

@vercel
Copy link

vercel bot commented Mar 22, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
npmx.dev Ready Ready Preview, Comment Mar 22, 2026 8:22pm
2 Skipped Deployments
Project Deployment Actions Updated (UTC)
docs.npmx.dev Ignored Ignored Preview Mar 22, 2026 8:22pm
npmx-lunaria Ignored Ignored Mar 22, 2026 8:22pm

Request Review

@github-actions
Copy link

github-actions bot commented Mar 22, 2026

Lunaria Status Overview

🌕 This pull request will trigger status changes.

Learn more

By default, every PR changing files present in the Lunaria configuration's files property will be considered and trigger status changes accordingly.

You can change this by adding one of the keywords present in the ignoreKeywords property in your Lunaria configuration file in the PR's title (ignoring all files) or by including a tracker directive in the merged commit's description.

Tracked Files

File Note
i18n/locales/en.json Source changed, localizations will be marked as outdated.
i18n/locales/fr-FR.json Localization changed, will be marked as complete.
Warnings reference
Icon Description
🔄️ The source for this localization has been updated since the creation of this pull request, make sure all changes in the source have been applied.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Mar 22, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 179646a8-7512-4612-a6d2-e759085bcf10

📥 Commits

Reviewing files that changed from the base of the PR and between 245b76e and 6a14e76.

📒 Files selected for processing (7)
  • app/components/Compare/FacetBarChart.vue
  • app/components/Package/TrendsChart.vue
  • app/components/Package/VersionDistribution.vue
  • app/components/Package/WeeklyDownloadStats.vue
  • i18n/locales/en.json
  • i18n/locales/fr-FR.json
  • i18n/schema.json
✅ Files skipped from review due to trivial changes (4)
  • app/components/Package/WeeklyDownloadStats.vue
  • i18n/locales/fr-FR.json
  • i18n/locales/en.json
  • i18n/schema.json
🚧 Files skipped from review as they are similar to previous changes (3)
  • app/components/Package/VersionDistribution.vue
  • app/components/Compare/FacetBarChart.vue
  • app/components/Package/TrendsChart.vue

📝 Walkthrough

Walkthrough

This PR adds accessibility support to several chart components (FacetBarChart, TrendsChart, VersionDistribution, WeeklyDownloadStats) by injecting a11y.translations into chart configs, adding conditional hint slots for keyboard-navigation hints, and adding scoped :focus-visible styling. It updates English and French i18n files and the i18n schema for the new keys, and bumps vue-data-ui from 3.15.12 to 3.16.0.

Possibly related issues

  • charts a11y improvements #2153: Implements the chart accessibility behaviour (keyboard navigation hints, hint slots and screen-reader/table support) described in this issue.

Possibly related PRs

Suggested labels

front, needs review

Suggested reviewers

  • knowler
  • shuuji3
  • danielroe
🚥 Pre-merge checks | ✅ 1
✅ Passed checks (1 passed)
Check name Status Explanation
Description check ✅ Passed The pull request description clearly relates to the changeset, detailing vue-data-ui upgrade, translations addition, focus style updates, and specific charts modified.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch vue-data-ui-a11y-updates

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Nitpick comments (1)
app/components/Package/VersionDistribution.vue (1)

688-692: Prefer global focus-visible styling for button-like controls.

These local rules for user-options controls should be centralised in the global focus-visible styling layer to avoid drift across chart components.

♻️ Suggested change
-:deep(.vue-ui-user-options-button:focus-visible),
-:deep(.vue-ui-user-options :first-child:focus-visible) {
-  outline: 0.1rem solid var(--accent-color) !important;
-  border-radius: 0.25rem;
-}
Based on learnings: In the npmx.dev project, focus-visible styling for button and select elements is implemented globally in `app/assets/main.css` and components should rely on that global rule.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 34944309-c7de-4246-9413-d9f1d31ced47

📥 Commits

Reviewing files that changed from the base of the PR and between 7f2fc1a and 548e06c.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (8)
  • app/components/Compare/FacetBarChart.vue
  • app/components/Package/TrendsChart.vue
  • app/components/Package/VersionDistribution.vue
  • app/components/Package/WeeklyDownloadStats.vue
  • i18n/locales/en.json
  • i18n/locales/fr-FR.json
  • i18n/schema.json
  • package.json

@codecov
Copy link

codecov bot commented Mar 22, 2026

Codecov Report

❌ Patch coverage is 66.66667% with 7 lines in your changes missing coverage. Please review.
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
app/components/Package/VersionDistribution.vue 20.00% 3 Missing and 1 partial ⚠️
app/components/Package/WeeklyDownloadStats.vue 50.00% 2 Missing and 1 partial ⚠️

📢 Thoughts on this report? Let us know!

Copy link
Member

@alexdln alexdln left a comment

Choose a reason for hiding this comment

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

Wow, I love it (I'm one of those keyboard person)

I think for even better accessibility, would be usable to provide a text hint somewhere on focused element. Either via an aria-label on the SVG itself, or focus specifically on the text element (with title?). Perhaps would be usable additionally update the text or change focus on next point label on tabing. Maybe @knowler can suggest how this might work, because I'm not sure about exact implementation and don't think those suggestion will work.

Anyway it looks good and is already a great improvement, thanks 🤍

@graphieros
Copy link
Contributor Author

Anyway it looks good and is already a great improvement, thanks 🤍

Thank you @alexdln :)

This is part of gradual a11y improvements, and I know it can be even better.
I would suggest to ship this for a start, at least we have kbd navigation, then I can continue to improve (and learn notably from @knowler).

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.

3 participants