[PM-32808] feat: Add Driver's License item type#6852
[PM-32808] feat: Add Driver's License item type#6852SaintPatrck wants to merge 18 commits intomainfrom
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.
🤖 Bitwarden Claude Code ReviewOverall Assessment: APPROVE This PR adds a vertical Driver's License item-type slice (Add/Edit form, View screen, vault listing entry, search support, and a single quick-copy overflow action) on top of the Bank Account slice. The structural pattern, handler/action plumbing, and test coverage cleanly mirror the Bank Account precedent. SDK-blocked behavior (vault list filtering, overflow emission, item count, copy-from-list resolution) is consistently stubbed with Code Review DetailsNo findings. Notes for awareness (not actionable):
|
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## new-item-types/PM-32810_bank-account #6852 +/- ##
========================================================================
- Coverage 85.21% 84.45% -0.76%
========================================================================
Files 841 848 +7
Lines 60159 60829 +670
Branches 8804 8856 +52
========================================================================
+ Hits 51262 51374 +112
- Misses 5879 6424 +545
- Partials 3018 3031 +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:
|
d90eebb to
ac36549
Compare
87e68ce to
28d44ce
Compare
🎟️ Tracking
PM-32808 — second Android Story under epic PM-32009 (New Item Types).
📔 Objective
Second vertical slice of the New Item Types epic for Android. Adds the Driver's License cipher type's Add/Edit form, View screen, vault listing entry, search support, and a single quick-copy overflow action ("Copy license number") on top of the Bank Account slice.
The vault list trailing action is a single quick-copy button gated on the SDK's
CopyableCipherFields.DRIVERS_LICENSE_*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 data model with split fields (
firstName/middleName/lastName, separateexpirationMonth/Day/Year,issuingCountry/issuingState).SDK dependency
The Bitwarden SDK (currently
2.0.0-6484-a19b6544) does not yet exposeCipherType.DRIVERS_LICENSE,CipherListViewType.DriversLicense, orCopyableCipherFields.DRIVERS_LICENSE_*. Affected sites carryTODO(PM-32009)markers documenting the additions required before this Story can ship to production. 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.