[PR #6696] [PM-33514] feat: Add premium upgrade banner visibility logic #12938

Closed
opened 2026-04-11 03:54:12 -05:00 by GiteaMirror · 0 comments
Owner

Original Pull Request: https://github.com/bitwarden/android/pull/6696

State: closed
Merged: Yes


🎟️ Tracking

https://bitwarden.atlassian.net/browse/PM-33514

📔 Objective

Add premium upgrade banner visibility logic to VaultViewModel so the vault screen knows when to show the premium upgrade banner.

Changes:

  • Inject PremiumStateManager into VaultViewModel and subscribe to isPremiumUpgradeBannerEligibleFlow
  • Add isPremiumUpgradeBannerEligible state field to VaultState
  • Add ActionCardState.UpgradePremium to the sealed class with higher priority than IntroducingArchive in the actionCard computed property
  • Handle dismiss action via premiumStateManager.dismissPremiumUpgradeBanner()
  • Add exhaustive when branch in VaultContent.kt (placeholder for PM-33515 UI rendering)
  • Add 5 unit tests covering flow subscription, dismiss delegation, and all action card priority scenarios

All banner eligibility logic (premium status, billing support, feature flag, account age, vault items, dismissal) is encapsulated in PremiumStateManager — the ViewModel simply consumes the boolean flow.

**Original Pull Request:** https://github.com/bitwarden/android/pull/6696 **State:** closed **Merged:** Yes --- ## 🎟️ Tracking https://bitwarden.atlassian.net/browse/PM-33514 ## 📔 Objective Add premium upgrade banner visibility logic to `VaultViewModel` so the vault screen knows when to show the premium upgrade banner. **Changes:** - Inject `PremiumStateManager` into `VaultViewModel` and subscribe to `isPremiumUpgradeBannerEligibleFlow` - Add `isPremiumUpgradeBannerEligible` state field to `VaultState` - Add `ActionCardState.UpgradePremium` to the sealed class with higher priority than `IntroducingArchive` in the `actionCard` computed property - Handle dismiss action via `premiumStateManager.dismissPremiumUpgradeBanner()` - Add exhaustive `when` branch in `VaultContent.kt` (placeholder for PM-33515 UI rendering) - Add 5 unit tests covering flow subscription, dismiss delegation, and all action card priority scenarios All banner eligibility logic (premium status, billing support, feature flag, account age, vault items, dismissal) is encapsulated in `PremiumStateManager` — the ViewModel simply consumes the boolean flow.
GiteaMirror added the pull-request label 2026-04-11 03:54:12 -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#12938