Skip to content

[PM-37335] fix: Route attachments upgrade CTA through in-app plan modal#6946

Merged
SaintPatrck merged 1 commit into
mainfrom
premium-upgrade/pm-37335-attachments-modal-route
May 20, 2026
Merged

[PM-37335] fix: Route attachments upgrade CTA through in-app plan modal#6946
SaintPatrck merged 1 commit into
mainfrom
premium-upgrade/pm-37335-attachments-modal-route

Conversation

@SaintPatrck
Copy link
Copy Markdown
Contributor

@SaintPatrck SaintPatrck commented May 19, 2026

🎟️ Tracking

PM-37335

📔 Objective

The Attachments "Upgrade to Premium" dialog was missed by the PM-33519 rewire and continued sending users to the legacy web URL even when the in-app upgrade path was available. Users on cloud accounts with in-app upgrade enabled would leave the app to complete what should be an in-app flow — inconsistent with every other upgrade entry point already routed through the plan modal.

AttachmentsViewModel.handleUpgradeToPremiumClick now consults PremiumStateManager.isInAppUpgradeAvailable() and emits NavigateToPlanModal when in-app upgrade is supported, falling back to the existing web URL for environments where it is not. Mirrors the VaultItemViewModel.handleUpgradeToPremiumClick shape already in place for the item-detail upgrade CTA.

@SaintPatrck SaintPatrck added the ai-review-vnext Request a Claude code review using the vNext workflow label May 19, 2026
@github-actions github-actions Bot added app:password-manager Bitwarden Password Manager app context t:bug Change Type - Bug labels May 19, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 19, 2026

🤖 Bitwarden Claude Code Review

Overall Assessment: APPROVE

This PR routes the Attachments "Upgrade to Premium" CTA through the in-app plan modal when PremiumStateManager.isInAppUpgradeAvailable() returns true, falling back to the existing web URL otherwise. The implementation mirrors the existing VaultItemViewModel.handleUpgradeToPremiumClick pattern line-for-line, the new NavigateToPlanModal event is wired through the navigation stack (AttachmentsScreenAttachmentsNavigationVaultUnlockedNavigation), and both branches of the upgrade flow are covered by ViewModel and Screen tests.

Code Review Details

No findings. The change is a focused, low-risk routing fix that follows an established pattern already used by the item-detail upgrade CTA. Test coverage exercises both the in-app and fallback paths, and the navigation wiring is consistent with the other onNavigateToPlan call sites in VaultUnlockedNavigation.

@codecov
Copy link
Copy Markdown

codecov Bot commented May 19, 2026

Codecov Report

❌ Patch coverage is 92.30769% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 86.18%. Comparing base (6cf7227) to head (a06db7f).

Files with missing lines Patch % Lines
...vault/feature/attachments/AttachmentsNavigation.kt 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #6946      +/-   ##
==========================================
- Coverage   86.30%   86.18%   -0.13%     
==========================================
  Files         873      914      +41     
  Lines       63220    64785    +1565     
  Branches     9165     9209      +44     
==========================================
+ Hits        54563    55835    +1272     
- Misses       5508     5789     +281     
- Partials     3149     3161      +12     
Flag Coverage Δ
app-data 16.70% <0.00%> (-0.36%) ⬇️
app-ui-auth-tools 19.40% <0.00%> (+0.21%) ⬆️
app-ui-platform 16.21% <0.00%> (+0.04%) ⬆️
app-ui-vault 28.58% <92.30%> (+0.56%) ⬆️
authenticator 6.25% <0.00%> (-0.03%) ⬇️
lib-core-network-bridge 4.07% <0.00%> (-0.02%) ⬇️
lib-data-ui 1.12% <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.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@SaintPatrck SaintPatrck marked this pull request as ready for review May 19, 2026 21:24
@SaintPatrck SaintPatrck requested review from a team and david-livefront as code owners May 19, 2026 21:24
@SaintPatrck SaintPatrck added ai-review-vnext Request a Claude code review using the vNext workflow and removed ai-review-vnext Request a Claude code review using the vNext workflow labels May 19, 2026
verify(exactly = 1) {
environmentRepository.environment

@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.

This suppression isn't needed, is it?

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.

Nope

}
}

@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.

This isn't needed either, right?

@SaintPatrck SaintPatrck force-pushed the premium-upgrade/pm-37335-attachments-modal-route branch from 6b20d8d to 0e7967d Compare May 19, 2026 22:07
The Attachments "Upgrade to Premium" dialog was missed by the PM-33519
rewire and continued routing to the legacy web URL even when in-app
upgrade is available. Branch on PremiumStateManager.isInAppUpgradeAvailable
so the dialog opens the in-app plan modal in that path, falling back to
the legacy URL otherwise.
@SaintPatrck SaintPatrck force-pushed the premium-upgrade/pm-37335-attachments-modal-route branch from 0e7967d to a06db7f Compare May 19, 2026 22:08
@SaintPatrck SaintPatrck added this pull request to the merge queue May 20, 2026
Merged via the queue into main with commit cc210a5 May 20, 2026
25 checks passed
@SaintPatrck SaintPatrck deleted the premium-upgrade/pm-37335-attachments-modal-route branch May 20, 2026 01:32
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: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.

2 participants