Skip to content

[PM-33516] feat: Create PlanScreen, PlanViewModel, and modal navigation#6715

Merged
SaintPatrck merged 1 commit intomainfrom
premium-upgrade/PM-33516-plan-screen
Mar 25, 2026
Merged

[PM-33516] feat: Create PlanScreen, PlanViewModel, and modal navigation#6715
SaintPatrck merged 1 commit intomainfrom
premium-upgrade/PM-33516-plan-screen

Conversation

@SaintPatrck
Copy link
Copy Markdown
Contributor

@SaintPatrck SaintPatrck commented Mar 25, 2026

🎟️ Tracking

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

📔 Objective

Add the premium upgrade Plan screen with ViewModel, navigation, and full test coverage.

Screen features:

  • Pricing details card with rate/frequency header and feature list (built-in authenticator, emergency access, secure file storage, breach monitoring)
  • "Upgrade now" button that launches Stripe checkout via AuthTab
  • Waiting-for-payment dialog with go-back and cancel options
  • Checkout error dialog with retry
  • Automatic premium status detection via UserState flow — navigates back with snackbar on successful upgrade
  • Special circumstance handling for returning from checkout callback

Navigation:

  • Sealed PlanRoute with Standard (back arrow, bottom nav visible) and Modal (close icon, bottom nav hidden) variants
  • Modal destination registered in VaultUnlockedNavigation

📸 Screenshots

Figma Actual

@github-actions github-actions bot added app:password-manager Bitwarden Password Manager app context app:authenticator Bitwarden Authenticator app context t:feature Change Type - Feature Development labels Mar 25, 2026
@codecov
Copy link
Copy Markdown

codecov bot commented Mar 25, 2026

Codecov Report

❌ Patch coverage is 94.61279% with 16 lines in your changes missing coverage. Please review.
✅ Project coverage is 85.80%. Comparing base (b4917ce) to head (f87a2dd).
⚠️ Report is 6 commits behind head on main.

Files with missing lines Patch % Lines
.../ui/platform/feature/premium/plan/PlanViewModel.kt 94.26% 4 Missing and 3 partials ⚠️
...den/ui/platform/feature/premium/plan/PlanScreen.kt 95.83% 2 Missing and 4 partials ⚠️
...ui/platform/feature/premium/plan/PlanNavigation.kt 40.00% 3 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #6715      +/-   ##
==========================================
+ Coverage   85.30%   85.80%   +0.49%     
==========================================
  Files         897      816      -81     
  Lines       59830    58328    -1502     
  Branches     8504     8504              
==========================================
- Hits        51037    50047     -990     
+ Misses       5840     5332     -508     
+ Partials     2953     2949       -4     
Flag Coverage Δ
app-data 17.59% <0.00%> (+0.08%) ⬆️
app-ui-auth-tools 20.49% <1.80%> (-0.32%) ⬇️
app-ui-platform 15.35% <91.58%> (+0.03%) ⬆️
app-ui-vault 26.09% <1.44%> (-0.69%) ⬇️
authenticator 6.50% <0.00%> (-0.06%) ⬇️
lib-core-network-bridge 4.24% <0.00%> (+0.01%) ⬆️
lib-data-ui 0.94% <0.00%> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Mar 25, 2026

Logo
Checkmarx One – Scan Summary & Detailsdd28439d-ff9e-4f41-8ed7-a39b831d487a

Great job! No new security vulnerabilities introduced in this pull request

@SaintPatrck SaintPatrck force-pushed the premium-upgrade/PM-33516-plan-screen branch 3 times, most recently from 7dca661 to 6eef5bd Compare March 25, 2026 15:11
@SaintPatrck SaintPatrck added the ai-review-vnext Request a Claude code review using the vNext workflow label Mar 25, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Mar 25, 2026

Overall Assessment: APPROVE

This PR adds the premium upgrade Plan screen with ViewModel, modal navigation from the Vault action card, AuthTab-based Stripe checkout integration, process-death recovery via SpecialCircumstance, and snackbar relay for upgrade confirmation. The implementation follows established Bitwarden Android patterns (BaseViewModel UDF, Parcelable state, handlers, sealed route navigation) and includes comprehensive screen and ViewModel tests covering all state transitions and edge cases.

@SaintPatrck SaintPatrck force-pushed the premium-upgrade/PM-33516-plan-screen branch from 6eef5bd to 6827e85 Compare March 25, 2026 15:30
@SaintPatrck SaintPatrck marked this pull request as ready for review March 25, 2026 15:39
@SaintPatrck SaintPatrck requested review from a team and david-livefront as code owners March 25, 2026 15:39
fun NavGraphBuilder.planModalDestination(
onNavigateBack: () -> Unit,
) {
composableWithSlideTransitions<PlanRoute.Modal> {
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we never need the Standard one?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not in this PR. It will be used in an upcoming PR.


private fun handleGoBackClick() {
val currentState = state.dialogState
if (currentState is PlanState.DialogState.WaitingForPayment) {
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So we just ignore the goBackClick when not in this state?

Copy link
Copy Markdown
Contributor Author

@SaintPatrck SaintPatrck Mar 25, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Correct. Couldn't technically trigger this event if not waiting for payment but we need the original checkoutUrl from state. I changed the approach so we're pulling the original checkoutUrl from ViewState instead of DialogState and added onFreeContent { } helper.

/**
* A separate instance of the [CIPHER_UNARCHIVED] relay to avoid the View Cipher screen being
* both a producer and consumer of it's own event.
* both a producer and consumer of its own event.
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

}
}

@Suppress("MaxLineLength")
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

Comment thread ui/src/main/res/values/strings.xml Outdated
@SaintPatrck SaintPatrck force-pushed the premium-upgrade/PM-33516-plan-screen branch from 6827e85 to fb6b532 Compare March 25, 2026 16:13
@SaintPatrck
Copy link
Copy Markdown
Contributor Author

I converted this from draft a little prematurely, but thanks for the expedited review.

@SaintPatrck SaintPatrck force-pushed the premium-upgrade/PM-33516-plan-screen branch 2 times, most recently from 5b330ad to aee2b79 Compare March 25, 2026 17:33
private fun FreeContent(
viewState: PlanState.ViewState.Free,
isDialogShowing: Boolean,
handlers: PlanHandlers,
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we add a default Modifier to the params

Add premium upgrade flow with PlanScreen, PlanViewModel, and PlanNavigation
supporting both standard (back arrow) and modal (close icon) presentation
modes. The screen shows pricing details, a feature list using
BitwardenContentBlock components, and a Stripe checkout flow via AuthTab.
Includes WaitingForPayment dialog, checkout error handling, premium status
detection via UserState flow, and snackbar relay for upgrade confirmation.
@SaintPatrck SaintPatrck force-pushed the premium-upgrade/PM-33516-plan-screen branch from aee2b79 to f87a2dd Compare March 25, 2026 18:19
@SaintPatrck
Copy link
Copy Markdown
Contributor Author

Thanks @david-livefront

@SaintPatrck SaintPatrck added this pull request to the merge queue Mar 25, 2026
Merged via the queue into main with commit 69a13c9 Mar 25, 2026
26 checks passed
@SaintPatrck SaintPatrck deleted the premium-upgrade/PM-33516-plan-screen branch March 25, 2026 18:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ai-review-vnext Request a Claude code review using the vNext workflow app:authenticator Bitwarden Authenticator app context app:password-manager Bitwarden Password Manager app context t:feature Change Type - Feature Development

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants