[PM-34123] feat: Update New item menu with item type selection screen#6854
[PM-34123] feat: Update New item menu with item type selection screen#6854SaintPatrck wants to merge 1 commit intonew-item-types/PM-32806_passportfrom
Conversation
The legacy "New" dropdown menu becomes too crowded once Bank Account, Driver's License, and Passport cipher types are introduced. Sibling clients (Web, Desktop, Browser) already replace the dropdown with a dedicated selection screen, so this change brings Android in line. Behavior is gated on the pm-32009-new-item-types feature flag: - When ON, tapping "New" navigates to the dedicated ItemTypeSelectionScreen, which lists all eight cipher types and forwards the selection on to the AddEdit flow. - When OFF, the existing dropdown remains exactly as it is today, and the new screen is unreachable. Keeping the gate at the call site means we can roll the new UX out independently of the per-type Stories that have already shipped, and we preserve a clean rollback path until the new types are GA.
🤖 Bitwarden Claude Code ReviewOverall Assessment: REQUEST CHANGES This PR introduces a new Code Review Details
|
| if (isNewItemTypesEnabled) { | ||
| sendEvent(VaultEvent.NavigateToItemTypeSelection) | ||
| return | ||
| } |
There was a problem hiding this comment.
RESTRICT_ITEM_TYPES policy is bypassed when the new item types flag is enabled.
Details and fix
Before this PR, when RESTRICT_ITEM_TYPES is active for any organization the legacy dropdown excluded CARD (line 451 still does this). The early return now skips that filter entirely and unconditionally navigates to ItemTypeSelectionScreen, which renders all eight types (including CARD) regardless of policy state. The new test on VaultViewModelTest.kt:3637-3659 codifies this behavior: an active RESTRICT_ITEM_TYPES policy is asserted to still navigate straight through.
Because ItemTypeSelectionViewModel has no policy input and the AddEdit flow does not enforce RESTRICT_ITEM_TYPES either (only applyRestrictItemTypesPolicy in VaultDataExtensions.kt and the export/import flows do), an enterprise user under this policy can now reach the Card add-item screen by tapping New → Card.
Suggested fix: pass restrictItemTypesPolicyOrgIds (or a derived excludedTypes set) into ItemTypeSelectionState so the screen filters out CARD when the policy is active, mirroring the legacy dropdown's behavior.
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## new-item-types/PM-32806_passport #6854 +/- ##
====================================================================
- Coverage 83.91% 83.86% -0.06%
====================================================================
Files 849 852 +3
Lines 61396 61508 +112
Branches 8921 8924 +3
====================================================================
+ Hits 51522 51584 +62
- Misses 6830 6880 +50
Partials 3044 3044
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
🎟️ Tracking
PM-34123 — fourth Android Story under epic PM-32009 (New Item Types).
📔 Objective
Replaces the existing "New" dropdown menu in the vault with a dedicated
ItemTypeSelectionScreenwhen thepm-32009-new-item-typesfeature flag is enabled. The new screen lists all eight cipher types (Login, Card, Identity, Note, SSH Key, Bank Account, Driver's License, Passport) with a tap target per type leading into the appropriate AddEdit flow.The existing dropdown (five legacy types) remains the only path when the flag is OFF, preserving production behavior. The selection screen is unreachable while the flag is disabled.
This brings Android in line with Web, Desktop, and Browser, which have already replaced their "New" dropdowns with dedicated selection surfaces — the dropdown becomes too tall once the eight types are added.
Behavior
VaultEvent.NavigateToItemTypeSelection→ItemTypeSelectionScreen→ AddEdit screen for the selected type.📸 Screenshots
UI screenshots will be added before this PR is moved out of draft.