Skip to content

Commit 024bcdd

Browse files
committed
fix: try to squeeze 'compare to' somewhere better
1 parent 183c42e commit 024bcdd

3 files changed

Lines changed: 57 additions & 59 deletions

File tree

app/pages/[...package].vue

Lines changed: 55 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -508,6 +508,60 @@ function handleClick(event: MouseEvent) {
508508
<!-- Package header -->
509509
<header class="area-header border-b border-border">
510510
<div class="mb-4">
511+
<!-- Internal navigation: Docs + Code + Compare (hidden on mobile, shown in external links instead) -->
512+
<nav
513+
v-if="displayVersion"
514+
:aria-label="$t('package.navigation')"
515+
class="hidden sm:flex items-center gap-1 p-0.5 bg-bg-subtle border border-border-subtle rounded-md w-fit mb-3 ms-auto"
516+
>
517+
<NuxtLink
518+
v-if="docsLink"
519+
:to="docsLink"
520+
class="px-2 py-1.5 font-mono text-xs rounded transition-colors duration-150 border border-transparent text-fg-subtle hover:text-fg hover:bg-bg hover:shadow hover:border-border focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-fg/50 inline-flex items-center gap-1.5"
521+
aria-keyshortcuts="d"
522+
>
523+
<span class="i-carbon:document w-3 h-3" aria-hidden="true" />
524+
{{ $t('package.links.docs') }}
525+
<kbd
526+
class="inline-flex items-center justify-center w-4 h-4 text-xs bg-bg-muted border border-border rounded"
527+
aria-hidden="true"
528+
>
529+
d
530+
</kbd>
531+
</NuxtLink>
532+
<NuxtLink
533+
:to="{
534+
name: 'code',
535+
params: { path: [...pkg.name.split('/'), 'v', displayVersion.version] },
536+
}"
537+
class="px-2 py-1.5 font-mono text-xs rounded transition-colors duration-150 border border-transparent text-fg-subtle hover:text-fg hover:bg-bg hover:shadow hover:border-border focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-fg/50 inline-flex items-center gap-1.5"
538+
aria-keyshortcuts="."
539+
>
540+
<span class="i-carbon:code w-3 h-3" aria-hidden="true" />
541+
{{ $t('package.links.code') }}
542+
<kbd
543+
class="inline-flex items-center justify-center w-4 h-4 text-xs bg-bg-muted border border-border rounded"
544+
aria-hidden="true"
545+
>
546+
.
547+
</kbd>
548+
</NuxtLink>
549+
<NuxtLink
550+
:to="{ path: '/compare', query: { packages: pkg.name } }"
551+
class="px-2 py-1.5 font-mono text-xs rounded transition-colors duration-150 border border-transparent text-fg-subtle hover:text-fg hover:bg-bg hover:shadow hover:border-border focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-fg/50 inline-flex items-center gap-1.5"
552+
aria-keyshortcuts="c"
553+
>
554+
<span class="i-carbon-compare w-3 h-3" aria-hidden="true" />
555+
{{ $t('package.links.compare') }}
556+
<kbd
557+
class="inline-flex items-center justify-center w-4 h-4 text-xs bg-bg-muted border border-border rounded"
558+
aria-hidden="true"
559+
>
560+
c
561+
</kbd>
562+
</NuxtLink>
563+
</nav>
564+
511565
<!-- Package name and version -->
512566
<div class="flex items-baseline gap-2 mb-1.5 sm:gap-3 sm:mb-2 flex-wrap min-w-0">
513567
<h1
@@ -579,60 +633,6 @@ function handleClick(event: MouseEvent) {
579633
</ul>
580634
</template>
581635
</ClientOnly>
582-
583-
<!-- Internal navigation: Docs + Code (hidden on mobile, shown in external links instead) -->
584-
<nav
585-
v-if="displayVersion"
586-
:aria-label="$t('package.navigation')"
587-
class="hidden sm:flex items-center gap-1 p-0.5 bg-bg-subtle border border-border-subtle rounded-md shrink-0 ms-auto self-center"
588-
>
589-
<NuxtLink
590-
v-if="docsLink"
591-
:to="docsLink"
592-
class="px-2 py-1.5 font-mono text-xs rounded transition-colors duration-150 border border-transparent text-fg-subtle hover:text-fg hover:bg-bg hover:shadow hover:border-border focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-fg/50 inline-flex items-center gap-1.5"
593-
aria-keyshortcuts="d"
594-
>
595-
<span class="i-carbon:document w-3 h-3" aria-hidden="true" />
596-
{{ $t('package.links.docs') }}
597-
<kbd
598-
class="inline-flex items-center justify-center w-4 h-4 text-xs bg-bg-muted border border-border rounded"
599-
aria-hidden="true"
600-
>
601-
d
602-
</kbd>
603-
</NuxtLink>
604-
<NuxtLink
605-
:to="{
606-
name: 'code',
607-
params: { path: [...pkg.name.split('/'), 'v', displayVersion.version] },
608-
}"
609-
class="px-2 py-1.5 font-mono text-xs rounded transition-colors duration-150 border border-transparent text-fg-subtle hover:text-fg hover:bg-bg hover:shadow hover:border-border focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-fg/50 inline-flex items-center gap-1.5"
610-
aria-keyshortcuts="."
611-
>
612-
<span class="i-carbon:code w-3 h-3" aria-hidden="true" />
613-
{{ $t('package.links.code') }}
614-
<kbd
615-
class="inline-flex items-center justify-center w-4 h-4 text-xs bg-bg-muted border border-border rounded"
616-
aria-hidden="true"
617-
>
618-
.
619-
</kbd>
620-
</NuxtLink>
621-
<NuxtLink
622-
:to="{ path: '/compare', query: { packages: pkg.name } }"
623-
class="px-2 py-1.5 font-mono text-xs rounded transition-colors duration-150 border border-transparent text-fg-subtle hover:text-fg hover:bg-bg hover:shadow hover:border-border focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-fg/50 inline-flex items-center gap-1.5"
624-
aria-keyshortcuts="c"
625-
>
626-
<span class="i-carbon-compare w-3 h-3" aria-hidden="true" />
627-
{{ $t('package.links.compare_to') }}
628-
<kbd
629-
class="inline-flex items-center justify-center w-4 h-4 text-xs bg-bg-muted border border-border rounded"
630-
aria-hidden="true"
631-
>
632-
c
633-
</kbd>
634-
</NuxtLink>
635-
</nav>
636636
</div>
637637

638638
<!-- Fixed height description container to prevent CLS -->
@@ -786,7 +786,7 @@ function handleClick(event: MouseEvent) {
786786
class="link-subtle font-mono text-sm inline-flex items-center gap-1.5"
787787
>
788788
<span class="i-carbon-compare w-4 h-4" aria-hidden="true" />
789-
{{ $t('package.links.compare_to') }}
789+
{{ $t('package.links.compare') }}
790790
</NuxtLink>
791791
</li>
792792
</ul>

i18n/locales/en.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -143,8 +143,7 @@
143143
"code": "code",
144144
"docs": "docs",
145145
"fund": "fund",
146-
"compare": "compare",
147-
"compare_to": "compare to..."
146+
"compare": "compare..."
148147
},
149148
"docs": {
150149
"not_available": "Docs not available",

i18n/locales/fr-FR.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -133,8 +133,7 @@
133133
"code": "code",
134134
"docs": "docs",
135135
"fund": "donner",
136-
"compare": "comparer",
137-
"compare_to": "comparer à..."
136+
"compare": "comparer..."
138137
},
139138
"docs": {
140139
"not_available": "Documentation non disponible",

0 commit comments

Comments
 (0)