Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 23 additions & 21 deletions app/pages/package/[[org]]/[name].vue
Original file line number Diff line number Diff line change
Expand Up @@ -583,10 +583,8 @@ const showSkeleton = shallowRef(false)
<!-- Direct deps (muted) -->
<span class="text-fg-muted">{{ numberFormatter.format(dependencyCount) }}</span>

<!-- Separator and total transitive deps -->
<!-- Total transitive deps in parens -->
<template v-if="dependencyCount > 0 && dependencyCount !== totalDepsCount">
<span class="text-fg-subtle">/</span>

<ClientOnly>
<span
v-if="
Expand All @@ -595,14 +593,16 @@ const showSkeleton = shallowRef(false)
"
class="inline-flex items-center gap-1 text-fg-subtle"
>
<span class="i-svg-spinners:ring-resize w-3 h-3" aria-hidden="true" />
(<span class="i-svg-spinners:ring-resize w-3 h-3" aria-hidden="true" />)
</span>
<span v-else-if="totalDepsCount !== null">{{
numberFormatter.format(totalDepsCount)
}}</span>
<span v-else class="text-fg-subtle">-</span>
<span v-else-if="totalDepsCount !== null"
><span class="text-fg-subtle">(</span
>{{ numberFormatter.format(totalDepsCount)
}}<span class="text-fg-subtle">)</span></span
>
<span v-else class="text-fg-subtle">(-)</span>
<template #fallback>
<span class="text-fg-subtle">-</span>
<span class="text-fg-subtle">(-)</span>
</template>
</ClientOnly>
</template>
Expand Down Expand Up @@ -652,20 +652,22 @@ const showSkeleton = shallowRef(false)
<span v-else>-</span>
</span>

<!-- Separator and install size -->
<!-- Total install size in parens -->
<template v-if="displayVersion?.dist?.unpackedSize !== installSize?.totalSize">
<span class="text-fg-subtle mx-1">/</span>

<span
v-if="installSizeStatus === 'pending'"
class="inline-flex items-center gap-1 text-fg-subtle"
>
<span class="i-svg-spinners:ring-resize w-3 h-3" aria-hidden="true" />
</span>
<span v-else-if="installSize?.totalSize" dir="ltr">
{{ bytesFormatter.format(installSize.totalSize) }}
<span class="ms-1">
<span
v-if="installSizeStatus === 'pending'"
class="inline-flex items-center gap-1 text-fg-subtle"
>
(<span class="i-svg-spinners:ring-resize w-3 h-3" aria-hidden="true" />)
</span>
<span v-else-if="installSize?.totalSize" dir="ltr">
<span class="text-fg-subtle">(</span
>{{ bytesFormatter.format(installSize.totalSize)
}}<span class="text-fg-subtle">)</span>
</span>
<span v-else class="text-fg-subtle">(-)</span>
Comment on lines +664 to +669
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Handle zero-byte totals explicitly in the install-size branch.

At Line 664, v-else-if="installSize?.totalSize" treats 0 as falsy, so a valid zero total falls through to (-). Use an explicit nullish check.

Suggested fix
-                    <span v-else-if="installSize?.totalSize" dir="ltr">
+                    <span
+                      v-else-if="
+                        installSize?.totalSize !== null &&
+                        installSize?.totalSize !== undefined
+                      "
+                      dir="ltr"
+                    >
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
<span v-else-if="installSize?.totalSize" dir="ltr">
<span class="text-fg-subtle">(</span
>{{ bytesFormatter.format(installSize.totalSize)
}}<span class="text-fg-subtle">)</span>
</span>
<span v-else class="text-fg-subtle">(-)</span>
<span
v-else-if="
installSize?.totalSize !== null &&
installSize?.totalSize !== undefined
"
dir="ltr"
>
<span class="text-fg-subtle">(</span
>{{ bytesFormatter.format(installSize.totalSize)
}}<span class="text-fg-subtle">)</span>
</span>
<span v-else class="text-fg-subtle">(-)</span>

</span>
<span v-else class="text-fg-subtle">-</span>
</template>
</dd>
</div>
Expand Down
Loading