Skip to content

fix(ux): render null monthly_cost as blank in Purchase History - #1431

Merged
cristim merged 1 commit into
mainfrom
fix/1416-monthly-cost-null-blank
Jul 17, 2026
Merged

cristim merged 1 commit into
mainfrom
fix/1416-monthly-cost-null-blank

Conversation

@cristim

@cristim cristim commented Jul 17, 2026

Copy link
Copy Markdown
Member

Summary

  • Fix PurchaseHistory.monthly_cost TypeScript type from number to number | null in api/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 blank
  • The renderHistoryList rendering already guarded with != null (correct), so no logic changes were needed
  • Add regression test asserting explicit monthly_cost: null renders the muted dash span, not "$0"

Closes #1416

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
@cristim cristim added triaged Item has been triaged priority/p3 Polish / idea / may never ship severity/low Minor harm urgency/this-quarter Within the quarter impact/few Limited audience effort/s Hours type/bug Defect labels Jul 17, 2026
@cristim

cristim commented Jul 17, 2026

Copy link
Copy Markdown
Member Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Jul 17, 2026 •

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

You’ve reached a temporary PR review limit under our Fair Usage Limits Policy.

Your recent review volume is higher than typical usage, so adaptive limits are currently applied.

Next review available in: 51 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

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 configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 3543bd87-7146-418b-b64e-db42d993dcb8

📥 Commits

Reviewing files that changed from the base of the PR and between 473f69b and 5fbe3b5.

📒 Files selected for processing (2)
  • frontend/src/__tests__/history.test.ts
  • frontend/src/api/types.ts
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/1416-monthly-cost-null-blank

Comment @coderabbitai help to get the list of available commands.

@coderabbitai

coderabbitai Bot commented Jul 17, 2026 •

Copy link
Copy Markdown
Contributor
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@cristim
cristim merged commit 19dcdf9 into main Jul 17, 2026
20 checks passed
@cristim
cristim deleted the fix/1416-monthly-cost-null-blank branch July 17, 2026 06:50
@cristim

cristim commented Jul 17, 2026

Copy link
Copy Markdown
Member Author

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).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

effort/s Hours impact/few Limited audience priority/p3 Polish / idea / may never ship severity/low Minor harm triaged Item has been triaged type/bug Defect urgency/this-quarter Within the quarter

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug(purchases): Purchase History shows 0 instead of blank for records with null Monthly Cost (regression after #255/PR #848)

1 participant