[PM-32806] feat: Add Passport item type#6853
Conversation
Register pm-32009-new-item-types feature flag and add foundational support for Bank Account, Driver's License, and Passport cipher types across the network model, SDK mapping, and UI layers. Network: CipherTypeJson enum values (6-8), SyncResponseJson nested data classes, CipherJsonRequest fields, LinkedIdTypeJson entries (600-812). SDK: Defensive mapping that gracefully skips unsupported cipher types during sync decryption (SDK types not yet available). UI: VaultBankAccountType enum, VaultItemCipherType/CreateVaultItemType extensions, ItemType state classes in VaultAddEditViewModel, string resources, and exhaustive when-branch updates across ViewModels.
C1: Gate new item types behind pm-32009-new-item-types feature flag in VaultViewModel and VaultItemListingViewModel excluded options. I1: Add Timber.w logging when cipher conversion fails during sync. I2: Add isSdkSupported property to ItemType and guard save path in VaultAddEditViewModel to prevent crash on unsupported types.
…ankAccount fixtures
Honor the established convention of fully-qualified type references in the add/edit extensions, simplify the create-vault-item exclusion list into a single non-null builder for clarity, and align the test fixtures with the prevailing factory-default pattern. Also drop a stale TODO branch that was rendered unreachable when BANK_ACCOUNT joined the null group, and tag the placeholder render path so it is easy to find when the dedicated UI screens land.
Bring the bank-account default in line with login/card/identity/etc. so the SDK and network test fixtures stay consistent. Update the JSON literal fixtures that round-trip these models to include the new field so deserialization continues to match the expected mocks.
Bank account ciphers arrive from the server with all string fields encrypted, including accountType, so coercing it into a typed enum at the network boundary always degraded to OTHER and stripped meaning out of the round trip. Match the convention already used by Card.brand and Card.expMonth: keep the field as a plain String at the network and SDK boundaries, and let CipherViewExtensions own the enum mapping over the already-decrypted BankAccountView.
Vertically slice the Bank Account cipher type onto the new-item-types infrastructure so users can author, view, search, and group their own bank-account ciphers behind the pm-32009-new-item-types flag. The phase-01-04 state classes already define the canonical Bank Account data shape; this slice adds the UI, ViewModel actions, vault integration, and tests that consume them. Driver's License and Passport remain placeholders so each can be delivered as its own follow-up Story slice. Account-number and PIN visibility is held in the composable via rememberSaveable because the canonical data classes carry plain strings rather than visibility-wrapped values; the corresponding ViewModel actions are still dispatched so future telemetry can hook in without touching the UI layer.
Vertically slice the Driver's License cipher type onto the new-item-types infrastructure so users can author and view their own driver's license ciphers behind the pm-32009-new-item-types flag. The phase-01-04 state classes already define the canonical Driver's License data shape with split first/middle/last names and separate expiration month/day/year; this slice adds the UI, ViewModel actions, dispatcher branches, and tests that consume them. Bank Account remains untouched and Passport stays a placeholder for the next Story slice. The SDK at 2.0.0-6484-a19b6544 does not yet expose a CipherType, CipherListViewType, or CopyableCipherFields entry for Driver's License. The vault list filter, count, overflow emission, and copy lookup paths are wired in Android with TODOs that document the missing SDK pieces, so when the Rust SDK ships them only the tagged spots need to flip on. The overflow action data class, ViewModel dispatch, and AddEdit/View screens work end-to-end today against synthetic state, exercising the plumbing before the SDK lands.
Vertically slice the Passport cipher type onto the new-item-types infrastructure so users can author and view their own passport ciphers behind the pm-32009-new-item-types flag. The phase-01-04 state classes already define the canonical Passport data shape with split surname / given name, three separate month/day/year date fields (date of birth, issue date, expiration date), nationality, passport type, issuing country / authority, and passport number; this slice adds the UI, ViewModel actions, dispatcher branches, and tests that consume them. Bank Account and Driver's License remain untouched, completing the three-Story per-type rollout under PM-32009. The passport number row is hidden by default with a reveal toggle and copy action (mirroring the Card item type's number/CVV UX from the Bitwarden web client) so the most sensitive field on the cipher is not disclosed on screen by default. Visibility is tracked via rememberSaveable in both the AddEdit and View composables since the canonical state model exposes a plain String / String?. The SDK at 2.0.0-6484-a19b6544 does not yet expose a CipherListViewType or CopyableCipherFields entry for Passport. The vault list filter, count, overflow emission, and copy lookup paths are wired in Android with TODO(PM-32009) markers that document the missing SDK pieces, so when the Rust SDK ships them only the tagged spots need to flip on. The overflow action data class, ViewModel dispatch, and AddEdit/View screens work end-to-end today against synthetic state, exercising the plumbing before the SDK lands.
🤖 Bitwarden Claude Code ReviewOverall Assessment: APPROVE Reviewed the third vertical slice of the New Item Types epic, which adds the Passport cipher type's Add/Edit form, View screen, vault listing entry, and search support. The implementation faithfully follows the patterns established by the prior Driver's License and Bank Account slices: sealed-class Code Review DetailsNo findings. The implementation is consistent with the prior slices in this epic, the placeholder integration points ( |
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## new-item-types/PM-32808_drivers-license #6853 +/- ##
===========================================================================
- Coverage 84.45% 83.91% -0.54%
===========================================================================
Files 848 849 +1
Lines 60829 61396 +567
Branches 8856 8921 +65
===========================================================================
+ Hits 51374 51522 +148
- Misses 6424 6830 +406
- Partials 3031 3044 +13
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:
|
7e3c779 to
1bc6a61
Compare
🎟️ Tracking
PM-32806 — third Android Story under epic PM-32009 (New Item Types).
📔 Objective
Third vertical slice of the New Item Types epic for Android. Adds the Passport cipher type's Add/Edit form, View screen, vault listing entry, search support, and a single quick-copy overflow action ("Copy passport number") on top of the Driver's License slice.
The View screen treats the passport number (national identification number) as a hidden-by-default field with reveal toggle and copy action, mirroring the Card item type's number/CVV UX. AddEdit follows the same Card pattern. Visibility is tracked via
rememberSaveablesince the canonical Passport state model uses plainString?.The vault list trailing action is a single quick-copy button gated on the SDK's
CopyableCipherFields.PASSPORT_*flag (TODO(PM-32009)until the SDK exposes it). The vault list row subtitle is intentionally not formatted client-side —CipherListView.subtitlestays SDK-owned.This Android slice consumes the canonical phase-01-04 Passport data model with split fields (
surname/givenName, separatedobMonth/Day/Year,issueMonth/Day/Year,expirationMonth/Day/Year).SDK dependency
The Bitwarden SDK does not yet expose
CipherType.PASSPORT,CipherListViewType.Passport,PassportViewonCipherView, orCopyableCipherFields.PASSPORT_*. Affected sites carryTODO(PM-32009)markers documenting the additions required:SearchViewModel.kt:599— passport number copy lookupSearchTypeDataExtensions.kt:143— search filter predicateVaultItemListingViewModel.kt:1327— listing copy lookupVaultItemListingDataExtensions.kt:93— listing filter predicateCipherListViewExtensions.kt:104— overflow emissionVaultViewModel.kt:867— vault overview copy lookupVaultDataExtensions.kt:158— Passport countThe AddEdit form, View screen, ViewModel actions, search/listing wiring, and the overflow action data class are live today and exercised by tests against synthetic state.
📸 Screenshots
UI screenshots will be added before this PR is moved out of draft.