@@ -193,6 +193,14 @@ const hasDependencies = computed(() => {
193193// Vulnerability count for the stats banner
194194const vulnCount = computed (() => vulnTree .value ?.totalCounts .total ?? 0 )
195195const hasVulnerabilities = computed (() => vulnCount .value > 0 )
196+ const hasDeprecated = computed (
197+ () => vulnTree .value ?.deprecatedPackages && vulnTree .value .deprecatedPackages .length > 0 ,
198+ )
199+
200+ // Check if vulns area should be shown
201+ const showVulnsArea = computed (() => {
202+ return moduleReplacement .value || hasVulnerabilities .value || hasDeprecated .value
203+ })
196204
197205// Total transitive dependencies count (from either vuln tree or install size)
198206// Subtract 1 to exclude the root package itself
@@ -409,7 +417,11 @@ function handleClick(event: MouseEvent) {
409417 <main class =" container flex-1 w-full py-8" >
410418 <PackageSkeleton v-if =" status === 'pending'" />
411419
412- <article v-else-if =" status === 'success' && pkg" class =" package-page" >
420+ <article
421+ v-else-if =" status === 'success' && pkg"
422+ class =" package-page"
423+ :class =" { 'hide-vulns': !showVulnsArea }"
424+ >
413425 <!-- Package header -->
414426 <header
415427 class =" area-header sticky top-14 z-1 bg-[--bg] py-2 border-border"
@@ -949,7 +961,7 @@ function handleClick(event: MouseEvent) {
949961 <h2 id =" readme-heading" class =" group text-xs text-fg-subtle uppercase tracking-wider mb-4" >
950962 <a
951963 href =" #readme"
952- class =" inline-flex py-4 px-2 items-center gap-1.5 text-fg-subtle hover:text-fg-muted transition-colors duration-200 no-underline"
964+ class =" inline-flex py-1 px-2 items-center gap-1.5 text-fg-subtle hover:text-fg-muted transition-colors duration-200 no-underline"
953965 >
954966 {{ $t('package.readme.title') }}
955967 <span
@@ -1157,6 +1169,43 @@ function handleClick(event: MouseEvent) {
11571169 }
11581170}
11591171
1172+ /* Hide vulns area when empty - mobile */
1173+ .package-page.hide-vulns {
1174+ grid-template-areas :
1175+ ' header'
1176+ ' details'
1177+ ' install'
1178+ ' sidebar'
1179+ ' readme' ;
1180+ }
1181+
1182+ .package-page.hide-vulns .area-vulns {
1183+ display : none ;
1184+ }
1185+
1186+ /* Hide vulns area when empty - tablet */
1187+ @media (min-width : 1024px ) {
1188+ .package-page.hide-vulns {
1189+ grid-template-areas :
1190+ ' header header'
1191+ ' details details'
1192+ ' install install'
1193+ ' readme sidebar' ;
1194+ grid-template-rows : auto auto auto 1fr ;
1195+ }
1196+ }
1197+
1198+ /* Hide vulns area when empty - desktop */
1199+ @media (min-width : 1280px ) {
1200+ .package-page.hide-vulns {
1201+ grid-template-areas :
1202+ ' header sidebar'
1203+ ' details sidebar'
1204+ ' install sidebar'
1205+ ' readme sidebar' ;
1206+ }
1207+ }
1208+
11601209.area-header {
11611210 grid-area : header;
11621211}
0 commit comments