Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 28 additions & 9 deletions app/components/Package/Versions.vue
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,14 @@ function versionRoute(version: string): RouteLocationRaw {
return packageRoute(props.packageName, version)
}

// Route to the full versions history page
const versionsPageRoute = computed((): RouteLocationRaw => {
const [org, name = ''] = props.packageName.startsWith('@')
? props.packageName.split('/')
: ['', props.packageName]
return { name: 'package-versions', params: { org, name } }
})

// Version to tags lookup (supports multiple tags per version)
const versionToTags = computed(() => buildVersionToTagsMap(props.distTags))

Expand Down Expand Up @@ -532,15 +540,26 @@ function majorGroupContainsCurrent(group: (typeof otherMajorGroups.value)[0]): b
id="versions"
>
<template #actions>
<ButtonBase
variant="secondary"
class="text-fg-subtle hover:text-fg transition-colors min-w-6 min-h-6 -m-1 p-1 rounded"
:title="$t('package.downloads.community_distribution')"
classicon="i-lucide:file-stack"
@click="openDistributionModal"
>
<span class="sr-only">{{ $t('package.downloads.community_distribution') }}</span>
</ButtonBase>
<div class="flex items-center gap-3">
<LinkBase
:to="versionsPageRoute"
variant="button-secondary"
class="text-fg-subtle hover:text-fg transition-colors min-w-6 min-h-6 p-1 rounded"
title="View all versions"
classicon="i-lucide:history"
>
<span class="sr-only">View all versions</span>
</LinkBase>
<ButtonBase
variant="secondary"
class="text-fg-subtle hover:text-fg transition-colors min-w-6 min-h-6 -m-1 p-1 rounded"
:title="$t('package.downloads.community_distribution')"
classicon="i-lucide:file-stack"
@click="openDistributionModal"
>
<span class="sr-only">{{ $t('package.downloads.community_distribution') }}</span>
</ButtonBase>
</div>
</template>
<div class="space-y-0.5 min-w-0">
<!-- Semver range filter -->
Expand Down
6 changes: 4 additions & 2 deletions app/pages/package/[[org]]/[name].vue
Original file line number Diff line number Diff line change
Expand Up @@ -272,6 +272,7 @@ const { diff: sizeDiff } = useInstallSizeDiff(packageName, resolvedVersion, pkg,
// → Preserve the server-rendered DOM, don't flash to skeleton.
const nuxtApp = useNuxtApp()
const route = useRoute()
const isVersionsRoute = computed(() => route.name === 'package-versions')
const hasEmptyPayload =
import.meta.client &&
nuxtApp.payload.serverRendered &&
Expand Down Expand Up @@ -736,7 +737,8 @@ const showSkeleton = shallowRef(false)
</script>

<template>
<DevOnly>
<NuxtPage v-if="isVersionsRoute" />
<DevOnly v-else>
<ButtonBase
class="fixed bottom-4 inset-is-4 z-50 shadow-lg rounded-full! px-3! py-2!"
classicon="i-simple-icons:skeleton"
Expand All @@ -748,7 +750,7 @@ const showSkeleton = shallowRef(false)
<span class="text-xs">Skeleton</span>
</ButtonBase>
</DevOnly>
<main class="container flex-1 w-full py-8">
<main v-if="!isVersionsRoute" class="container flex-1 w-full py-8">
<!-- Scenario 1: SPA fallback — show skeleton (no real content to preserve) -->
<!-- Scenario 2: SSR with missing payload — preserve server DOM, skip skeleton -->
<PackageSkeleton
Expand Down
Loading
Loading