Skip to content

[PM-32808] feat: Add Driver's License vault, listing, and search surfaces#6909

Draft
SaintPatrck wants to merge 1 commit into
new-item-types/PM-32808_drivers-license-add-editfrom
new-item-types/PM-32808_drivers-license-vault-integration
Draft

[PM-32808] feat: Add Driver's License vault, listing, and search surfaces#6909
SaintPatrck wants to merge 1 commit into
new-item-types/PM-32808_drivers-license-add-editfrom
new-item-types/PM-32808_drivers-license-vault-integration

Conversation

@SaintPatrck
Copy link
Copy Markdown
Contributor

@SaintPatrck SaintPatrck commented May 11, 2026

🎟️ Tracking

📔 Objective

Integrates the Driver's License cipher type into the broader vault surfaces so users can discover and act on license entries outside of direct navigation. Adds the License section on the vault landing (count + tappable row using the Identity icon), enables the Licenses listing screen, surfaces licenses in vault search results, and emits the "Copy license number" quick action in the listing-row overflow menu (driven by CopyableCipherFields.DRIVERS_LICENSE_LICENSE_NUMBER).

📸 Screenshots

@SaintPatrck SaintPatrck added the ai-review-vnext Request a Claude code review using the vNext workflow label May 11, 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 May 11, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 11, 2026

🤖 Bitwarden Claude Code Review

Overall Assessment: APPROVE

This PR integrates the Driver's License cipher type into the vault landing, item listing, and search surfaces, mirroring the established Bank Account pattern. The wiring is consistent across SearchableItemType/SearchType/SearchTypeData, VaultItemListingType/ItemListingType, and the VaultState.Content model, with feature-flag gating via isNewItemTypesEnabled and SDK-gating via CopyableCipherFields.DRIVERS_LICENSE_LICENSE_NUMBER. The "Copy license number" overflow handler is intentionally a no-op pending the SDK exposing DriversLicenseView on CipherView, with explicit TODO(PM-32009) comments and parity tests asserting the no-op behavior.

Code Review Details
  • ♻️ : Test parity gap for new CopyLicenseNumberClick overflow and DriversLicense predicates vs. Bank Account pattern
    • app/src/main/kotlin/com/x8bit/bitwarden/ui/vault/feature/util/CipherListViewExtensions.kt:98-108
  • ♻️ : New ic_drivers_license.xml drawable is unused; vault row renders with BitwardenDrawable.ic_id_card (existing thread)
    • ui/src/main/res/drawable/ic_drivers_license.xml:1-10

Comment on lines +1 to +10
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24">
<path
android:pathData="M20,4H4C2.9,4 2,4.9 2,6V18C2,19.1 2.9,20 4,20H20C21.1,20 22,19.1 22,18V6C22,4.9 21.1,4 20,4ZM20,18H4V6H20V18ZM8,12C9.1,12 10,11.1 10,10C10,8.9 9.1,8 8,8C6.9,8 6,8.9 6,10C6,11.1 6.9,12 8,12ZM8,9.5C8.28,9.5 8.5,9.72 8.5,10C8.5,10.28 8.28,10.5 8,10.5C7.72,10.5 7.5,10.28 7.5,10C7.5,9.72 7.72,9.5 8,9.5ZM4,16.5V15C4,13.67 6.67,13 8,13C9.33,13 12,13.67 12,15V16.5H4ZM5.85,15H10.15C9.61,14.57 8.62,14.5 8,14.5C7.38,14.5 6.39,14.57 5.85,15ZM13,9H18V10.5H13V9ZM13,12H17V13.5H13V12Z"
android:fillColor="#175DDC"
android:fillType="evenOdd"/>
</vector>
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

♻️ DEBT: New drawable is unused — driver's license rows are rendered with BitwardenDrawable.ic_id_card.

Details

VaultContent.kt:303-305 uses BitwardenDrawable.ic_id_card for the driver's license group icon (consistent with the PR description: "tappable row using the Identity icon"), and a repo-wide search finds no other references to ic_drivers_license. The new resource ships in the APK without being rendered anywhere.

Additionally, the asset hard-codes android:fillColor="#175DDC" rather than using the themed tint that sibling icons like ic_id_card rely on, so even if it were wired in it would not theme correctly across light/dark modes.

Either remove the drawable, or wire it into the driver's license group (VaultContent.kt) plus any other surfaces that should distinguish licenses from identities, and convert the fill to a theme attribute.

@codecov
Copy link
Copy Markdown

codecov Bot commented May 11, 2026

Codecov Report

❌ Patch coverage is 60.81081% with 29 lines in your changes missing coverage. Please review.
⚠️ Please upload report for BASE (new-item-types/PM-32808_drivers-license-add-edit@1eeba27). Learn more about missing BASE report.

Files with missing lines Patch % Lines
...ure/itemlisting/model/ListingItemOverflowAction.kt 0.00% 6 Missing ⚠️
...temlisting/util/VaultItemListingStateExtensions.kt 0.00% 2 Missing and 2 partials ⚠️
.../ui/vault/feature/util/CipherListViewExtensions.kt 42.85% 2 Missing and 2 partials ⚠️
...rm/feature/search/util/SearchTypeDataExtensions.kt 0.00% 2 Missing and 1 partial ⚠️
...itemlisting/util/VaultItemListingDataExtensions.kt 66.66% 1 Missing and 2 partials ⚠️
...rden/ui/platform/feature/search/SearchViewModel.kt 60.00% 2 Missing ⚠️
...t/feature/itemlisting/VaultItemListingViewModel.kt 66.66% 1 Missing and 1 partial ⚠️
...bitwarden/ui/vault/feature/vault/VaultViewModel.kt 71.42% 1 Missing and 1 partial ⚠️
...atform/feature/search/util/SearchTypeExtensions.kt 0.00% 1 Missing ⚠️
...n/ui/vault/feature/vault/handlers/VaultHandlers.kt 66.66% 1 Missing ⚠️
... and 1 more
Additional details and impacted files
@@                                 Coverage Diff                                 @@
##             new-item-types/PM-32808_drivers-license-add-edit    #6909   +/-   ##
===================================================================================
  Coverage                                                    ?   85.44%           
===================================================================================
  Files                                                       ?      857           
  Lines                                                       ?    61536           
  Branches                                                    ?     8959           
===================================================================================
  Hits                                                        ?    52582           
  Misses                                                      ?     5880           
  Partials                                                    ?     3074           
Flag Coverage Δ
app-data 17.34% <0.00%> (?)
app-ui-auth-tools 19.61% <0.00%> (?)
app-ui-platform 15.51% <11.94%> (?)
app-ui-vault 26.65% <59.70%> (?)
authenticator 6.41% <0.00%> (?)
lib-core-network-bridge 4.11% <0.00%> (?)
lib-data-ui 1.14% <0.00%> (?)

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-32808_drivers-license-vault-integration branch from 3d25b0c to 1b2216c Compare May 11, 2026 21:20
@SaintPatrck SaintPatrck force-pushed the new-item-types/PM-32808_drivers-license-add-edit branch from 82a1975 to 1eeba27 Compare May 11, 2026 21:20
Comment on lines +98 to +108
ListingItemOverflowAction.VaultAction
.CopyLicenseNumberClick(
cipherId = cipherId,
requiresPasswordReprompt = hasMasterPassword,
)
.takeIf {
this.type is CipherListViewType.DriversLicense &&
this.copyableFields.contains(
CopyableCipherFields.DRIVERS_LICENSE_LICENSE_NUMBER,
)
},
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

♻️ DEBT: New CopyLicenseNumberClick overflow branch and matching CipherListViewType.DriversLicense listing/search predicates are not exercised by tests, breaking parity with the established Bank Account pattern.

Details

The sibling CipherListViewType.BankAccount path has four dedicated tests in CipherListViewExtensionsTest.kt (lines 363–469): "return all copy actions", "return only available copy actions", "return minimum actions", and "should not return bank-account copy actions for non-bank ciphers". The Driver's License path adds the same shape of business logic — a typed .takeIf predicate that gates a copy action on CopyableCipherFields.DRIVERS_LICENSE_LICENSE_NUMBER — but adds zero corresponding tests.

The same gap exists for:

  • VaultItemListingDataExtensions.kt:85-87 (new Vault.DriversLicense predicate) — VaultItemListingDataExtensionsTest.kt covers the BankAccount predicate at line 403 but no DriversLicense equivalent.
  • SearchTypeDataExtensions.kt:134-136 (new Vault.DriversLicenses filter and updateWithAdditionalDataIfNecessary branch) — SearchTypeDataExtensionsTest.kt covers BankAccounts at lines 246 and 392, no DriversLicenses equivalent.
  • VaultScreenTest.kt (new showDriversLicenseGroup rendering and DriversLicenseGroupClick dispatch) — the equivalent Bank Account tests live at lines 2504–2540 and would be straightforward to mirror.

Without these, regressions to the new predicate gating (e.g., flipping the CipherListViewType.DriversLicense check or removing the copyableFields requirement) would not be caught by CI.

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