Skip to content

fix: only show estimation segment in last datapoint - #1338

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

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

Conversation

@graphieros

Copy link
Copy Markdown
Member

closes#1318

  • Remove falling segment for partial month / year
image

@vercel

vercelBot commented Feb 10, 2026

Copy link
Copy Markdown
Contributor

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

ProjectDeploymentActionsUpdated (UTC)
npmx.devReadyReadyPreview, CommentFeb 10, 2026 2:23pm
2 Skipped Deployments
ProjectDeploymentActionsUpdated (UTC)
docs.npmx.devIgnoredIgnoredPreviewFeb 10, 2026 2:23pm
npmx-lunariaIgnoredIgnoredFeb 10, 2026 2:23pm

Request Review

@codecov

codecovBot commented Feb 10, 2026

Copy link
Copy Markdown

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 linesPatch %Lines
app/components/Package/TrendsChart.vue68.75%3 Missing and 2 partials ⚠️

📢 Thoughts on this report? Let us know!

@coderabbitai

Copy link
Copy Markdown
Contributor
📝 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 nameStatusExplanation
Description check✅ PassedThe 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✅ PassedThe 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✅ PassedAll 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.

@coderabbitaicoderabbitaiBot left a comment

Copy link
Copy Markdown
Contributor

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,

Comment threadapp/components/Package/TrendsChart.vue
@patak-cat

Copy link
Copy Markdown
Contributor

Looks amazing! at least from a functionality POV

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

Only show estimation on the last datapoint in download charts

3 participants

@graphieros@patak-cat@danielroe