[PM-37920] fix: Show Storage cost row when additional storage is present#6997
Conversation
The cost breakdown suppressed the Storage cost row whenever the storage cost was null or zero, hiding a legitimate present-but-free $0.00 storage line. Gate the row on the presence of additional storage rather than its value, so a $0.00 line still renders while a truly absent line stays hidden.
🤖 Bitwarden Claude Code ReviewOverall Assessment: APPROVE This PR fixes a Plan screen bug where the Storage cost row was suppressed for present-but-free additional storage by re-gating the row on the presence of Code Review DetailsNo actionable findings. The bug fix is correctly scoped to the presence-vs-value distinction documented in |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #6997 +/- ##
==========================================
- Coverage 86.26% 85.97% -0.29%
==========================================
Files 1008 918 -90
Lines 66332 65535 -797
Branches 9308 9282 -26
==========================================
- Hits 57221 56344 -877
- Misses 5902 6003 +101
+ Partials 3209 3188 -21
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
| fun BigDecimal?.toDiscountMoneyText(currencyFormatter: NumberFormat): String? = | ||
| this | ||
| ?.takeIf { it.signum() > 0 } | ||
| ?.let { "-${currencyFormatter.format(it)}" } |
There was a problem hiding this comment.
I know this is technically unchanged from the previous code but should this minus be \u2212?
There was a problem hiding this comment.
Good call. Yes, since we're dealing with dollhairs
|
Thanks @david-livefront |
🎟️ Tracking
PM-37920
📔 Objective
The Plan screen's cost breakdown hid the "Storage cost" row whenever the
storage cost was
nullor zero, wrongly suppressing a legitimatepresent-but-free $0.00 storage line — additional storage that exists but
currently costs nothing.
This gates the row on the presence of additional storage (
storageCostnon-null) rather than its value, so a $0.00 line still renders while a truly
absent line stays hidden. A dedicated
toPresentMoneyText()helper handlesthe present-when-non-null case; the Discount line keeps its existing
hide-at-zero behavior.
Covered by unit tests:
nullstorage hides the row, zero storage renders$0.00, and zero discount still hides — no device screenshots needed.