[PR #6722] [PM-34127] feat: Integrate card scanner with VaultAddEdit #12962

Closed
opened 2026-04-11 03:54:50 -05:00 by GiteaMirror · 0 comments
Owner

Original Pull Request: https://github.com/bitwarden/android/pull/6722

State: closed
Merged: Yes


🎟️ Tracking

https://bitwarden.atlassian.net/browse/PM-34127

📔 Objective

Integrate the card scanner with the VaultAddEdit screen:

  • VaultAddEditViewModel: Collect CardScanManager results, map scanned card data to form fields (number, expiry, CVV, brand detection), and emit focus event for cardholder name input
  • VaultAddEditScreen: Add "Scan card" button for Card cipher types, gated behind card-scanner-mobile feature flag. After a successful scan, focus the cardholder name field and show the keyboard using DeferredBackgroundEvent to survive lifecycle filtering
  • VaultAddEditCardItems: New scan card row composable
  • VaultUnlockedNavigation: Wire CardScanScreen destination and navigation
  • Camera permission: Reuses existing launcher pattern from QR code scanner

Includes ViewModel and Screen tests for scan result handling, partial scans, feature flag gating, and post-scan focus behavior.

📸 Screenshots

Figma designs (based on iOS)

Permission dialog

image

Scan flow

**Original Pull Request:** https://github.com/bitwarden/android/pull/6722 **State:** closed **Merged:** Yes --- ## 🎟️ Tracking https://bitwarden.atlassian.net/browse/PM-34127 ## 📔 Objective Integrate the card scanner with the VaultAddEdit screen: - **VaultAddEditViewModel**: Collect `CardScanManager` results, map scanned card data to form fields (number, expiry, CVV, brand detection), and emit focus event for cardholder name input - **VaultAddEditScreen**: Add "Scan card" button for Card cipher types, gated behind `card-scanner-mobile` feature flag. After a successful scan, focus the cardholder name field and show the keyboard using `DeferredBackgroundEvent` to survive lifecycle filtering - **VaultAddEditCardItems**: New scan card row composable - **VaultUnlockedNavigation**: Wire `CardScanScreen` destination and navigation - **Camera permission**: Reuses existing launcher pattern from QR code scanner Includes ViewModel and Screen tests for scan result handling, partial scans, feature flag gating, and post-scan focus behavior. ## 📸 Screenshots ### Figma designs (based on iOS) <img width="365" src="https://github.com/user-attachments/assets/ad3f69c0-55b7-4f0f-8c72-e091b84efb31" /> ### Permission dialog <img width="348" height="241" alt="image" src="https://github.com/user-attachments/assets/e1b9bdf0-a590-4df5-9eb6-5e4ba001358c" /> ### Scan flow <video src="https://github.com/user-attachments/assets/3b67709f-474e-45c9-b0af-144f6bc2a392" width="365" />
GiteaMirror added the pull-request label 2026-04-11 03:54:50 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/android#12962