Skip to content

fix: hide scroll-to-top button on non-mobile devices#1735

Open
RYGRIT wants to merge 1 commit intonpmx-dev:mainfrom
RYGRIT:fix/package-scroll-to-top
Open

fix: hide scroll-to-top button on non-mobile devices#1735
RYGRIT wants to merge 1 commit intonpmx-dev:mainfrom
RYGRIT:fix/package-scroll-to-top

Conversation

@RYGRIT
Copy link
Contributor

@RYGRIT RYGRIT commented Feb 28, 2026

🔗 Linked issue

🧭 Context

I've seen discussions on Discord about "Scroll to Top" buttons on tablets/desktops.

📚 Description

This PR is merely a safety measure to prevent the button from appearing where it shouldn't—you can always close this PR if you prefer the previously discussed approach.

This is a minimal fix.

  • Add an isMobile media query check

@vercel
Copy link

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

Request Review

@codecov
Copy link

codecov bot commented Feb 28, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ All tests successful. No failed tests found.

📢 Thoughts on this report? Let us know!

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 28, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 671d13a and 7769e45.

📒 Files selected for processing (1)
  • app/pages/package/[[org]]/[name].vue

📝 Walkthrough

Walkthrough

The showScrollToTop computed property in the package page component has been modified to include an additional condition. The button now requires the device to satisfy both mobile status (isMobile) and touch capability (isTouchDeviceClient) checks before displaying based on scroll position. Previously, the visibility condition only evaluated touch device capability alongside the scroll threshold.

Possibly related PRs

  • npmx-dev/npmx.dev PR 1453: Modifies the same showScrollToTop logic to gate the back-to-top button visibility by mobile and touch device checks in combination with scroll position threshold.

Suggested reviewers

  • danielroe
🚥 Pre-merge checks | ✅ 1
✅ Passed checks (1 passed)
Check name Status Explanation
Description check ✅ Passed The pull request description clearly relates to the changeset, explaining the rationale for adding an isMobile check to the showScrollToTop computed property.

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

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.

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.

1 participant