fix: avoid using slash as a separator between two numbers#2087
fix: avoid using slash as a separator between two numbers#2087
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
2 Skipped Deployments
|
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
A slash between numbers implies some sort of fraction or ratio. It isn't intuitive what it means between two dependency counts and between sizes.
acd8ad6 to
6a17ce3
Compare
📝 WalkthroughWalkthroughThis PR modifies the package page component to adjust how transitive dependencies and install sizes are displayed. Instead of using a "/" separator, total counts are now wrapped in parentheses. When totals are loading, a spinner appears within the parentheses. If data is unavailable, a dash wrapped in parentheses displays instead. These formatting changes apply to both the transitive dependencies section and the install size section. Possibly related PRs
Suggested reviewers
🚥 Pre-merge checks | ✅ 1✅ Passed checks (1 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
📝 Coding Plan
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: a8dfb435-eb76-40e1-903f-47aac8143612
📒 Files selected for processing (1)
app/pages/package/[[org]]/[name].vue
| <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> |
There was a problem hiding this comment.
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.
| <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> |
🔗 Linked issue
N/A
🧭 Context
A slash between numbers implies some sort of fraction or ratio. It isn't intuitive what it means between two dependency counts and between sizes.
This has been bugging me the whole time tbh 😁. I've seen feedback on bsky about this as well, where users didn't know what this information meant (even though there's a tooltip...).
📚 Description
Use parens instead for the total number of transitive deps and for the total install size: