Skip to content

[PM-37992] fix: Show subscription attention card in empty vault and suppress conflicting CTAs#2867

Open
KatherineInCode wants to merge 17 commits into
mainfrom
pm-37992/cta-fixes
Open

[PM-37992] fix: Show subscription attention card in empty vault and suppress conflicting CTAs#2867
KatherineInCode wants to merge 17 commits into
mainfrom
pm-37992/cta-fixes

Conversation

@KatherineInCode

Copy link
Copy Markdown
Contributor

🎟️ Tracking

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

📔 Objective

QA follow-up on #2823. Two failures were found:

  1. Card missing for empty/near-empty vaultssubscriptionNeedsAttentionActionCard was only rendered inside vaultContents(with:), which only displays when the vault has items. Users with 0–4 vault items saw emptyVault instead, where the card was absent. Fixed by adding the card to emptyVault.

  2. Subscription attention card and archive onboarding card appear simultaneously — When a past-due user had an undismissed archive onboarding CTA, both cards showed at once. Fixed by suppressing archiveOnboardingActionCard (and importLoginsActionCard in the empty vault) when the subscription attention card is visible.

Also converts VaultListView previews from PreviewProvider to #Preview macros, and adds previews for the two failing states.

📸 Screenshots

…conflicting CTAs

- Add subscriptionNeedsAttentionActionCard to emptyVault so past-due users
  with 0-4 vault items see the card
- Suppress importLoginsActionCard and archiveOnboardingActionCard when
  subscription attention card is showing (priority suppression, not dismissal)
- Add ViewInspector tests for all new states
- Replace deleted _allPreviews snapshot catch-all with individual disabled
  snapshot tests for each uncovered state
@github-actions github-actions Bot added app:password-manager Bitwarden Password Manager app context t:bug Change Type - Bug labels Jul 8, 2026
@codecov

codecov Bot commented Jul 8, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 79.66102% with 12 lines in your changes missing coverage. Please review.
✅ Project coverage is 81.70%. Comparing base (173e3c6) to head (c27a8bc).
⚠️ Report is 2 commits behind head on main.

Files with missing lines Patch % Lines
...hared/UI/Vault/Vault/VaultList/VaultListView.swift 69.23% 12 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2867      +/-   ##
==========================================
+ Coverage   81.28%   81.70%   +0.41%     
==========================================
  Files        1028     1028              
  Lines       66213    65920     -293     
==========================================
+ Hits        53822    53858      +36     
+ Misses      12391    12062     -329     

☔ View full report in Codecov by Harness.
📢 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.

… priority cascade

Add VaultListActionCard enum and activeActionCard computed property to
VaultListState, implementing an explicit priority ordering (upgradedToPremium
> upgradeNeeded > subscriptionNeedsAttention > introducingArchive > importItems).
Replace the five individual @ViewBuilder card properties with a single actionCard
view that switches on activeActionCard, so only one card is ever rendered at a time.
@KatherineInCode
KatherineInCode marked this pull request as ready for review July 9, 2026 14:15
@KatherineInCode
KatherineInCode requested review from a team and matt-livefront as code owners July 9, 2026 14:15
@KatherineInCode KatherineInCode added the ai-review Request a Claude code review label Jul 9, 2026
@github-actions

github-actions Bot commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

🤖 Bitwarden Claude Code Review

Overall Assessment: APPROVE

Reviewed the QA follow-up to #2823, which refactors the scattered per-card @ViewBuilder guards in VaultListView into a single priority-based VaultListActionCard cascade resolved via activeActionCard. The change fixes the subscription attention card being absent in empty/near-empty vaults and prevents the subscription attention and archive onboarding cards from showing simultaneously. Card eligibility is correctly gated on vault state (introducingArchive requires a populated vault, importItems requires an empty vault), and the accompanying test/preview conversions (XCTest → Swift Testing, PreviewProvider#Preview) are consistent and well-covered.

Code Review Details

No new findings.

The empty-vault card exposure concern was already raised inline (VaultListView.swift:85) and addressed by the author's vault-state gating in shouldShow(_:). The CaseIterable priority-resolution suggestion (VaultListState.swift) was implemented as reviewed. Priority ordering is documented on the enum, and the exhaustive subset test in VaultListStateTests.swift correctly mirrors the shouldShow logic for the empty-vault case.

Comment thread BitwardenShared/UI/Vault/Vault/VaultList/VaultListView+SnapshotTests.swift Outdated
Comment thread BitwardenShared/UI/Vault/Vault/VaultList/VaultListStateTests.swift Outdated
Comment thread BitwardenShared/UI/Vault/Vault/VaultList/VaultListState.swift Outdated
matt-livefront
matt-livefront previously approved these changes Jul 15, 2026
Comment thread BitwardenShared/UI/Vault/Vault/VaultList/VaultListState.swift
fedemkr
fedemkr previously approved these changes Jul 17, 2026

@fedemkr fedemkr left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Looks good, just put 2 really minor ⛏️ but approved 🚀

Comment thread BitwardenShared/UI/Vault/Vault/VaultList/VaultListStateTests.swift Outdated
Comment thread BitwardenShared/UI/Vault/Vault/VaultList/VaultListStateTests.swift Outdated
Comment thread BitwardenShared/UI/Vault/Vault/VaultList/VaultListView.swift
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ai-review Request a Claude code review app:password-manager Bitwarden Password Manager app context t:bug Change Type - Bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants