Skip to content

feat: improve code page scroll to top#1739

Open
btea wants to merge 3 commits intonpmx-dev:mainfrom
btea:feat/improve-code-page-scroll-to-top
Open

feat: improve code page scroll to top#1739
btea wants to merge 3 commits intonpmx-dev:mainfrom
btea:feat/improve-code-page-scroll-to-top

Conversation

@btea
Copy link
Contributor

@btea btea commented Feb 28, 2026

🔗 Linked issue

/

🧭 Context

improve #1686

📚 Description

npmx

@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)
docs.npmx.dev Ready Ready Preview, Comment Mar 9, 2026 1:55am
npmx.dev Ready Ready Preview, Comment Mar 9, 2026 1:55am
1 Skipped Deployment
Project Deployment Actions Updated (UTC)
npmx-lunaria Ignored Ignored Mar 9, 2026 1:55am

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
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 0dfb6431-e78a-466d-b71d-9951da7b0ea5

📥 Commits

Reviewing files that changed from the base of the PR and between 230cbaa and 03d6e37.

📒 Files selected for processing (1)
  • app/pages/package-code/[[org]]/[packageName]/v/[version]/[...filePath].vue
🚧 Files skipped from review as they are similar to previous changes (1)
  • app/pages/package-code/[[org]]/[packageName]/v/[version]/[...filePath].vue

📝 Walkthrough

Walkthrough

This change updates the package code preview Vue component to make the "Scroll to Top" button visible only after the vertical scroll exceeds SCROLL_TO_TOP_THRESHOLD. It derives visibility from a reactive isVisible computed based on y from useScroll(contentContainer). The button is conditionally rendered with v-if="isVisible", and touch devices are detected via isTouchDeviceClient to hide the button and suppress its label. No public API or exported signatures were changed.

Possibly related PRs

Suggested reviewers

  • danielroe
🚥 Pre-merge checks | ✅ 1
✅ Passed checks (1 passed)
Check name Status Explanation
Description check ✅ Passed The PR description references issue #1686 and mentions improving scroll-to-top behaviour, which aligns with the changeset that adds scroll position-based visibility for a 'Scroll to Top' button.

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

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


ℹ️ Review info

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 8d13fe9 and 230cbaa.

📒 Files selected for processing (1)
  • app/pages/package-code/[[org]]/[packageName]/v/[version]/[...filePath].vue

@alexdln
Copy link
Member

alexdln commented Mar 8, 2026

@btea This behavior causes the interface shifts, both here and on the package page. Could you please always keep space for this button (I think using padding-right on parent container) and use only icon on mobile devices?

@btea
Copy link
Contributor Author

btea commented Mar 9, 2026

Could you please always keep space for this button (I think using padding-right on parent container)

I didn't see this part. Could you describe it in more detail?

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.

2 participants