You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When expanding a dist-tag row, versions newer than the dist-tag version could be silently dropped when the dist-tag does not point to the latest version in its major.
📚 Description
Taking @types/node as an example, ts5.1 -> 24.1.0, but the latest 24.x is 24.11.0.
channelVersions is sorted by semver descending, so [0] is always the newest version in the channel, not the dist-tag version:
tagVersions['ts5.1'] = [
{ version: '24.11.0' }, // newest, but NOT the dist-tag version
{ version: '24.10.15' },
...
{ version: '24.1.0' }, // actual dist-tag version, shown in row header
]
The old code used .slice(1) to exclude the primary version from the expanded list, assuming [0] was always the primary version. This assumption only holds when the dist-tag points to the latest version in its major.
The fix replaces getFilteredTagVersions + .slice(1) with getExpandedTagVersions, which filters out the primary version by version string match instead of by array position.
The pull request updates the app/components/Package/Versions.vue component by replacing the getFilteredTagVersions() helper function with a new getExpandedTagVersions() function. The new function accepts an additional primaryVersion parameter and filters out the primary version from the tag's version list before applying any active semver filters. All call sites have been updated to pass the row's primary version to this function, ensuring consistent version filtering behaviour across the component.
The code changes directly address the primary requirement in #1789 by excluding the primary version via version-string matching rather than array position.
Out of Scope Changes check
✅ Passed
All changes are scoped to the Versions.vue component and directly address the version-filtering issue described in the linked issue.
Description check
✅ Passed
The description is directly related to the changeset, explaining the bug fix and its rationale with concrete examples.
✏️ 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.
maxchang3
changed the title
fix(versions): correctly exclude primary version from expanded tag list
fix: correctly exclude primary version from expanded tag list
Mar 1, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🔗 Linked issue
Resolves #1789
🧭 Context
When expanding a dist-tag row, versions newer than the dist-tag version could be silently dropped when the dist-tag does not point to the latest version in its major.
📚 Description
Taking
@types/nodeas an example,ts5.1 -> 24.1.0, but the latest24.xis24.11.0.channelVersionsis sorted by semver descending, so[0]is always the newest version in the channel, not the dist-tag version:The old code used
.slice(1)to exclude the primary version from the expanded list, assuming[0]was always the primary version. This assumption only holds when the dist-tag points to the latest version in its major.The fix replaces
getFilteredTagVersions+.slice(1)withgetExpandedTagVersions, which filters out the primary version by version string match instead of by array position.