Skip to content

Commit a3af797

Browse files
committed
fix(ui): respect semver filter when showing latest tag
The 'latest' tag was unconditionally added to visible results even when it didn't match the active semver filter. This caused versions like 7.6.0 to appear when filtering by ranges like '^7.5 <7.6'. Remove the special case handling for the 'latest' tag and let it flow naturally through the filtering logic. This makes the behavior more predictable and fixes the bug where non-matching versions were displayed.
1 parent 5324b96 commit a3af797

File tree

3 files changed

+826
-552
lines changed

3 files changed

+826
-552
lines changed

app/components/Package/Versions.vue

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -210,14 +210,7 @@ const visibleTagRows = computed(() => {
210210
getTagVersions(row.tag).some(v => filteredVersionSet.value.has(v.version)),
211211
)
212212
: rowsMaybeFilteredForDeprecation
213-
const first = rows.slice(0, MAX_VISIBLE_TAGS)
214-
const latestTagRow = rows.find(row => row.tag === 'latest')
215-
// Ensure 'latest' tag is always included (at the end) if not already present
216-
if (latestTagRow && !first.includes(latestTagRow)) {
217-
first.pop()
218-
first.push(latestTagRow)
219-
}
220-
return first
213+
return rows.slice(0, MAX_VISIBLE_TAGS)
221214
})
222215
223216
// Hidden tag rows (all other tags) - shown in "Other versions"

0 commit comments

Comments
 (0)