Skip to content

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

Draft
SaintPatrck wants to merge 5 commits intocard-scanner/3-card-scan-screenfrom
card-scanner/4-addedit-integration
Draft

[PM-34127] feat: Integrate card scanner with VaultAddEdit#6722
SaintPatrck wants to merge 5 commits intocard-scanner/3-card-scan-screenfrom
card-scanner/4-addedit-integration

Conversation

@SaintPatrck
Copy link
Copy Markdown
Contributor

@SaintPatrck SaintPatrck commented Mar 26, 2026

🎟️ 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.

@SaintPatrck SaintPatrck added the ai-review-vnext Request a Claude code review using the vNext workflow label Mar 26, 2026
@github-actions github-actions bot added app:password-manager Bitwarden Password Manager app context t:feature Change Type - Feature Development labels Mar 26, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Mar 26, 2026

🤖 Bitwarden Claude Code Review

Overall Assessment: APPROVE

Reviewed 8 changed files (+370/-5) integrating the card scanner with the VaultAddEdit screen. Changes span ViewModel logic (scan result handling, feature flag gating), Compose UI (scan button, focus management), navigation wiring, handlers, and comprehensive tests covering success/error/partial scans, flag toggling, permissions, and post-scan focus behavior.

Code Review Details

No issues found. The implementation follows all established codebase patterns:

  • Scan results flow correctly through CardScanManager to internal action to state update via updateCardContent, with null-coalescing to preserve existing field values on partial scans
  • Feature flag double-gated at both UI visibility (isCardScannerEnabled) and action handler (handleScanCardClick) layers with reactive flow subscription
  • FocusCardHolderName correctly implements DeferredBackgroundEvent to survive lifecycle filtering when navigating back from the card scan screen
  • Camera permission reuses the existing launcher pattern from the QR code scanner
  • toExpirationMonth() mapping covers all valid months with safe SELECT default for unrecognized values
  • Brand detection via detectCardBrand() with well-documented prefix overlap handling
  • Previous review suggestions (import ordering, additional screen tests) have been addressed

import com.bitwarden.vault.DecryptCipherListResult
import com.bitwarden.vault.FolderView
import com.x8bit.bitwarden.data.auth.repository.AuthRepository
import com.bitwarden.ui.platform.feature.cardscanner.manager.CardScanManager
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.

🔧 Suggested: Import ordering — the new com.bitwarden.ui.platform.feature.cardscanner.* imports are interspersed within the com.x8bit.bitwarden.* block (lines 28, 59, 67). They should be grouped with the other com.bitwarden.* imports above (lines 8–26) to maintain alphabetical ordering. Same issue in VaultUnlockedNavigation.kt (lines 62–63) and VaultAddEditViewModelTest.kt.

Running the IDE's "Optimize Imports" action should fix all of these.

onNavigateToGeneratorModal = { onNavigateToGeneratorModalType = it },
onNavigateToAttachments = { onNavigateToAttachmentsId = it },
onNavigateToMoveToOrganization = { id, _ -> onNavigateToMoveToOrganizationId = id },
onNavigateToCardScanScreen = {},
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.

💡 Suggested: Consider adding screen-level tests for the scan card button:

  • ScanCardButton is displayed when isCardScannerEnabled = true and cipher type is Card
  • ScanCardButton is NOT displayed when isCardScannerEnabled = false
  • NavigateToCardScan event triggers the onNavigateToCardScanScreen callback

The ViewModel tests cover the business logic well, but screen tests would verify the UI wiring end-to-end (button visibility, permission launcher, navigation callback).

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Mar 26, 2026

Logo
Checkmarx One – Scan Summary & Details7bcaf341-d3fb-4227-88bd-aac17fd5e3d5


New Issues (129) Checkmarx found the following issues in this Pull Request
# Severity Issue Source File / Package Checkmarx Insight
1 MEDIUM HttpOnly_Cookie_Flag_Not_Set /app/src/test/kotlin/com/x8bit/bitwarden/data/platform/datasource/disk/CookieDiskSourceTest.kt: 154
detailsThe web application's `clearCookies should remove all stored cookie configs` method creates a cookie Cookie, at line 154 of /app/src/test/kotlin/...
Attack Vector
2 MEDIUM HttpOnly_Cookie_Flag_Not_Set /app/src/test/kotlin/com/x8bit/bitwarden/data/platform/datasource/disk/CookieDiskSourceTest.kt: 148
detailsThe web application's `clearCookies should remove all stored cookie configs` method creates a cookie Cookie, at line 148 of /app/src/test/kotlin/...
Attack Vector
3 MEDIUM HttpOnly_Cookie_Flag_Not_Set /app/src/test/kotlin/com/x8bit/bitwarden/data/platform/manager/network/NetworkCookieManagerTest.kt: 229
detailsThe web application's Lambda method creates a cookie Cookie, at line 229 of /app/src/test/kotlin/com/x8bit/bitwarden/data/platform/manager/network/...
Attack Vector
4 MEDIUM HttpOnly_Cookie_Flag_Not_Set /app/src/test/kotlin/com/x8bit/bitwarden/data/platform/manager/network/NetworkCookieManagerTest.kt: 203
detailsThe web application's Lambda method creates a cookie Cookie, at line 203 of /app/src/test/kotlin/com/x8bit/bitwarden/data/platform/manager/network/...
Attack Vector
5 MEDIUM HttpOnly_Cookie_Flag_Not_Set /app/src/test/kotlin/com/x8bit/bitwarden/data/platform/manager/util/CookieConfigurationDataExtensionsTest.kt: 62
detailsThe web application's `toNetworkCookie should map name and value correctly` method creates a cookie Cookie, at line 62 of /app/src/test/kotlin/co...
Attack Vector
6 MEDIUM HttpOnly_Cookie_Flag_Not_Set /app/src/test/kotlin/com/x8bit/bitwarden/data/platform/manager/util/CookieConfigurationDataExtensionsTest.kt: 45
detailsThe web application's `toNetworkCookieList should map multiple cookies correctly` method creates a cookie Cookie, at line 45 of /app/src/test/kot...
Attack Vector
7 MEDIUM HttpOnly_Cookie_Flag_Not_Set /app/src/test/kotlin/com/x8bit/bitwarden/data/platform/manager/util/CookieConfigurationDataExtensionsTest.kt: 46
detailsThe web application's `toNetworkCookieList should map multiple cookies correctly` method creates a cookie Cookie, at line 46 of /app/src/test/kot...
Attack Vector
8 MEDIUM HttpOnly_Cookie_Flag_Not_Set /app/src/test/kotlin/com/x8bit/bitwarden/data/platform/manager/util/CookieConfigurationDataExtensionsTest.kt: 31
detailsThe web application's `toNetworkCookieList should map single cookie correctly` method creates a cookie Cookie, at line 31 of /app/src/test/kotlin...
Attack Vector
9 MEDIUM HttpOnly_Cookie_Flag_Not_Set /app/src/test/kotlin/com/x8bit/bitwarden/data/platform/datasource/disk/CookieDiskSourceTest.kt: 123
detailsThe web application's `storeCookieConfig with null should not affect other hostnames` method creates a cookie Cookie, at line 123 of /app/src/tes...
Attack Vector
10 MEDIUM HttpOnly_Cookie_Flag_Not_Set /app/src/test/kotlin/com/x8bit/bitwarden/data/platform/datasource/disk/CookieDiskSourceTest.kt: 103
detailsThe web application's `storeCookieConfig with null should remove stored config` method creates a cookie Cookie, at line 103 of /app/src/test/kotl...
Attack Vector
11 MEDIUM HttpOnly_Cookie_Flag_Not_Set /app/src/test/kotlin/com/x8bit/bitwarden/data/platform/datasource/disk/CookieDiskSourceTest.kt: 129
detailsThe web application's `storeCookieConfig with null should not affect other hostnames` method creates a cookie Cookie, at line 129 of /app/src/tes...
Attack Vector
12 MEDIUM HttpOnly_Cookie_Flag_Not_Set /app/src/test/kotlin/com/x8bit/bitwarden/data/platform/repository/util/CookieConfigurationDataExtensionsTest.kt: 12
detailsThe web application's `toAcquiredCookie should map Cookie to AcquiredCookie` method creates a cookie Cookie, at line 12 of /app/src/test/kotlin/c...
Attack Vector
13 MEDIUM HttpOnly_Cookie_Flag_Not_Set /app/src/test/kotlin/com/x8bit/bitwarden/data/platform/repository/util/AcquiredCookieExtensionsTest.kt: 39
detailsThe web application's `toConfigurationDataCookies should map list of AcquiredCookie to list of Cookie` method creates a cookie Cookie, at line 39...
Attack Vector
14 MEDIUM HttpOnly_Cookie_Flag_Not_Set /app/src/test/kotlin/com/x8bit/bitwarden/data/platform/repository/util/CookieConfigurationDataExtensionsTest.kt: 31
detailsThe web application's `toAcquiredCookiesList should map list of Cookie to list of AcquiredCookie` method creates a cookie Cookie, at line 31 of /...
Attack Vector
15 MEDIUM HttpOnly_Cookie_Flag_Not_Set /app/src/test/kotlin/com/x8bit/bitwarden/data/platform/repository/util/AcquiredCookieExtensionsTest.kt: 20
detailsThe web application's `toConfigurationCookie should map AcquiredCookie to CookieConfigurationData Cookie` method creates a cookie Cookie, at line...
Attack Vector
16 MEDIUM HttpOnly_Cookie_Flag_Not_Set /app/src/test/kotlin/com/x8bit/bitwarden/data/platform/repository/util/AcquiredCookieExtensionsTest.kt: 40
detailsThe web application's `toConfigurationDataCookies should map list of AcquiredCookie to list of Cookie` method creates a cookie Cookie, at line 40...
Attack Vector
17 MEDIUM HttpOnly_Cookie_Flag_Not_Set /app/src/test/kotlin/com/x8bit/bitwarden/data/platform/repository/util/CookieConfigurationDataExtensionsTest.kt: 32
detailsThe web application's `toAcquiredCookiesList should map list of Cookie to list of AcquiredCookie` method creates a cookie Cookie, at line 32 of /...
Attack Vector
18 MEDIUM HttpOnly_Cookie_Flag_Not_Set /app/src/test/kotlin/com/x8bit/bitwarden/data/platform/datasource/sdk/ServerCommunicationConfigRepositoryTest.kt: 156
detailsThe web application's Lambda method creates a cookie Cookie, at line 156 of /app/src/test/kotlin/com/x8bit/bitwarden/data/platform/datasource/sdk/S...
Attack Vector
19 MEDIUM HttpOnly_Cookie_Flag_Not_Set /app/src/test/kotlin/com/x8bit/bitwarden/data/platform/datasource/sdk/ServerCommunicationConfigRepositoryTest.kt: 71
detailsThe web application's Lambda method creates a cookie Cookie, at line 71 of /app/src/test/kotlin/com/x8bit/bitwarden/data/platform/datasource/sdk/Se...
Attack Vector
20 MEDIUM HttpOnly_Cookie_Flag_Not_Set /app/src/test/kotlin/com/x8bit/bitwarden/data/platform/datasource/sdk/ServerCommunicationConfigRepositoryTest.kt: 72
detailsThe web application's Lambda method creates a cookie Cookie, at line 72 of /app/src/test/kotlin/com/x8bit/bitwarden/data/platform/datasource/sdk/Se...
Attack Vector
21 MEDIUM HttpOnly_Cookie_Flag_Not_Set /app/src/test/kotlin/com/x8bit/bitwarden/data/platform/datasource/sdk/ServerCommunicationConfigRepositoryTest.kt: 157
detailsThe web application's Lambda method creates a cookie Cookie, at line 157 of /app/src/test/kotlin/com/x8bit/bitwarden/data/platform/datasource/sdk/S...
Attack Vector
22 MEDIUM HttpOnly_Cookie_Flag_Not_Set /app/src/test/kotlin/com/x8bit/bitwarden/data/platform/datasource/disk/CookieDiskSourceTest.kt: 189
detailsThe web application's `storage should isolate configs by hostname` method creates a cookie Cookie, at line 189 of /app/src/test/kotlin/com/x8bit/...
Attack Vector
23 MEDIUM HttpOnly_Cookie_Flag_Not_Set /app/src/test/kotlin/com/x8bit/bitwarden/data/platform/datasource/disk/CookieDiskSourceTest.kt: 180
detailsThe web application's `storage should isolate configs by hostname` method creates a cookie Cookie, at line 180 of /app/src/test/kotlin/com/x8bit/...
Attack Vector
24 MEDIUM HttpOnly_Cookie_Flag_Not_Set /app/src/test/kotlin/com/x8bit/bitwarden/data/platform/datasource/disk/CookieDiskSourceTest.kt: 81
detailsThe web application's `storage should handle cookies with multiple values` method creates a cookie Cookie, at line 81 of /app/src/test/kotlin/com...
Attack Vector
25 MEDIUM HttpOnly_Cookie_Flag_Not_Set /app/src/test/kotlin/com/x8bit/bitwarden/data/platform/datasource/disk/CookieDiskSourceTest.kt: 85
detailsThe web application's `storage should handle cookies with multiple values` method creates a cookie Cookie, at line 85 of /app/src/test/kotlin/com...
Attack Vector
26 MEDIUM HttpOnly_Cookie_Flag_Not_Set /app/src/test/kotlin/com/x8bit/bitwarden/data/platform/datasource/disk/CookieDiskSourceTest.kt: 61
detailsThe web application's `storeCookieConfig should update existing config` method creates a cookie Cookie, at line 61 of /app/src/test/kotlin/com/x8...
Attack Vector
27 MEDIUM HttpOnly_Cookie_Flag_Not_Set /app/src/test/kotlin/com/x8bit/bitwarden/data/platform/datasource/disk/CookieDiskSourceTest.kt: 51
detailsThe web application's `storeCookieConfig should update existing config` method creates a cookie Cookie, at line 51 of /app/src/test/kotlin/com/x8...
Attack Vector
28 MEDIUM HttpOnly_Cookie_Flag_Not_Set /app/src/test/kotlin/com/x8bit/bitwarden/data/platform/datasource/disk/CookieDiskSourceTest.kt: 32
detailsThe web application's `storeCookieConfig should persist config and getCookieConfig should retrieve it` method creates a cookie Cookie, at line 32...
Attack Vector
29 MEDIUM Privacy_Violation /app/src/test/kotlin/com/x8bit/bitwarden/data/vault/datasource/sdk/model/CipherViewUtil.kt: 98
detailsMethod createMockCipherView at line 98 of /app/src/test/kotlin/com/x8bit/bitwarden/data/vault/datasource/sdk/model/CipherViewUtil.kt sends user in...
Attack Vector
30 MEDIUM Privacy_Violation /app/src/test/kotlin/com/x8bit/bitwarden/ui/tools/feature/generator/passwordhistory/PasswordHistoryViewModelTest.kt: 203
detailsMethod Lambda at line 203 of /app/src/test/kotlin/com/x8bit/bitwarden/ui/tools/feature/generator/passwordhistory/PasswordHistoryViewModelTest.kt s...
Attack Vector
31 MEDIUM Privacy_Violation /app/src/test/kotlin/com/x8bit/bitwarden/ui/tools/feature/send/addedit/AddEditSendViewModelTest.kt: 1202
detailsMethod Lambda at line 1202 of /app/src/test/kotlin/com/x8bit/bitwarden/ui/tools/feature/send/addedit/AddEditSendViewModelTest.kt sends user inform...
Attack Vector
32 MEDIUM Privacy_Violation /testharness/src/test/kotlin/com/bitwarden/testharness/ui/platform/feature/createpassword/CreatePasswordViewModelTest.kt: 429
detailsMethod Lambda at line 429 of /testharness/src/test/kotlin/com/bitwarden/testharness/ui/platform/feature/createpassword/CreatePasswordViewModelTest...
Attack Vector
33 MEDIUM Privacy_Violation /testharness/src/test/kotlin/com/bitwarden/testharness/ui/platform/feature/createpassword/CreatePasswordViewModelTest.kt: 386
detailsMethod Lambda at line 386 of /testharness/src/test/kotlin/com/bitwarden/testharness/ui/platform/feature/createpassword/CreatePasswordViewModelTest...
Attack Vector
34 MEDIUM Privacy_Violation /testharness/src/test/kotlin/com/bitwarden/testharness/ui/platform/feature/createpassword/CreatePasswordViewModelTest.kt: 402
detailsMethod Lambda at line 402 of /testharness/src/test/kotlin/com/bitwarden/testharness/ui/platform/feature/createpassword/CreatePasswordViewModelTest...
Attack Vector
35 MEDIUM Privacy_Violation /testharness/src/test/kotlin/com/bitwarden/testharness/ui/platform/feature/createpassword/CreatePasswordViewModelTest.kt: 334
detailsMethod Lambda at line 334 of /testharness/src/test/kotlin/com/bitwarden/testharness/ui/platform/feature/createpassword/CreatePasswordViewModelTest...
Attack Vector
36 MEDIUM Privacy_Violation /testharness/src/test/kotlin/com/bitwarden/testharness/ui/platform/feature/createpassword/CreatePasswordViewModelTest.kt: 305
detailsMethod Lambda at line 305 of /testharness/src/test/kotlin/com/bitwarden/testharness/ui/platform/feature/createpassword/CreatePasswordViewModelTest...
Attack Vector
37 MEDIUM Privacy_Violation /testharness/src/test/kotlin/com/bitwarden/testharness/ui/platform/feature/createpassword/CreatePasswordViewModelTest.kt: 237
detailsMethod Lambda at line 237 of /testharness/src/test/kotlin/com/bitwarden/testharness/ui/platform/feature/createpassword/CreatePasswordViewModelTest...
Attack Vector
38 MEDIUM Privacy_Violation /testharness/src/test/kotlin/com/bitwarden/testharness/ui/platform/feature/createpassword/CreatePasswordViewModelTest.kt: 265
detailsMethod Lambda at line 265 of /testharness/src/test/kotlin/com/bitwarden/testharness/ui/platform/feature/createpassword/CreatePasswordViewModelTest...
Attack Vector
39 MEDIUM Privacy_Violation /testharness/src/test/kotlin/com/bitwarden/testharness/ui/platform/feature/createpassword/CreatePasswordViewModelTest.kt: 170
detailsMethod Lambda at line 170 of /testharness/src/test/kotlin/com/bitwarden/testharness/ui/platform/feature/createpassword/CreatePasswordViewModelTest...
Attack Vector
40 MEDIUM Privacy_Violation /testharness/src/test/kotlin/com/bitwarden/testharness/ui/platform/feature/createpassword/CreatePasswordViewModelTest.kt: 206
detailsMethod Lambda at line 206 of /testharness/src/test/kotlin/com/bitwarden/testharness/ui/platform/feature/createpassword/CreatePasswordViewModelTest...
Attack Vector
41 MEDIUM Privacy_Violation /testharness/src/test/kotlin/com/bitwarden/testharness/ui/platform/feature/createpassword/CreatePasswordViewModelTest.kt: 110
detailsMethod Lambda at line 110 of /testharness/src/test/kotlin/com/bitwarden/testharness/ui/platform/feature/createpassword/CreatePasswordViewModelTest...
Attack Vector
42 MEDIUM Privacy_Violation /testharness/src/test/kotlin/com/bitwarden/testharness/ui/platform/feature/createpassword/CreatePasswordViewModelTest.kt: 90
detailsMethod Lambda at line 90 of /testharness/src/test/kotlin/com/bitwarden/testharness/ui/platform/feature/createpassword/CreatePasswordViewModelTest....
Attack Vector
43 MEDIUM Privacy_Violation /testharness/src/test/kotlin/com/bitwarden/testharness/ui/platform/feature/createpassword/CreatePasswordViewModelTest.kt: 70
detailsMethod Lambda at line 70 of /testharness/src/test/kotlin/com/bitwarden/testharness/ui/platform/feature/createpassword/CreatePasswordViewModelTest....
Attack Vector
44 MEDIUM Privacy_Violation /app/src/test/kotlin/com/x8bit/bitwarden/ui/vault/feature/exportitems/verifypassword/VerifyPasswordViewModelTest.kt: 482
detailsMethod Lambda at line 482 of /app/src/test/kotlin/com/x8bit/bitwarden/ui/vault/feature/exportitems/verifypassword/VerifyPasswordViewModelTest.kt s...
Attack Vector
45 MEDIUM Privacy_Violation /app/src/test/kotlin/com/x8bit/bitwarden/ui/auth/feature/completeregistration/CompleteRegistrationViewModelTest.kt: 585
detailsMethod Lambda at line 585 of /app/src/test/kotlin/com/x8bit/bitwarden/ui/auth/feature/completeregistration/CompleteRegistrationViewModelTest.kt se...
Attack Vector
46 MEDIUM Privacy_Violation /app/src/test/kotlin/com/x8bit/bitwarden/ui/auth/feature/vaultunlock/VaultUnlockViewModelTest.kt: 796
detailsMethod `on UnlockClick for password unlock should display error dialog on AuthenticationError` at line 796 of /app/src/test/kotlin/com/x8bit/bitw...
Attack Vector
47 MEDIUM Privacy_Violation /app/src/test/kotlin/com/x8bit/bitwarden/ui/platform/feature/settings/accountsecurity/deleteaccount/DeleteAccountViewModelTest.kt: 175
detailsMethod Lambda at line 175 of /app/src/test/kotlin/com/x8bit/bitwarden/ui/platform/feature/settings/accountsecurity/deleteaccount/DeleteAccountViewM...
Attack Vector
48 MEDIUM Privacy_Violation /app/src/test/kotlin/com/x8bit/bitwarden/data/vault/datasource/sdk/model/CipherViewUtil.kt: 61
detailsMethod Lambda at line 61 of /app/src/test/kotlin/com/x8bit/bitwarden/data/vault/datasource/sdk/model/CipherViewUtil.kt sends user information outs...
Attack Vector
49 MEDIUM Privacy_Violation /app/src/test/kotlin/com/x8bit/bitwarden/data/vault/datasource/sdk/model/CipherViewUtil.kt: 61
detailsMethod Lambda at line 61 of /app/src/test/kotlin/com/x8bit/bitwarden/data/vault/datasource/sdk/model/CipherViewUtil.kt sends user information outs...
Attack Vector
50 MEDIUM Privacy_Violation /app/src/test/kotlin/com/x8bit/bitwarden/data/vault/datasource/sdk/model/CipherViewUtil.kt: 125
detailsMethod createMockLoginView at line 125 of /app/src/test/kotlin/com/x8bit/bitwarden/data/vault/datasource/sdk/model/CipherViewUtil.kt sends user in...
Attack Vector
51 MEDIUM Privacy_Violation /app/src/test/kotlin/com/x8bit/bitwarden/data/credentials/model/Fido2CredentialAssertionRequestUtil.kt: 12
detailsMethod createMockFido2CredentialAssertionRequest at line 12 of /app/src/test/kotlin/com/x8bit/bitwarden/data/credentials/model/Fido2CredentialAsser...
Attack Vector
52 MEDIUM Privacy_Violation /app/src/test/kotlin/com/x8bit/bitwarden/ui/platform/feature/settings/accountsecurity/loginapproval/LoginApprovalViewModelTest.kt: 307
detailsMethod Lambda at line 307 of /app/src/test/kotlin/com/x8bit/bitwarden/ui/platform/feature/settings/accountsecurity/loginapproval/LoginApprovalViewM...
Attack Vector
53 MEDIUM Privacy_Violation /app/src/test/kotlin/com/x8bit/bitwarden/ui/platform/feature/settings/accountsecurity/loginapproval/LoginApprovalViewModelTest.kt: 376
detailsMethod Lambda at line 376 of /app/src/test/kotlin/com/x8bit/bitwarden/ui/platform/feature/settings/accountsecurity/loginapproval/LoginApprovalViewM...
Attack Vector
54 MEDIUM Privacy_Violation /app/src/test/kotlin/com/x8bit/bitwarden/ui/platform/feature/settings/accountsecurity/loginapproval/LoginApprovalViewModelTest.kt: 150
detailsMethod `on ApproveAccountChangeClick dialog state should be cleared, user should be switched, and getAuthRequestByIdFlow should be called` at lin...
Attack Vector
55 MEDIUM Privacy_Violation /app/src/test/kotlin/com/x8bit/bitwarden/ui/auth/feature/completeregistration/CompleteRegistrationViewModelTest.kt: 687
detailsMethod at line 687 of /app/src/test/kotlin/com/x8bit/bitwarden/ui/auth/feature/completeregistration/CompleteRegistrationViewModelTest.kt sends us...
Attack Vector
56 MEDIUM Privacy_Violation /app/src/test/kotlin/com/x8bit/bitwarden/ui/auth/feature/completeregistration/CompleteRegistrationViewModelTest.kt: 675
detailsMethod at line 675 of /app/src/test/kotlin/com/x8bit/bitwarden/ui/auth/feature/completeregistration/CompleteRegistrationViewModelTest.kt sends us...
Attack Vector
57 MEDIUM Privacy_Violation /app/src/test/kotlin/com/x8bit/bitwarden/ui/auth/feature/completeregistration/CompleteRegistrationViewModelTest.kt: 330
detailsMethod Lambda at line 330 of /app/src/test/kotlin/com/x8bit/bitwarden/ui/auth/feature/completeregistration/CompleteRegistrationViewModelTest.kt se...
Attack Vector
58 MEDIUM Privacy_Violation /app/src/test/kotlin/com/x8bit/bitwarden/ui/auth/feature/completeregistration/CompleteRegistrationViewModelTest.kt: 362
detailsMethod Lambda at line 362 of /app/src/test/kotlin/com/x8bit/bitwarden/ui/auth/feature/completeregistration/CompleteRegistrationViewModelTest.kt se...
Attack Vector
59 MEDIUM Privacy_Violation /app/src/test/kotlin/com/x8bit/bitwarden/ui/auth/feature/completeregistration/CompleteRegistrationViewModelTest.kt: 446
detailsMethod Lambda at line 446 of /app/src/test/kotlin/com/x8bit/bitwarden/ui/auth/feature/completeregistration/CompleteRegistrationViewModelTest.kt se...
Attack Vector
60 MEDIUM Privacy_Violation /app/src/test/kotlin/com/x8bit/bitwarden/data/vault/datasource/sdk/model/CipherViewUtil.kt: 77
detailsMethod Lambda at line 77 of /app/src/test/kotlin/com/x8bit/bitwarden/data/vault/datasource/sdk/model/CipherViewUtil.kt sends user information outs...
Attack Vector
61 MEDIUM Privacy_Violation /app/src/test/kotlin/com/x8bit/bitwarden/data/vault/datasource/sdk/model/CipherViewUtil.kt: 77
detailsMethod Lambda at line 77 of /app/src/test/kotlin/com/x8bit/bitwarden/data/vault/datasource/sdk/model/CipherViewUtil.kt sends user information outs...
Attack Vector
62 MEDIUM Use_of_Hardcoded_Password /app/src/test/kotlin/com/x8bit/bitwarden/ui/vault/feature/item/VaultItemScreenTest.kt: 147
detailsThe application uses the hard-coded password "cipherId1234" for authentication purposes, either using it to verify users' identities, or to access...
Attack Vector
63 MEDIUM Use_of_Hardcoded_Password /app/src/test/kotlin/com/x8bit/bitwarden/ui/vault/feature/attachments/AttachmentsViewModelTest.kt: 506
detailsThe application uses the hard-coded password "mockId-1" for authentication purposes, either using it to verify users' identities, or to access an...
Attack Vector
64 MEDIUM Use_of_Hardcoded_Password /app/src/test/kotlin/com/x8bit/bitwarden/data/platform/manager/sdk/repository/SdkCipherRepositoryTest.kt: 205
detailsThe application uses the hard-coded password "cipherId" for authentication purposes, either using it to verify users' identities, or to access ano...
Attack Vector
65 MEDIUM Use_of_Hardcoded_Password /app/src/test/kotlin/com/x8bit/bitwarden/ui/tools/feature/send/addedit/AddEditSendViewModelTest.kt: 573
detailsThe application uses the hard-coded password "some-password" for authentication purposes, either using it to verify users' identities, or to acce...
Attack Vector
66 MEDIUM Use_of_Hardcoded_Password /app/src/test/kotlin/com/x8bit/bitwarden/ui/platform/feature/rootnav/RootNavViewModelTest.kt: 772
detailsThe application uses the hard-coded password "testPassword123" for authentication purposes, either using it to verify users' identities, or to acc...
Attack Vector
67 MEDIUM Use_of_Hardcoded_Password /app/src/test/kotlin/com/x8bit/bitwarden/data/vault/manager/VaultLockManagerTest.kt: 2011
detailsThe application uses the hard-coded password "mockValue" for authentication purposes, either using it to verify users' identities, or to access an...
Attack Vector
68 MEDIUM Use_of_Hardcoded_Password /app/src/test/kotlin/com/x8bit/bitwarden/data/vault/manager/VaultLockManagerTest.kt: 1955
detailsThe application uses the hard-coded password "mockValue" for authentication purposes, either using it to verify users' identities, or to access an...
Attack Vector
69 MEDIUM Use_of_Hardcoded_Password /app/src/test/kotlin/com/x8bit/bitwarden/data/vault/manager/VaultLockManagerTest.kt: 1354
detailsThe application uses the hard-coded password "mockValue" for authentication purposes, either using it to verify users' identities, or to access an...
Attack Vector

More results are available on the CxOne platform

@codecov
Copy link
Copy Markdown

codecov bot commented Mar 26, 2026

Codecov Report

❌ Patch coverage is 71.42857% with 28 lines in your changes missing coverage. Please review.
✅ Project coverage is 85.63%. Comparing base (122be85) to head (31ae25f).

Files with missing lines Patch % Lines
.../ui/vault/feature/addedit/VaultAddEditViewModel.kt 71.87% 2 Missing and 16 partials ⚠️
...i/vault/feature/addedit/VaultAddEditItemContent.kt 28.57% 4 Missing and 1 partial ⚠️
...e/addedit/handlers/VaultAddEditCardTypeHandlers.kt 40.00% 3 Missing ⚠️
...ui/vault/feature/addedit/VaultAddEditNavigation.kt 0.00% 1 Missing ⚠️
...den/ui/vault/feature/addedit/VaultAddEditScreen.kt 88.88% 1 Missing ⚠️
Additional details and impacted files
@@                         Coverage Diff                         @@
##           card-scanner/3-card-scan-screen    #6722      +/-   ##
===================================================================
- Coverage                            85.64%   85.63%   -0.01%     
===================================================================
  Files                                  955      955              
  Lines                                60595    60691      +96     
  Branches                              8598     8628      +30     
===================================================================
+ Hits                                 51895    51974      +79     
+ Misses                                5695     5694       -1     
- Partials                              3005     3023      +18     
Flag Coverage Δ
app-data 17.83% <0.00%> (-0.02%) ⬇️
app-ui-auth-tools 20.82% <0.00%> (-0.03%) ⬇️
app-ui-platform 15.55% <0.00%> (-0.03%) ⬇️
app-ui-vault 27.00% <71.42%> (+0.07%) ⬆️
authenticator 6.52% <0.00%> (-0.02%) ⬇️
lib-core-network-bridge 4.22% <0.00%> (-0.01%) ⬇️
lib-data-ui 1.04% <0.00%> (-0.01%) ⬇️

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 card-scanner/4-addedit-integration branch from 583a110 to 7c9d521 Compare March 26, 2026 12:56
Comment on lines +62 to +63
import com.x8bit.bitwarden.ui.vault.feature.cardscanner.cardScanDestination
import com.x8bit.bitwarden.ui.vault.feature.cardscanner.navigateToCardScanScreen
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.

🔧 Suggestion: Imports are not in alphabetical order. The cardscanner imports should come before importlogins (line 57) to maintain consistent import sorting with the rest of the file.

Suggested change
import com.x8bit.bitwarden.ui.vault.feature.cardscanner.cardScanDestination
import com.x8bit.bitwarden.ui.vault.feature.cardscanner.navigateToCardScanScreen
import com.x8bit.bitwarden.ui.vault.feature.cardscanner.cardScanDestination
import com.x8bit.bitwarden.ui.vault.feature.cardscanner.navigateToCardScanScreen
import com.x8bit.bitwarden.ui.vault.feature.manualcodeentry.navigateToManualCodeEntryScreen

Move these two lines up before the importlogins imports (before line 57).

@SaintPatrck SaintPatrck force-pushed the card-scanner/4-addedit-integration branch from 7c9d521 to 204305e Compare March 26, 2026 13:19
@SaintPatrck SaintPatrck added the innovation Feature work related to Innovation Sprint or BEEEP projects label Mar 27, 2026
),
),
)
val content = viewModel.stateFlow.value.viewState
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Can we just assert against the entire state

@SaintPatrck SaintPatrck force-pushed the card-scanner/3-card-scan-screen branch from be951b7 to ff88fbb Compare April 1, 2026 14:10
@SaintPatrck SaintPatrck force-pushed the card-scanner/4-addedit-integration branch from 204305e to ca82c3b Compare April 1, 2026 14:10
@SaintPatrck SaintPatrck added the hold do not merge yet label Apr 1, 2026
@github-actions github-actions bot added the app:authenticator Bitwarden Authenticator app context label Apr 1, 2026
Wire the card scanner into the card cipher add/edit flow:
- VaultAddEditViewModel: inject CardScanManager, handle scan results,
  populate card fields with brand-aware CVV validation
- VaultAddEditScreen: pass scanner enabled state and click handler
- VaultAddEditCardItems: conditionally render Scan Card button
- VaultUnlockedNavigation: register card scan route
Cardholder name OCR detection is unreliable. Remove name from
scan results and instead focus the name field after a successful
scan so the user can type it manually.
Prepares for rebase onto branch 2 which removes default
parameter values from CardScanData.
FocusCardHolderName was being dropped by EventsEffect lifecycle
filter during navigation back from card scan. Using
DeferredBackgroundEvent ensures the event survives the filter and
executes once the screen reaches RESUMED state. Also explicitly
show the keyboard via SoftwareKeyboardController.
@SaintPatrck SaintPatrck force-pushed the card-scanner/4-addedit-integration branch from 21a7f1a to 31ae25f Compare April 1, 2026 18:21
@github-actions github-actions bot removed the app:authenticator Bitwarden Authenticator app context label Apr 1, 2026
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:password-manager Bitwarden Password Manager app context hold do not merge yet innovation Feature work related to Innovation Sprint or BEEEP projects t:feature Change Type - Feature Development

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants