Repository navigation
fix(ux): render null monthly_cost as blank in Purchase History - #1431
Conversation
Correct the PurchaseHistory TypeScript interface to type monthly_cost as number | null instead of number. The API has always returned null for pre-purchase-history records; the incorrect non-nullable type caused TypeScript consumers to treat null as 0, rendering "$0" instead of a blank dash. The renderHistoryList rendering already guards with != null, so the fix is purely in the type declaration. Add a regression test that verifies explicit monthly_cost: null renders the muted dash span and not "$0". Closes #1416
|
@coderabbitai review |
|
Warning Review limit reachedYou’ve reached a temporary PR review limit under our Fair Usage Limits Policy. Next review available in: 51 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
✅ Action performedReview finished.
|
|
Merged to main after independent review (SHIP) + all CI green. render blank (not $0) for a null Monthly Cost in Purchase History - distinguishes genuine 0 from absent (nullable-not-zero). |
Summary
PurchaseHistory.monthly_costTypeScript type fromnumbertonumber | nullinapi/types.ts; the API returns null for records that predate the monthly-cost column, and the incorrect non-nullable type caused TypeScript consumers to treat null as 0, displaying "$0" instead of blankrenderHistoryListrendering already guarded with!= null(correct), so no logic changes were neededmonthly_cost: nullrenders the muted dash span, not "$0"Closes #1416