Skip to content

[PM-32808] feat: Add Driver's License item type#6852

Draft
SaintPatrck wants to merge 18 commits intomainfrom
new-item-types/PM-32808_drivers-license
Draft

[PM-32808] feat: Add Driver's License item type#6852
SaintPatrck wants to merge 18 commits intomainfrom
new-item-types/PM-32808_drivers-license

Conversation

@SaintPatrck
Copy link
Copy Markdown
Contributor

@SaintPatrck SaintPatrck commented Apr 29, 2026

🎟️ Tracking

PM-32808 — second Android Story under epic PM-32009 (New Item Types).

Stacked on #6851 (PM-32810 Bank Account). Review and merge order: PM-32810 → PM-32808 → PM-32806 → PM-34123 → PM-35396.

📔 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.subtitle stays SDK-owned.

This Android slice consumes the canonical phase-01-04 data model with split fields (firstName/middleName/lastName, separate expirationMonth/Day/Year, issuingCountry/issuingState).

SDK dependency

The Bitwarden SDK (currently 2.0.0-6484-a19b6544) does not yet expose CipherType.DRIVERS_LICENSE, CipherListViewType.DriversLicense, or CopyableCipherFields.DRIVERS_LICENSE_*. Affected sites carry TODO(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.

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.
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.
@SaintPatrck SaintPatrck added the ai-review-vnext Request a Claude code review using the vNext workflow label Apr 29, 2026
@github-actions github-actions Bot added app:password-manager Bitwarden Password Manager app context app:authenticator Bitwarden Authenticator app context t:feature Change Type - Feature Development labels Apr 29, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 29, 2026

🤖 Bitwarden Claude Code Review

Overall 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 TODO(PM-32009) markers documenting the exact follow-up needed once the SDK exposes CipherType.DRIVERS_LICENSE, CipherListViewType.DriversLicense, and CopyableCipherFields.DRIVERS_LICENSE_*. No correctness, security, or breaking-change concerns identified.

Code Review Details

No findings.

Notes for awareness (not actionable):

  • ui/src/main/res/drawable/ic_drivers_license.xml is added but cannot be wired into the CipherListViewType.iconRes extension yet because the SDK variant doesn't exist. This may surface an "Unused resource" lint warning until the SDK lands; this is intentional preparation matching the Bank Account precedent.
  • driversLicenseItemsCount is plumbed through VaultState.ViewState.Content but hard-coded to 0 until the SDK exposes CipherListViewType.DriversLicense. The TODO at app/src/main/kotlin/com/x8bit/bitwarden/ui/vault/feature/vault/util/VaultDataExtensions.kt documents the one-line replacement needed at SDK landing.
  • The three handleCopyLicenseNumberClick no-op stubs in SearchViewModel, VaultItemListingViewModel, and VaultViewModel are exercised by "should not call setText until SDK ships DriversLicenseView" tests, confirming the dispatcher path is wired end-to-end without crashing.

@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 29, 2026

Codecov Report

❌ Patch coverage is 21.00840% with 376 lines in your changes missing coverage. Please review.
✅ Project coverage is 84.45%. Comparing base (31c2c90) to head (a563225).

Files with missing lines Patch % Lines
...ult/feature/item/VaultItemDriversLicenseContent.kt 0.00% 180 Missing ⚠️
...feature/addedit/VaultAddEditDriversLicenseItems.kt 0.00% 115 Missing ⚠️
...handlers/VaultAddEditDriversLicenseTypeHandlers.kt 42.30% 30 Missing ⚠️
...bitwarden/ui/vault/feature/item/VaultItemScreen.kt 20.00% 8 Missing ⚠️
...ure/itemlisting/model/ListingItemOverflowAction.kt 0.00% 6 Missing ⚠️
...warden/ui/vault/feature/item/VaultItemViewModel.kt 73.68% 0 Missing and 5 partials ⚠️
...i/vault/feature/addedit/VaultAddEditItemContent.kt 0.00% 4 Missing ⚠️
...temlisting/util/VaultItemListingStateExtensions.kt 0.00% 2 Missing and 2 partials ⚠️
...den/ui/platform/feature/search/SearchNavigation.kt 25.00% 3 Missing ⚠️
...rm/feature/search/util/SearchTypeDataExtensions.kt 0.00% 2 Missing and 1 partial ⚠️
... and 9 more
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     
Flag Coverage Δ
app-data 17.20% <0.00%> (-0.14%) ⬇️
app-ui-auth-tools 19.68% <0.00%> (-0.16%) ⬇️
app-ui-platform 15.52% <1.06%> (-0.12%) ⬇️
app-ui-vault 25.73% <20.25%> (-0.03%) ⬇️
authenticator 6.46% <0.00%> (-0.08%) ⬇️
lib-core-network-bridge 4.16% <0.00%> (-0.06%) ⬇️
lib-data-ui 1.00% <0.00%> (-0.02%) ⬇️

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.

@SaintPatrck SaintPatrck force-pushed the new-item-types/PM-32810_bank-account branch 4 times, most recently from d90eebb to ac36549 Compare May 7, 2026 19:30
@SaintPatrck SaintPatrck force-pushed the new-item-types/PM-32810_bank-account branch from 87e68ce to 28d44ce Compare May 8, 2026 18:47
Base automatically changed from new-item-types/PM-32810_bank-account to main May 8, 2026 19:16
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:authenticator Bitwarden Authenticator app context app:password-manager Bitwarden Password Manager app context t:feature Change Type - Feature Development

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant