File tree Expand file tree Collapse file tree 3 files changed +10
-9
lines changed
Expand file tree Collapse file tree 3 files changed +10
-9
lines changed Original file line number Diff line number Diff 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)
107102const versionToTags = computed (() => buildVersionToTagsMap (props .distTags ))
Original file line number Diff line number Diff 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 >
Original file line number Diff line number Diff 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+
3238export function diffRoute (
3339 packageName : string ,
3440 fromVersion : string ,
You can’t perform that action at this time.
0 commit comments