@@ -16,6 +16,9 @@ const props = defineProps<{
1616 time: Record <string , string >
1717}>()
1818
19+ /** Maximum number of dist-tag rows to show before collapsing into "Other versions" */
20+ const MAX_VISIBLE_TAGS = 10
21+
1922/** A version with its metadata */
2023interface VersionDisplay {
2124 version: string
@@ -42,9 +45,9 @@ function versionRoute(version: string): RouteLocationRaw {
4245// Version to tags lookup (supports multiple tags per version)
4346const versionToTags = computed (() => buildVersionToTagsMap (props .distTags ))
4447
45- // Initial tag rows derived from props (SSR-safe)
48+ // All tag rows derived from props (SSR-safe)
4649// Deduplicates so each version appears only once, with all its tags
47- const initialTagRows = computed (() => {
50+ const allTagRows = computed (() => {
4851 // Group tags by version with their metadata
4952 const versionMap = new Map <
5053 string ,
@@ -87,6 +90,12 @@ const initialTagRows = computed(() => {
8790 .sort ((a , b ) => compareVersions (b .primaryVersion .version , a .primaryVersion .version ))
8891})
8992
93+ // Visible tag rows (limited to MAX_VISIBLE_TAGS)
94+ const visibleTagRows = computed (() => allTagRows .value .slice (0 , MAX_VISIBLE_TAGS ))
95+
96+ // Hidden tag rows (overflow beyond MAX_VISIBLE_TAGS) - shown in "Other versions"
97+ const hiddenTagRows = computed (() => allTagRows .value .slice (MAX_VISIBLE_TAGS ))
98+
9099// Client-side state for expansion and loaded versions
91100const expandedTags = ref <Set <string >>(new Set ())
92101const tagVersions = ref <Map <string , VersionDisplay []>>(new Map ())
@@ -159,7 +168,7 @@ function processLoadedVersions(allVersions: PackageVersionInfo[]) {
159168 // For each tag, find versions in its channel (same major + same prerelease channel)
160169 const claimedVersions = new Set <string >()
161170
162- for (const row of initialTagRows .value ) {
171+ for (const row of allTagRows .value ) {
163172 const tagVersion = distTags [row .tag ]
164173 if (! tagVersion ) continue
165174
@@ -292,14 +301,14 @@ function formatDate(dateStr: string): string {
292301 </script >
293302
294303<template >
295- <section v-if =" initialTagRows .length > 0" aria-labelledby =" versions-heading" >
304+ <section v-if =" allTagRows .length > 0" aria-labelledby =" versions-heading" class = " overflow-hidden " >
296305 <h2 id =" versions-heading" class =" text-xs text-fg-subtle uppercase tracking-wider mb-3" >
297306 Versions
298307 </h2 >
299308
300- <div class =" space-y-0.5" >
301- <!-- Dist-tag rows -->
302- <div v-for =" row in initialTagRows " :key =" row.id" >
309+ <div class =" space-y-0.5 min-w-0 " >
310+ <!-- Dist-tag rows (limited to MAX_VISIBLE_TAGS) -->
311+ <div v-for =" row in visibleTagRows " :key =" row.id" >
303312 <div class =" flex items-center gap-2" >
304313 <!-- Expand button (only if there are more versions to show) -->
305314 <button
@@ -327,6 +336,7 @@ function formatDate(dateStr: string): string {
327336 <NuxtLink
328337 :to =" versionRoute(row.primaryVersion.version)"
329338 class =" font-mono text-sm text-fg-muted hover:text-fg transition-colors duration-200 truncate"
339+ :title =" row.primaryVersion.version"
330340 >
331341 {{ row.primaryVersion.version }}
332342 </NuxtLink >
@@ -346,11 +356,12 @@ function formatDate(dateStr: string): string {
346356 />
347357 </div >
348358 </div >
349- <div v-if =" row.tags.length" class =" flex items-center gap-1 mt-0.5" >
359+ <div v-if =" row.tags.length" class =" flex items-center gap-1 mt-0.5 flex-wrap " >
350360 <span
351361 v-for =" tag in row.tags"
352362 :key =" tag"
353- class =" text-[9px] font-semibold text-fg-subtle uppercase tracking-wide"
363+ class =" text-[9px] font-semibold text-fg-subtle uppercase tracking-wide truncate max-w-[150px]"
364+ :title =" tag"
354365 >
355366 {{ tag }}
356367 </span >
@@ -368,6 +379,7 @@ function formatDate(dateStr: string): string {
368379 <NuxtLink
369380 :to =" versionRoute(v.version)"
370381 class =" font-mono text-xs text-fg-subtle hover:text-fg-muted transition-colors duration-200 truncate"
382+ :title =" v.version"
371383 >
372384 {{ v.version }}
373385 </NuxtLink >
@@ -390,7 +402,8 @@ function formatDate(dateStr: string): string {
390402 <span
391403 v-for =" tag in filterExcludedTags(v.tags, row.tags)"
392404 :key =" tag"
393- class =" text-[8px] font-semibold text-fg-subtle uppercase tracking-wide"
405+ class =" text-[8px] font-semibold text-fg-subtle uppercase tracking-wide truncate max-w-[120px]"
406+ :title =" tag"
394407 >
395408 {{ tag }}
396409 </span >
@@ -417,11 +430,49 @@ function formatDate(dateStr: string): string {
417430 :class =" otherVersionsExpanded ? 'i-carbon-chevron-down' : 'i-carbon-chevron-right'"
418431 />
419432 </span >
420- <span class =" text-xs text-fg-muted py-1.5" > Other versions </span >
433+ <span class =" text-xs text-fg-muted py-1.5" >
434+ Other versions
435+ <span v-if =" hiddenTagRows.length > 0" class =" text-fg-subtle" >
436+ ({{ hiddenTagRows.length }} more tagged)
437+ </span >
438+ </span >
421439 </button >
422440
423441 <!-- Expanded other versions -->
424442 <div v-if =" otherVersionsExpanded" class =" ml-4 pl-2 border-l border-border space-y-0.5" >
443+ <!-- Hidden tag rows (overflow from visible tags) -->
444+ <div v-for =" row in hiddenTagRows" :key =" row.id" class =" py-1" >
445+ <div class =" flex items-center justify-between gap-2" >
446+ <NuxtLink
447+ :to =" versionRoute(row.primaryVersion.version)"
448+ class =" font-mono text-xs text-fg-muted hover:text-fg transition-colors duration-200 truncate"
449+ :title =" row.primaryVersion.version"
450+ >
451+ {{ row.primaryVersion.version }}
452+ </NuxtLink >
453+ <div class =" flex items-center gap-2 shrink-0" >
454+ <time
455+ v-if =" row.primaryVersion.time"
456+ :datetime =" row.primaryVersion.time"
457+ class =" text-[10px] text-fg-subtle"
458+ >
459+ {{ formatDate(row.primaryVersion.time) }}
460+ </time >
461+ </div >
462+ </div >
463+ <div v-if =" row.tags.length" class =" flex items-center gap-1 mt-0.5 flex-wrap" >
464+ <span
465+ v-for =" tag in row.tags"
466+ :key =" tag"
467+ class =" text-[8px] font-semibold text-fg-subtle uppercase tracking-wide truncate max-w-[120px]"
468+ :title =" tag"
469+ >
470+ {{ tag }}
471+ </span >
472+ </div >
473+ </div >
474+
475+ <!-- Major version groups (untagged versions) -->
425476 <template v-if =" otherMajorGroups .length > 0 " >
426477 <div v-for =" (group, groupIndex) in otherMajorGroups" :key =" group.major" >
427478 <!-- Major group header -->
@@ -430,22 +481,27 @@ function formatDate(dateStr: string): string {
430481 type =" button"
431482 class =" w-full text-left py-1"
432483 :aria-expanded =" group.expanded"
484+ :title =" group.versions[0]?.version"
433485 @click =" toggleMajorGroup(groupIndex)"
434486 >
435487 <div class =" flex items-center gap-2" >
436488 <span
437489 class =" w-3 h-3 transition-transform duration-200 text-fg-subtle"
438490 :class =" group.expanded ? 'i-carbon-chevron-down' : 'i-carbon-chevron-right'"
439491 />
440- <span class =" font-mono text-xs text-fg-muted" >
492+ <span class =" font-mono text-xs text-fg-muted truncate " >
441493 {{ group.versions[0]?.version }}
442494 </span >
443495 </div >
444- <div v-if =" group.versions[0]?.tags?.length" class =" flex items-center gap-1 ml-5" >
496+ <div
497+ v-if =" group.versions[0]?.tags?.length"
498+ class =" flex items-center gap-1 ml-5 flex-wrap"
499+ >
445500 <span
446501 v-for =" tag in group.versions[0].tags"
447502 :key =" tag"
448- class =" text-[8px] font-semibold text-fg-subtle uppercase tracking-wide"
503+ class =" text-[8px] font-semibold text-fg-subtle uppercase tracking-wide truncate max-w-[120px]"
504+ :title =" tag"
449505 >
450506 {{ tag }}
451507 </span >
@@ -458,7 +514,8 @@ function formatDate(dateStr: string): string {
458514 <NuxtLink
459515 v-if =" group.versions[0]"
460516 :to =" versionRoute(group.versions[0].version)"
461- class =" font-mono text-xs text-fg-muted hover:text-fg transition-colors duration-200"
517+ class =" font-mono text-xs text-fg-muted hover:text-fg transition-colors duration-200 truncate"
518+ :title =" group.versions[0].version"
462519 >
463520 {{ group.versions[0].version }}
464521 </NuxtLink >
@@ -481,6 +538,7 @@ function formatDate(dateStr: string): string {
481538 <NuxtLink
482539 :to =" versionRoute(v.version)"
483540 class =" font-mono text-xs text-fg-subtle hover:text-fg-muted transition-colors duration-200 truncate"
541+ :title =" v.version"
484542 >
485543 {{ v.version }}
486544 </NuxtLink >
@@ -509,7 +567,10 @@ function formatDate(dateStr: string): string {
509567 </div >
510568 </div >
511569 </template >
512- <div v-else-if =" hasLoadedAll" class =" py-1 text-xs text-fg-subtle" >
570+ <div
571+ v-else-if =" hasLoadedAll && hiddenTagRows.length === 0"
572+ class =" py-1 text-xs text-fg-subtle"
573+ >
513574 All versions are covered by tags above
514575 </div >
515576 </div >
0 commit comments