Skip to content

fix(ui): hide awkward empty state for weekly downloads for new packages#1054

Open
wojtekmaj wants to merge 3 commits intonpmx-dev:mainfrom
wojtekmaj:empty-weekly-downloads
Open

fix(ui): hide awkward empty state for weekly downloads for new packages#1054
wojtekmaj wants to merge 3 commits intonpmx-dev:mainfrom
wojtekmaj:empty-weekly-downloads

Conversation

@wojtekmaj
Copy link
Contributor

Closes #1044

Too new packages now have Weekly downloads hidden:

image

Well established packages of course still have the section:

image

Copilot AI review requested due to automatic review settings February 5, 2026 22:46
@vercel
Copy link

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

Request Review

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 5, 2026

Warning

Rate limit exceeded

@wojtekmaj has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 3 minutes and 5 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

✨ 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.

@codecov
Copy link

codecov bot commented Feb 5, 2026

Codecov Report

❌ Patch coverage is 50.00000% with 7 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 50.00% 5 Missing and 2 partials ⚠️

📢 Thoughts on this report? Let us know!

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR fixes the awkward empty state for weekly downloads on new packages by conditionally hiding the entire downloads section when no data is available. The implementation adds loading state tracking and data presence checks to determine when to show or hide the section, following the pattern used by npmjs.com.

Changes:

  • Added computed property to check if weekly downloads data exists
  • Added loading state to track data fetch progress
  • Conditionally render the downloads section based on loading state or data presence
  • Guard modal opening and button visibility with data presence checks

@serhalp
Copy link
Collaborator

serhalp commented Feb 6, 2026

My hunch is it's more confusing to hide this entirely. We might get future bug reports like "the downloads chart is missing". Could we keep just the heading and show "No downloads yet"? 🤔

@wojtekmaj
Copy link
Contributor Author

My hunch is it's more confusing to hide this entirely. We might get future bug reports like "the downloads chart is missing". Could we keep just the heading and show "No downloads yet"? 🤔

Good idea, I'll do this today

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.

Awkward empty state for weekly downloads section

2 participants