Skip to content

Commit 71fe94d

Browse files
committed
fix: configure trailing slash for all links
1 parent 35d8b2f commit 71fe94d

24 files changed

+43
-1
lines changed

app/components/Code/DirectoryListing.vue

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,7 @@ const bytesFormatter = useBytesFormatter()
103103
>
104104
<td colspan="2">
105105
<LinkBase
106+
:trailing-slash="node.type === 'directory' ? 'append' : 'remove'"
106107
:to="getCodeRoute(node.path)"
107108
class="py-2 px-4 font-mono text-sm w-full"
108109
no-underline

app/components/Code/FileTree.vue

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,7 @@ watch(
8787
<!-- File -->
8888
<template v-else>
8989
<LinkBase
90+
trailing-slash="remove"
9091
variant="button-secondary"
9192
:to="getFileRoute(node.path)"
9293
:aria-current="currentPath === node.path"

app/components/DependencyPathPopup.vue

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,7 @@ function parsePackageString(pkg: string): { name: string; version: string } {
9393
>
9494
<span v-if="idx > 0" class="text-fg-subtle me-1">└─</span>
9595
<NuxtLink
96+
trailing-slash="append"
9697
:to="
9798
packageRoute(
9899
parsePackageString(pathItem).name,

app/components/Header/MobileMenu.client.vue

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -195,6 +195,7 @@ onUnmounted(deactivate)
195195
</span>
196196
<div>
197197
<NuxtLink
198+
trailing-slash="append"
198199
v-for="link in group.items"
199200
:key="link.name"
200201
:to="link.to"

app/components/Header/OrgsDropdown.vue

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ function handleKeydown(event: KeyboardEvent) {
5858
@keydown="handleKeydown"
5959
>
6060
<NuxtLink
61+
trailing-slash="append"
6162
:to="{ name: '~username-orgs', params: { username } }"
6263
class="link-subtle font-mono text-sm inline-flex items-center gap-1"
6364
>
@@ -94,6 +95,7 @@ function handleKeydown(event: KeyboardEvent) {
9495
<ul v-else-if="orgs.length > 0" class="py-1 max-h-80 overflow-y-auto">
9596
<li v-for="org in orgs" :key="org">
9697
<NuxtLink
98+
trailing-slash="append"
9799
:to="{ name: 'org', params: { org } }"
98100
class="block px-3 py-2 font-mono text-sm text-fg hover:bg-bg-subtle transition-colors"
99101
>
@@ -108,6 +110,7 @@ function handleKeydown(event: KeyboardEvent) {
108110

109111
<div class="px-3 py-2 border-t border-border">
110112
<NuxtLink
113+
trailing-slash="append"
111114
:to="{ name: '~username-orgs', params: { username } }"
112115
class="link-subtle font-mono text-xs inline-flex items-center gap-1"
113116
>

app/components/Header/PackagesDropdown.vue

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ function handleKeydown(event: KeyboardEvent) {
5858
@keydown="handleKeydown"
5959
>
6060
<NuxtLink
61+
trailing-slash="append"
6162
:to="{ name: '~username', params: { username } }"
6263
class="link-subtle font-mono text-sm inline-flex items-center gap-1"
6364
>
@@ -94,6 +95,7 @@ function handleKeydown(event: KeyboardEvent) {
9495
<ul v-else-if="packages.length > 0" class="py-1 max-h-80 overflow-y-auto">
9596
<li v-for="pkg in packages" :key="pkg">
9697
<NuxtLink
98+
trailing-slash="append"
9799
:to="packageRoute(pkg)"
98100
class="block px-3 py-2 font-mono text-sm text-fg hover:bg-bg-subtle transition-colors truncate"
99101
>
@@ -108,6 +110,7 @@ function handleKeydown(event: KeyboardEvent) {
108110

109111
<div class="px-3 py-2 border-t border-border">
110112
<NuxtLink
113+
trailing-slash="append"
111114
:to="{ name: '~username', params: { username } }"
112115
class="link-subtle font-mono text-xs inline-flex items-center gap-1"
113116
>

app/components/Link/Base.vue

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,10 @@ const props = withDefaults(
3535
3636
/** should only be used for links where the context makes it very clear they are clickable. Don't just use this, because you don't like underlines. */
3737
noUnderline?: boolean
38+
39+
trailingSlash?: 'append' | 'remove' | undefined
3840
}>(),
39-
{ variant: 'link', size: 'medium' },
41+
{ variant: 'link', size: 'medium', trailingSlash: 'append' },
4042
)
4143
4244
const isLinkExternal = computed(
@@ -74,6 +76,7 @@ const isButtonMedium = computed(() => props.size === 'medium' && !isLink.value)
7476
<NuxtLink
7577
v-bind="props"
7678
v-else
79+
:trailing-slash="trailingSlash"
7780
class="group/link gap-x-1 items-center"
7881
:class="{
7982
'flex': block,

app/components/Org/MembersPanel.vue

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -446,6 +446,7 @@ watch(lastExecutionTime, () => {
446446
<div class="flex items-center justify-between">
447447
<div class="flex items-center gap-3">
448448
<NuxtLink
449+
trailing-slash="append"
449450
:to="{ name: '~username', params: { username: member.name } }"
450451
class="font-mono text-sm text-fg hover:text-fg transition-colors duration-200"
451452
>

app/components/Org/TeamsPanel.vue

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -418,6 +418,7 @@ watch(lastExecutionTime, () => {
418418
class="flex items-center justify-start py-1 ps-2 pe-1 rounded hover:bg-bg-subtle transition-colors duration-200"
419419
>
420420
<NuxtLink
421+
trailing-slash="append"
421422
:to="{ name: '~username', params: { username: user } }"
422423
class="font-mono text-sm text-fg-muted hover:text-fg transition-colors duration-200"
423424
>

app/components/Package/Card.vue

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ const numberFormatter = useNumberFormatter()
4646
class="font-mono text-sm sm:text-base font-medium text-fg group-hover:text-fg transition-colors duration-200 min-w-0 break-all"
4747
>
4848
<NuxtLink
49+
trailing-slash="append"
4950
:to="packageRoute(result.package.name)"
5051
:prefetch-on="prefetch ? 'visibility' : 'interaction'"
5152
class="decoration-none scroll-mt-48 scroll-mb-6 after:content-[''] after:absolute after:inset-0"

0 commit comments

Comments
 (0)