Skip to content

Comments

feat: add animation toggle for sparkline chart#1578

Merged
graphieros merged 3 commits intonpmx-dev:mainfrom
graphieros:main
Feb 22, 2026
Merged

feat: add animation toggle for sparkline chart#1578
graphieros merged 3 commits intonpmx-dev:mainfrom
graphieros:main

Conversation

@graphieros
Copy link
Contributor

Resolves #1539

This adds a toggle button under the sparkline chart to play/pause the pulse animation.
The button is not displayed when prefers-reduced-motion is enabled, since the chart does not animate in this case.
The state of the animation state is saved in the application settings.

Animation enabled Animation disabled
image image

@vercel
Copy link

vercel bot commented Feb 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 Feb 22, 2026 4:44pm
2 Skipped Deployments
Project Deployment Actions Updated (UTC)
docs.npmx.dev Ignored Ignored Preview Feb 22, 2026 4:44pm
npmx-lunaria Ignored Ignored Feb 22, 2026 4:44pm

Request Review

@github-actions
Copy link

github-actions bot commented Feb 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
lunaria/files/en-GB.json Localization changed, will be marked as complete.
lunaria/files/en-US.json Source changed, localizations will be marked as outdated.
lunaria/files/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.

@codecov
Copy link

codecov bot commented Feb 22, 2026

Codecov Report

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

Files with missing lines Patch % Lines
app/components/Package/WeeklyDownloadStats.vue 71.42% 2 Missing ⚠️

📢 Thoughts on this report? Let us know!

@graphieros graphieros enabled auto-merge February 22, 2026 16:26
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 22, 2026

No actionable comments were generated in the recent review. 🎉


📝 Walkthrough

Walkthrough

Adds a user-controllable pause/play for the weekly downloads sparkline: introduces animateSparkline on AppSettings.sidebar (default true), exposes hasSparklineAnimation (computed) and toggleSparklineAnimation() in WeeklyDownloadStats.vue, drives config.line.pulse.show from that setting, and renders a ButtonBase control wired to the toggle. Adds translation keys (play_animation, pause_animation) in English (en-GB/en-US), French (fr-FR) and updates i18n schema to include the new keys.

Possibly related PRs

Suggested reviewers

  • shuuji3
  • danielroe
  • garthdw
🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description check ✅ Passed The pull request description accurately describes the changes: adding a toggle button for sparkline animation control, respecting prefers-reduced-motion, and saving state in application settings.
Linked Issues check ✅ Passed The pull request successfully implements the required WCAG 2.2.2 pause mechanism for the weekly downloads animation. A toggle button is added to pause/play the animation, controlled via application settings, with proper i18n support.
Out of Scope Changes check ✅ Passed All changes are directly related to the linked issue requirements. The modifications include the animation toggle component, settings configuration, internationalization strings, and schema updates—all necessary for implementing the pause/stop control feature.

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

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

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/WeeklyDownloadStats.vue (1)

316-320: Redundant aria-label — visible text already provides the accessible name.

When a button contains visible text, the accessible name is computed from that text. Setting an identical aria-label overrides it unnecessarily and creates a maintenance burden (the two strings must be kept in sync). Remove aria-label and rely on the visible label alone, which already satisfies WCAG 2.4.6.

♻️ Proposed refactor
         <ButtonBase
           size="small"
-          :aria-label="
-            hasSparklineAnimation
-              ? $t('package.trends.pause_animation')
-              : $t('package.trends.play_animation')
-          "
           `@click`="toggleSparklineAnimation"
         >

graphieros and others added 2 commits February 22, 2026 17:41
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Copy link
Member

@knowler knowler left a comment

Choose a reason for hiding this comment

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

Awesome—LGTM!

@graphieros graphieros added this pull request to the merge queue Feb 22, 2026
Merged via the queue into npmx-dev:main with commit ba87a55 Feb 22, 2026
16 checks passed
@RYGRIT
Copy link
Contributor

RYGRIT commented Feb 22, 2026

@graphieros I found a small problem: when activated with the Tab key, some content is not fully displayed.

image

@graphieros
Copy link
Contributor Author

@RYGRIT thanks for spotting this :)
Fixed in #1589

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.

Weekly Downloads animation should include a way to pause or stop it (WCAG Level A requirement)

3 participants