Skip to content

feat: highlight selected version#964

Merged
danielroe merged 5 commits intonpmx-dev:mainfrom
shamilkotta:feat/version-selection
Feb 11, 2026
Merged

feat: highlight selected version#964
danielroe merged 5 commits intonpmx-dev:mainfrom
shamilkotta:feat/version-selection

Conversation

@shamilkotta
Copy link
Contributor

@shamilkotta shamilkotta commented Feb 4, 2026

fixes: #924

Before:
image

After:
image

@vercel
Copy link

vercel bot commented Feb 4, 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 Feb 10, 2026 2:28pm
npmx.dev Ready Ready Preview, Comment Feb 10, 2026 2:28pm
1 Skipped Deployment
Project Deployment Actions Updated (UTC)
npmx-lunaria Ignored Ignored Feb 10, 2026 2:28pm

Request Review

@shamilkotta shamilkotta changed the title feat: Highlight selected version feat: highlight selected version Feb 4, 2026
@codecov
Copy link

codecov bot commented Feb 4, 2026

Codecov Report

❌ Patch coverage is 71.42857% with 14 lines in your changes missing coverage. Please review.
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
app/components/Package/Versions.vue 72.91% 11 Missing and 2 partials ⚠️
app/pages/package/[[org]]/[name].vue 0.00% 1 Missing ⚠️

📢 Thoughts on this report? Let us know!

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 4, 2026

📝 Walkthrough

Walkthrough

The changes add an optional selectedVersion prop to the Versions component and pass resolvedVersion ?? pkg['dist-tags']?.['latest'] from the package page. The component now computes an effective current version and introduces helper functions to detect whether visible rows, hidden rows, "Other versions" area, and major-version groups contain or claim that version. Highlighting logic was updated to use these helpers across visible tags, expanded per-tag lists, hidden rows, untagged major groups and entries. Existing async loading and error handling for versions remain unchanged.

Suggested reviewers

  • danielroe
🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description check ✅ Passed The PR description is directly related to the changeset, referencing issue #924 and showing before/after images demonstrating the version highlighting fix.
Linked Issues check ✅ Passed The code changes implement the core requirement from issue #924: the selected version is now highlighted in the Versions section instead of just the latest version.
Out of Scope Changes check ✅ Passed All changes are scoped to the version highlighting functionality described in issue #924, with modifications to Versions.vue and the parent page component to propagate the selected version.

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

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.

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
app/components/Package/Versions.vue (1)

641-644: ⚠️ Potential issue | 🟡 Minor

Remove per-button focus-visible utility classes.

Project guidance requires button focus-visible styling to be handled globally; this inline utility should be dropped.

🔧 Suggested fix
- class="w-4 h-4 flex items-center justify-center text-fg-subtle hover:text-fg transition-colors shrink-0 focus-visible:outline-accent/70 rounded-sm"
+ class="w-4 h-4 flex items-center justify-center text-fg-subtle hover:text-fg transition-colors shrink-0 rounded-sm"

Based on learnings: “focus-visible styling for buttons and selects is applied globally via main.css… Do not apply per-element inline utility classes like focus-visible:outline-accent/70.”

Copy link
Member

@danielroe danielroe left a comment

Choose a reason for hiding this comment

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

❤️

@danielroe danielroe added this pull request to the merge queue Feb 11, 2026
Merged via the queue into npmx-dev:main with commit 266c8c1 Feb 11, 2026
17 checks passed
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.

Selected package version should be highlighted in the Versions section?

2 participants