Skip to content

fix: show integers for values below 1k in trends chart tooltip - #2550

Merged
graphieros merged 4 commits into
mainfrom
format-download-chart-tooltip-values
Apr 16, 2026
Merged

fix: show integers for values below 1k in trends chart tooltip#2550
graphieros merged 4 commits into
mainfrom
format-download-chart-tooltip-values

Conversation

@graphieros

@graphierosgraphieros commented Apr 16, 2026

Copy link
Copy Markdown
Member

Follow up to #2519

This fixes an edge case for the big charts (downloads modal, compare page) where values displayed in the tooltip have decimals applied when data correction is enabled and the value in the tooltip is < 1k.
Just rounding the number before it is served to the formatter.

@vercel

vercelBot commented Apr 16, 2026

Copy link
Copy Markdown
Contributor

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

ProjectDeploymentActionsUpdated (UTC)
npmx.devReadyReadyPreview, CommentApr 16, 2026 3:03pm
2 Skipped Deployments
ProjectDeploymentActionsUpdated (UTC)
docs.npmx.devIgnoredIgnoredPreviewApr 16, 2026 3:03pm
npmx-lunariaIgnoredIgnoredApr 16, 2026 3:03pm

Request Review

@coderabbitai

coderabbitaiBot commented Apr 16, 2026

Copy link
Copy Markdown
Contributor
📝 Walkthrough

Walkthrough

Rounded tooltip raw values with Math.round(...) before passing to compactNumberFormatter, preserving non-finite coercion to 0 and affecting both single- and multi-series tooltip rows in the trends chart component.

Changes

Cohort / File(s)Summary
Trends chart tooltip
app/components/Package/TrendsChart.vue
Changed tooltip raw derivation from Number(d?.value ?? 0) to Math.round(Number(d?.value ?? 0)), then formatted with compactNumberFormatter; non-finite values still coerced to 0.

Possibly related PRs

Suggested reviewers

  • danielroe
  • 43081j
🚥 Pre-merge checks | ✅ 2
✅ Passed checks (2 passed)
Check nameStatusExplanation
Title check✅ PassedThe title accurately reflects the main change: rounding numeric values in the trends chart tooltip to display integers for values below 1k.
Description check✅ PassedThe pull request description clearly relates to the changeset, explaining a bug fix for tooltip value formatting in the trends chart component.

✏️ 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 format-download-chart-tooltip-values

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.

@graphieros
graphieros marked this pull request as draft April 16, 2026 10:43
@codecov

codecovBot commented Apr 16, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 0% with 1 line in your changes missing coverage. Please review.
✅ All tests successful. No failed tests found.

Files with missing linesPatch %Lines
app/components/Package/TrendsChart.vue0.00%0 Missing and 1 partial ⚠️

📢 Thoughts on this report? Let us know!

@graphieros
graphieros added this pull request to the merge queueApr 16, 2026
Merged via the queue into main with commit da0897bApr 16, 2026
24 checks passed
@graphieros
graphieros deleted the format-download-chart-tooltip-values branch April 16, 2026 20:33
@github-actionsgithub-actionsBot mentioned this pull request Apr 16, 2026
ulrichstark added a commit to ulrichstark/npmx.dev that referenced this pull request Apr 18, 2026
ayo-run pushed a commit to ayo-run/npmx.dev that referenced this pull request Aug 5, 2026
Sign up for freeto 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.

2 participants

@graphieros@MatteoGabriele