@@ -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/less 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,7 +188,7 @@ 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 >
@@ -214,6 +229,20 @@ watch(
214229 </li >
215230 </ul >
216231
232+ <!-- Show more/less toggle (only when not managing and there are hidden maintainers) -->
233+ <button
234+ v-if =" !canManageOwners && hiddenMaintainersCount > 0"
235+ type =" button"
236+ 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"
237+ @click =" showAllMaintainers = !showAllMaintainers"
238+ >
239+ {{
240+ showAllMaintainers
241+ ? $t('package.maintainers.show_less')
242+ : $t('package.maintainers.show_more', { count: hiddenMaintainersCount })
243+ }}
244+ </button >
245+
217246 <!-- Add owner form (only when can manage) -->
218247 <div v-if =" canManageOwners" class =" mt-3" >
219248 <div v-if =" showAddOwner" >
0 commit comments