@@ -18,10 +18,25 @@ const {
1818const showAddOwner = shallowRef (false )
1919const newOwnerUsername = shallowRef (' ' )
2020const isAdding = shallowRef (false )
21+ const showAllMaintainers = shallowRef (false )
22+
23+ const DEFAULT_VISIBLE_MAINTAINERS = 5
2124
2225// Show admin controls when connected (let npm CLI handle permission errors)
2326const canManageOwners = computed (() => isConnected .value )
2427
28+ // Computed for visible maintainers with show more/fewer support
29+ const visibleMaintainers = computed (() => {
30+ if (canManageOwners .value || showAllMaintainers .value ) {
31+ return maintainerAccess .value
32+ }
33+ return maintainerAccess .value .slice (0 , DEFAULT_VISIBLE_MAINTAINERS )
34+ })
35+
36+ const hiddenMaintainersCount = computed (() =>
37+ Math .max (0 , maintainerAccess .value .length - DEFAULT_VISIBLE_MAINTAINERS ),
38+ )
39+
2540// Extract org name from scoped package
2641const orgName = computed (() => {
2742 if (! props .packageName .startsWith (' @' )) return null
@@ -173,14 +188,17 @@ watch(
173188 </h2 >
174189 <ul class =" space-y-2 list-none m-0 p-0" :aria-label =" $t('package.maintainers.list_label')" >
175190 <li
176- v-for =" maintainer in maintainerAccess.slice(0, canManageOwners ? undefined : 5) "
191+ v-for =" maintainer in visibleMaintainers "
177192 :key =" maintainer.name ?? maintainer.email"
178193 class =" flex items-center justify-between gap-2"
179194 >
180195 <div class =" flex items-center gap-2 min-w-0" >
181196 <NuxtLink
182197 v-if =" maintainer.name"
183- :to =" { name: '~username', params: { username: maintainer.name } }"
198+ :to =" {
199+ name: '~username',
200+ params: { username: maintainer.name },
201+ }"
184202 class =" link-subtle font-mono text-sm shrink-0"
185203 >
186204 @{{ maintainer.name }}
@@ -192,7 +210,11 @@ watch(
192210 v-if =" isConnected && maintainer.accessVia?.length && !isLoadingAccess"
193211 class =" text-xs text-fg-subtle truncate"
194212 >
195- {{ $t('package.maintainers.via', { teams: maintainer.accessVia.join(', ') }) }}
213+ {{
214+ $t('package.maintainers.via', {
215+ teams: maintainer.accessVia.join(', '),
216+ })
217+ }}
196218 </span >
197219 <span
198220 v-if =" canManageOwners && maintainer.name === npmUser"
@@ -206,14 +228,34 @@ watch(
206228 v-if =" canManageOwners && maintainer.name && maintainer.name !== npmUser"
207229 type =" button"
208230 class =" p-1 text-fg-subtle hover:text-red-400 transition-colors duration-200 shrink-0 rounded focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-fg/50"
209- :aria-label =" $t('package.maintainers.remove_owner', { name: maintainer.name })"
231+ :aria-label ="
232+ $t('package.maintainers.remove_owner', {
233+ name: maintainer.name,
234+ })
235+ "
210236 @click =" handleRemoveOwner(maintainer.name)"
211237 >
212238 <span class =" i-carbon-close block w-3.5 h-3.5" aria-hidden =" true" />
213239 </button >
214240 </li >
215241 </ul >
216242
243+ <!-- Show more/less toggle (only when not managing and there are hidden maintainers) -->
244+ <button
245+ v-if =" !canManageOwners && hiddenMaintainersCount > 0"
246+ type =" button"
247+ class =" mt-2 text-xs text-fg-muted hover:text-fg transition-colors duration-200 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-fg/50 rounded"
248+ @click =" showAllMaintainers = !showAllMaintainers"
249+ >
250+ {{
251+ showAllMaintainers
252+ ? $t('package.maintainers.show_less')
253+ : $t('package.maintainers.show_more', {
254+ count: hiddenMaintainersCount,
255+ })
256+ }}
257+ </button >
258+
217259 <!-- Add owner form (only when can manage) -->
218260 <div v-if =" canManageOwners" class =" mt-3" >
219261 <div v-if =" showAddOwner" >
0 commit comments