Skip to content

Comments

fix: only show estimation segment in last datapoint#1338

Merged
graphieros merged 1 commit intonpmx-dev:mainfrom
graphieros:main
Feb 10, 2026
Merged

fix: only show estimation segment in last datapoint#1338
graphieros merged 1 commit intonpmx-dev:mainfrom
graphieros:main

Conversation

@graphieros
Copy link
Contributor

closes #1318

  • Remove falling segment for partial month / year
image

@vercel
Copy link

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

Request Review

@codecov
Copy link

codecov bot commented Feb 10, 2026

Codecov Report

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

Files with missing lines Patch % Lines
app/components/Package/TrendsChart.vue 68.75% 3 Missing and 2 partials ⚠️

📢 Thoughts on this report? Let us know!

@graphieros graphieros enabled auto-merge February 10, 2026 14:27
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 10, 2026

📝 Walkthrough

Walkthrough

The TrendsChart component has been refactored to simplify its approach to handling estimations for incomplete data periods. A new normalisedDataset is introduced that replaces the final datapoint with an extrapolated value for each series. The previous complex estimation pathway—including dynamic y-axis scaling augmentation and bucket-extrapolation logic—has been removed. The chart now unconditionally uses useNiceScale: true, and the VueUiXy component receives the normalised dataset directly. SVG rendering logic for estimations has been streamlined, including removal of overlay-based estimation indicators. A new extrapolateLastValue() helper function has been added, though its current implementation does not perform actual extrapolation. The net result is a reduction of 219 lines of code.

Suggested reviewers

  • danielroe
🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description check ✅ Passed The pull request description is directly related to the changeset, referencing issue #1318 and describing the removal of falling segments for partial months/years.
Linked Issues check ✅ Passed The PR addresses all core requirements from issue #1318: swaps last datapoint with estimation, replaces max/estimation pathway with normalised dataset, removes nice scale adaptations and opacifying overlay, and simplifies rendering logic.
Out of Scope Changes check ✅ Passed All changes in TrendsChart.vue are directly aligned with the objectives of replacing last datapoint with estimation and removing related axis-scaling mechanisms.

✏️ 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

Tip

We've launched Issue Planner and it is currently in beta. Please try it out and share your feedback on Discord!


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

1346-1350: Update the stale inline comment on useNiceScale.
The note still says monthly/yearly → false, but the flag is now always true, which is misleading.

Proposed fix
-            useNiceScale: true, // daily/weekly -> true, monthly/yearly -> false
+            useNiceScale: true,

@graphieros graphieros requested a review from patak-dev February 10, 2026 14:35
@patak-dev
Copy link
Contributor

Looks amazing! at least from a functionality POV

@graphieros graphieros requested review from danielroe and removed request for patak-dev February 10, 2026 15:08
@graphieros graphieros added this pull request to the merge queue Feb 10, 2026
Merged via the queue into npmx-dev:main with commit 78e0188 Feb 10, 2026
16 checks passed
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.

Only show estimation on the last datapoint in download charts

3 participants