Skip to content

Conversation

@MatteoGabriele
Copy link
Contributor

@MatteoGabriele MatteoGabriele commented Feb 9, 2026

Adds query parameter handling to the package page to support a permalink for the downloads modal.
When present, the modal opens on page load and persists across refreshes.
Included parameters: granularity, start date, and end date.

Screen.Recording.2026-02-09.at.22.19.01.mov

closes #516

@vercel
Copy link

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

Request Review

@codecov
Copy link

codecov bot commented Feb 9, 2026

Codecov Report

❌ Patch coverage is 55.00000% with 9 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 47.05% 6 Missing and 3 partials ⚠️

📢 Thoughts on this report? Let us know!

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 9, 2026

📝 Walkthrough

Walkthrough

The PR extracts chart-related type definitions from component files into a centralised app/types/chart.ts module, establishing shared types for download point structures and date range fields. The DownloadAnalytics component is refactored to use these external types and switches from shallowRef-based state management to Vue's defineModel API for granularity, startDate, and endDate. WeeklyDownloadStats is updated to manage the chart modal state through route query parameters instead of local boolean flags, with new route query bindings (modal, granularity, start, end) that control the PackageDownloadAnalytics component via v-model bindings. The useCharts composable is similarly updated to import the point type definitions from the new centralised types file.

Possibly related issues

  • Convert ChartModal to a modal route #516: The PR implements route-query-driven modal state management and exposes v-model bindings on PackageDownloadAnalytics for granularity, startDate, and endDate, directly addressing the request to convert the chart modal into a modal route with query parameters.

Possibly related PRs

Suggested reviewers

  • danielroe
  • 43081j
🚥 Pre-merge checks | ✅ 1
✅ Passed checks (1 passed)
Check name Status Explanation
Description check ✅ Passed The pull request description clearly describes the changeset: adding query parameter handling for a downloads modal permalink with granularity, start/end date support.

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

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

@graphieros graphieros marked this pull request as draft February 9, 2026 22:00
@graphieros
Copy link
Contributor

graphieros commented Feb 9, 2026

This introduces a regression, the data fetched does not correspond to the expected range:

  • when loading the modal it should display 52 weeks
  • when switching to monthly, 12 months

Also, the refresh button next to the date inputs, that shows when changing the date or granularity, stays visible when used, yet it should only appear when the selection or granularity is different than the default 52 weeks

@graphieros
Copy link
Contributor

In the meantime, @serhalp has made a PR that generalizes and refactors the component. You might consider taking it from here (can't imagine the conflicts otherwise...)

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.

Convert ChartModal to a modal route

2 participants