Moved empty-state labels to Shade - #29388
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (12)
💤 Files with no reviewable changes (3)
🚧 Files skipped from review as they are similar to previous changes (7)
WalkthroughRemoves the Estimated code review effort: 3 (Moderate) | ~20 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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 |
|
| Command | Status | Duration | Result |
|---|---|---|---|
nx run @tryghost/admin:test:acceptance |
✅ Succeeded | 4m 58s | View ↗ |
nx run-many -t test:unit -p @tryghost/admin-x-d... |
✅ Succeeded | 2m 15s | View ↗ |
nx run ghost-monorepo:lint:boundaries |
✅ Succeeded | 20s | View ↗ |
nx run-many -t lint -p @tryghost/admin-x-design... |
✅ Succeeded | 1m 6s | View ↗ |
nx run @tryghost/admin-x-settings:test:acceptance |
✅ Succeeded | 1m 15s | View ↗ |
nx run @tryghost/activitypub:test:acceptance |
✅ Succeeded | 34s | View ↗ |
nx run @tryghost/admin:build |
✅ Succeeded | 17s | View ↗ |
nx run-many --target=build --projects=tag:publi... |
✅ Succeeded | <1s | View ↗ |
nx run ghost-admin:test |
✅ Succeeded | 1s | View ↗ |
💡 Verify your cache is correct by running tasks in a sandbox. Read docs ↗
☁️ Nx Cloud last updated this comment at 2026-07-16 16:05:57 UTC
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #29388 +/- ##
=======================================
Coverage 74.13% 74.13%
=======================================
Files 1591 1591
Lines 138677 138677
Branches 16813 16813
=======================================
Hits 102810 102810
Misses 34821 34821
Partials 1046 1046 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
2b7f9c9 to
62200e8
Compare
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In
`@apps/admin-x-settings/src/components/settings/membership/tiers/tiers-list.tsx`:
- Line 38: Update the price formatting in the tier list’s formatNumber call to
preserve two decimal places for prices with cents, including values such as
5.50, while retaining whole-number prices without unnecessary decimals. Use the
existing currencyToDecimal value and configure the formatter’s minimum fraction
digits appropriately alongside maximumFractionDigits.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: ca1bf75c-1f91-4c3e-a4b7-a67f84296fc9
📒 Files selected for processing (12)
apps/admin-x-design-system/src/global/no-value-label.stories.tsxapps/admin-x-design-system/src/global/no-value-label.tsxapps/admin-x-design-system/src/index.tsapps/admin-x-settings/src/components/settings/advanced/history-modal.tsxapps/admin-x-settings/src/components/settings/advanced/integrations.tsxapps/admin-x-settings/src/components/settings/email/newsletters/newsletters-list.tsxapps/admin-x-settings/src/components/settings/general/users.tsxapps/admin-x-settings/src/components/settings/growth/recommendations/incoming-recommendation-list.tsxapps/admin-x-settings/src/components/settings/growth/recommendations/recommendation-list.tsxapps/admin-x-settings/src/components/settings/membership/tiers/tiers-list.tsxapps/shade/src/lib/ds-utils.tsapps/shade/test/unit/utils/utils.test.ts
💤 Files with no reviewable changes (3)
- apps/admin-x-design-system/src/global/no-value-label.tsx
- apps/admin-x-design-system/src/global/no-value-label.stories.tsx
- apps/admin-x-design-system/src/index.ts
| <div className='mt-2 flex items-baseline'> | ||
| <span className="ml-1 translate-y-[-3px] text-md font-bold uppercase">{currencySymbol}</span> | ||
| <span className='text-xl font-bold tracking-tighter'>{numberWithCommas(currencyToDecimal(tier.monthly_price || 0))}</span> | ||
| <span className='text-xl font-bold tracking-tighter'>{formatNumber(currencyToDecimal(tier.monthly_price || 0), {maximumFractionDigits: 2})}</span> |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win
Prevent trailing zero truncation for prices with cents.
Passing only maximumFractionDigits: 2 will properly display $5.99 or $5, but if a price ends in a zero cent (e.g., $5.50), it will be rendered as $5.5 because trailing zeros are not padded.
To format currencies correctly, consider using minimumFractionDigits: 2 when the price has cents.
💡 Proposed fix to pad trailing zeros
- <span className='text-xl font-bold tracking-tighter'>{formatNumber(currencyToDecimal(tier.monthly_price || 0), {maximumFractionDigits: 2})}</span>
+ <span className='text-xl font-bold tracking-tighter'>
+ {formatNumber(currencyToDecimal(tier.monthly_price || 0), {
+ minimumFractionDigits: (tier.monthly_price || 0) % 100 === 0 ? 0 : 2,
+ maximumFractionDigits: 2
+ })}
+ </span>📝 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 className='text-xl font-bold tracking-tighter'>{formatNumber(currencyToDecimal(tier.monthly_price || 0), {maximumFractionDigits: 2})}</span> | |
| <span className='text-xl font-bold tracking-tighter'> | |
| {formatNumber(currencyToDecimal(tier.monthly_price || 0), { | |
| minimumFractionDigits: (tier.monthly_price || 0) % 100 === 0 ? 0 : 2, | |
| maximumFractionDigits: 2 | |
| })} | |
| </span> |
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In
`@apps/admin-x-settings/src/components/settings/membership/tiers/tiers-list.tsx`
at line 38, Update the price formatting in the tier list’s formatNumber call to
preserve two decimal places for prices with cents, including values such as
5.50, while retaining whole-number prices without unnecessary decimals. Use the
existing currencyToDecimal value and configure the formatter’s minimum fraction
digits appropriately alongside maximumFractionDigits.
no ref Settings still depended on the legacy NoValueLabel API, so migrating every consumer together allows the duplicate component to be removed safely.
62200e8 to
3a51146
Compare

What changed
NoValueLabelconsumer to Shade.NoValueLabelIconand semantic Lucide icons:PlugHistoryBadgeDollarSignMailXUserRoundXformatNumber.formatNumberwith optional fraction-digit settings while preserving its existing default rounding behavior, allowing tier prices to retain cents.Why
Migrating every consumer as one component-wide slice gives the legacy component a clear zero-consumer deletion point and avoids repeated single-call-site PRs.
Validation
git diff --checkManual testing