Skip to content

[PM-33989] [IS] feat: Implement card scanner#2494

Open
fedemkr wants to merge 18 commits intomainfrom
PM-33989/card-scanner
Open

[PM-33989] [IS] feat: Implement card scanner#2494
fedemkr wants to merge 18 commits intomainfrom
PM-33989/card-scanner

Conversation

@fedemkr
Copy link
Copy Markdown
Member

@fedemkr fedemkr commented Mar 25, 2026

🎟️ Tracking

PM-33989

📔 Objective

Make use of the camera and VisualKit APIs to simplify the process so the user can point the camera to the card and automatically grab all the details (card number, cardholder name, expiry date) from it filling it on the add card view fields.

If more than one cardholder name is detected by the OCR logic, then present a list of options to the user to choose from.

📸 Screenshots

Card.Scanner.Mar-31.MP4

@github-actions github-actions bot added app:password-manager Bitwarden Password Manager app context app:authenticator Bitwarden Authenticator app context labels Mar 25, 2026
@fedemkr fedemkr changed the title [PM-33989] [IS] Implement card scanner [PM-33989] [IS] feat: Implement card scanner Mar 25, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Mar 25, 2026

Logo
Checkmarx One – Scan Summary & Details5743bd75-075b-4794-87bc-512ad2e62a74

Great job! No new security vulnerabilities introduced in this pull request

@codecov
Copy link
Copy Markdown

codecov bot commented Mar 25, 2026

Codecov Report

❌ Patch coverage is 80.47138% with 116 lines in your changes missing coverage. Please review.
✅ Project coverage is 85.80%. Comparing base (daa621d) to head (c5e5144).

Files with missing lines Patch % Lines
.../AddEditItem/AddEditCardItem/CardScannerView.swift 0.00% 82 Missing ⚠️
...EditItem/AddEditCardItem/AddEditCardItemView.swift 0.00% 32 Missing ⚠️
...Shared/Core/Platform/Models/Enum/FeatureFlag.swift 0.00% 1 Missing ⚠️
...denShared/Core/Vault/Services/CardTextParser.swift 99.17% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2494      +/-   ##
==========================================
- Coverage   86.94%   85.80%   -1.14%     
==========================================
  Files        1857     2090     +233     
  Lines      163782   179123   +15341     
==========================================
+ Hits       142394   153702   +11308     
- Misses      21388    25421    +4033     

☔ 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.

@fedemkr fedemkr added the hold This shouldn't be merged yet label Mar 27, 2026
@fedemkr fedemkr added the enhancement New feature or request label Mar 30, 2026
@fedemkr fedemkr marked this pull request as ready for review March 30, 2026 16:32
@fedemkr fedemkr requested review from a team and matt-livefront as code owners March 30, 2026 16:32
@fedemkr fedemkr added innovation Feature work related to Innovation Sprint or BEEEP projects and removed enhancement New feature or request labels Mar 30, 2026
<string>Use Yubikeys for two-factor authentication.</string>
<key>NSCameraUsageDescription</key>
<string>Scan QR codes</string>
<string>Scan QR codes and payment cards</string>
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.

🤔 "Payment cards" sounds a bit weird to my ear here, but I don't have a better suggestion. Might be worth bouncing off of Product?

"SaveHere" = "Save here";
"SaveThisAuthenticatorKeyHereOrAddItToALoginInYourBitwardenApp" = "Save this authenticator key here, or add it to a login in your Bitwarden app.";
"SaveToBitwarden" = "Save to Bitwarden";
"ScanCard" = "Scan Card";
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.

🎨 Should this be title cased ("Scan Card") or sentence cased ("Scan card")?

final class DefaultCardTextParser: CardTextParser {
// MARK: Private Constants

/// Labels printed on cards that should not be interpreted as cardholder names.
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.

🤔 Are we going to need to expand this for non-English cards, too? I kinda wonder if there's some way we could pull this list out, and how we can keep it updated well, as we discover new strings for it.

)
}
}
case .scanCardButtonTapped:
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.

⛏️ I think these should be alphabetized

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

app:authenticator Bitwarden Authenticator app context app:password-manager Bitwarden Password Manager app context hold This shouldn't be merged yet innovation Feature work related to Innovation Sprint or BEEEP projects t:feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants