[PR #6997] [MERGED] [PM-37920] fix: Show Storage cost row when additional storage is present #100426

Closed
opened 2026-05-31 05:18:23 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/bitwarden/android/pull/6997
Author: @SaintPatrck
Created: 5/29/2026
Status: Merged
Merged: 5/29/2026
Merged by: @SaintPatrck

Base: mainHead: PM-37920/show-storage-cost-row-when-present


📝 Commits (4)

  • a67df27 [PM-37920] fix: Show Storage cost row when additional storage is present
  • 9ae5f42 Extract Plan money-formatting BigDecimal extensions to a dedicated file
  • 07e7587 Use Unicode minus sign for discount money text
  • def9ea9 Align PlanViewModelTest discount assertion with Unicode minus sign

📊 Changes

4 files changed (+125 additions, -40 deletions)

View changed files

📝 app/src/main/kotlin/com/x8bit/bitwarden/ui/platform/feature/premium/plan/PlanViewModel.kt (+9 -37)
app/src/main/kotlin/com/x8bit/bitwarden/ui/platform/feature/premium/plan/util/BigDecimalExtensions.kt (+48 -0)
📝 app/src/test/kotlin/com/x8bit/bitwarden/ui/platform/feature/premium/plan/PlanViewModelTest.kt (+3 -3)
app/src/test/kotlin/com/x8bit/bitwarden/ui/platform/feature/premium/plan/util/BigDecimalExtensionsTest.kt (+65 -0)

📄 Description

🎟️ Tracking

PM-37920

📔 Objective

The Plan screen's cost breakdown hid the "Storage cost" row whenever the
storage cost was null or zero, wrongly suppressing a legitimate
present-but-free $0.00 storage line — additional storage that exists but
currently costs nothing.

This gates the row on the presence of additional storage (storageCost
non-null) rather than its value, so a $0.00 line still renders while a truly
absent line stays hidden. A dedicated toPresentMoneyText() helper handles
the present-when-non-null case; the Discount line keeps its existing
hide-at-zero behavior.

Covered by unit tests: null storage hides the row, zero storage renders
$0.00, and zero discount still hides — no device screenshots needed.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/bitwarden/android/pull/6997 **Author:** [@SaintPatrck](https://github.com/SaintPatrck) **Created:** 5/29/2026 **Status:** ✅ Merged **Merged:** 5/29/2026 **Merged by:** [@SaintPatrck](https://github.com/SaintPatrck) **Base:** `main` ← **Head:** `PM-37920/show-storage-cost-row-when-present` --- ### 📝 Commits (4) - [`a67df27`](https://github.com/bitwarden/android/commit/a67df273e9870f2cdc5038604eab29410d77139e) [PM-37920] fix: Show Storage cost row when additional storage is present - [`9ae5f42`](https://github.com/bitwarden/android/commit/9ae5f42f4a70899acc953886184a4a9b114fd2dd) Extract Plan money-formatting BigDecimal extensions to a dedicated file - [`07e7587`](https://github.com/bitwarden/android/commit/07e75876c373cff992120e57a1dc97bf86eeb4c6) Use Unicode minus sign for discount money text - [`def9ea9`](https://github.com/bitwarden/android/commit/def9ea9881a27bc82fb378ef5b5bcc64e806d90d) Align PlanViewModelTest discount assertion with Unicode minus sign ### 📊 Changes **4 files changed** (+125 additions, -40 deletions) <details> <summary>View changed files</summary> 📝 `app/src/main/kotlin/com/x8bit/bitwarden/ui/platform/feature/premium/plan/PlanViewModel.kt` (+9 -37) ➕ `app/src/main/kotlin/com/x8bit/bitwarden/ui/platform/feature/premium/plan/util/BigDecimalExtensions.kt` (+48 -0) 📝 `app/src/test/kotlin/com/x8bit/bitwarden/ui/platform/feature/premium/plan/PlanViewModelTest.kt` (+3 -3) ➕ `app/src/test/kotlin/com/x8bit/bitwarden/ui/platform/feature/premium/plan/util/BigDecimalExtensionsTest.kt` (+65 -0) </details> ### 📄 Description ## 🎟️ Tracking PM-37920 ## 📔 Objective The Plan screen's cost breakdown hid the "Storage cost" row whenever the storage cost was `null` or zero, wrongly suppressing a legitimate present-but-free $0.00 storage line — additional storage that exists but currently costs nothing. This gates the row on the *presence* of additional storage (`storageCost` non-null) rather than its value, so a $0.00 line still renders while a truly absent line stays hidden. A dedicated `toPresentMoneyText()` helper handles the present-when-non-null case; the Discount line keeps its existing hide-at-zero behavior. Covered by unit tests: `null` storage hides the row, zero storage renders `$0.00`, and zero discount still hides — no device screenshots needed. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2026-05-31 05:18:23 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/android#100426