Skip to content

Commit c00e97c

Browse files
committed
fix(ui): View all x versions button redirect to Version History
1 parent 5aff68f commit c00e97c

File tree

3 files changed

+10
-9
lines changed

3 files changed

+10
-9
lines changed

app/components/Package/Versions.vue

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -96,12 +96,7 @@ function versionRoute(version: string): RouteLocationRaw {
9696
}
9797
9898
// Route to the full versions history page
99-
const versionsPageRoute = computed((): RouteLocationRaw => {
100-
const [org, name = ''] = props.packageName.startsWith('@')
101-
? props.packageName.split('/')
102-
: ['', props.packageName]
103-
return { name: 'package-versions', params: { org, name } }
104-
})
99+
const versionsPageRoute = computed(() => packageVersionsRoute(props.packageName))
105100
106101
// Version to tags lookup (supports multiple tags per version)
107102
const versionToTags = computed(() => buildVersionToTagsMap(props.distTags))

app/components/VersionSelector.vue

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -401,7 +401,7 @@ function handleListboxKeydown(event: KeyboardEvent) {
401401
const item = items[focusedIndex.value]
402402
if (item?.type === 'group') {
403403
const group = versionGroups.value.find(g => g.id === item.groupId)
404-
if (group && !group.isExpanded && group.versions.length > 1) {
404+
if (group && !group.isExpanded && (group.versions.length > 1 || !hasLoadedAll.value)) {
405405
toggleGroup(item.groupId)
406406
}
407407
}
@@ -539,7 +539,7 @@ watch(
539539
>
540540
<!-- Expand button -->
541541
<button
542-
v-if="group.versions.length > 1 || !hasLoadedAll"
542+
v-if="group.isExpanded || group.versions.length > 1 || !hasLoadedAll"
543543
type="button"
544544
class="w-4 h-4 flex items-center justify-center text-fg-subtle hover:text-fg transition-colors shrink-0"
545545
:aria-expanded="group.isExpanded"
@@ -626,7 +626,7 @@ watch(
626626
<!-- Link to package page for full version list -->
627627
<div class="border-t border-border mt-1 pt-1 px-3 py-2">
628628
<NuxtLink
629-
:to="packageRoute(packageName)"
629+
:to="packageVersionsRoute(packageName)"
630630
class="text-xs text-fg-subtle hover:text-fg transition-[color] focus-visible:outline-none focus-visible:text-fg"
631631
@click="isOpen = false"
632632
>

app/utils/router.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,12 @@ export function packageRoute(
2929
}
3030
}
3131

32+
/** Full version history page (`/package/.../versions`) */
33+
export function packageVersionsRoute(packageName: string): RouteLocationRaw {
34+
const [org, name = ''] = packageName.startsWith('@') ? packageName.split('/') : ['', packageName]
35+
return { name: 'package-versions', params: { org, name } }
36+
}
37+
3238
export function diffRoute(
3339
packageName: string,
3440
fromVersion: string,

0 commit comments

Comments
 (0)