Skip to content

Commit e86aaf2

Browse files
committed
Ensure latest tag always shows in visible rows
1 parent 80d7f0c commit e86aaf2

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

app/components/PackageVersions.vue

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,14 @@ const visibleTagRows = computed(() => {
109109
const rows = isPackageDeprecated.value
110110
? allTagRows.value
111111
: allTagRows.value.filter(row => !row.primaryVersion.deprecated)
112-
return rows.slice(0, MAX_VISIBLE_TAGS)
112+
const first = rows.slice(0, MAX_VISIBLE_TAGS)
113+
const latestTagRow = rows.find(row => row.tag === 'latest')
114+
// Ensure 'latest' tag is always included (at the end) if not already present
115+
if (latestTagRow && !first.includes(latestTagRow)) {
116+
first.pop()
117+
first.push(latestTagRow)
118+
}
119+
return first
113120
})
114121
115122
// Hidden tag rows (all other tags) - shown in "Other versions"

0 commit comments

Comments
 (0)