Skip to content

[PM-38145] feat: Add View Bank Account screen#2769

Open
SaintPatrck wants to merge 4 commits into
mainfrom
vault/pm-38145-ios-bank-account-view
Open

[PM-38145] feat: Add View Bank Account screen#2769
SaintPatrck wants to merge 4 commits into
mainfrom
vault/pm-38145-ios-bank-account-view

Conversation

@SaintPatrck

@SaintPatrck SaintPatrck commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

🎟️ Tracking

📔 Objective

Adds the read-only View Bank Account detail screen for the Password Manager.

  • Renders the Account details section; empty fields are hidden, and the whole section is hidden when the item has no bank account details.
  • Copy buttons on account number, routing number, SWIFT code, IBAN, and PIN.
  • Account number, PIN, and IBAN are masked by default with reveal toggles.
  • Bank name, name on account, account type, branch number, and bank contact phone display as plain text.

📸 Screenshots

Figma Actual

@SaintPatrck SaintPatrck added ai-review Request a Claude code review app:password-manager Bitwarden Password Manager app context t:feature labels Jun 9, 2026
@SaintPatrck SaintPatrck force-pushed the vault/pm-38145-ios-bank-account-view branch from 92741cb to f6ed75b Compare June 9, 2026 13:38
@github-actions

github-actions Bot commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

🤖 Bitwarden Claude Code Review

Overall Assessment: APPROVE

Reviewed the read-only View Bank Account screen feature (PM-38145): the new ViewBankAccountItemView, the ViewBankAccountItemAction enum, the isBankAccountDetailsSectionEmpty state helper, the CopyableField additions, and the visibility-toggle handling in ViewItemProcessor. The implementation follows the established unidirectional data-flow and view-item patterns (mirroring the card and SSH key item views), masks sensitive fields by default with reveal toggles, and routes copy/visibility through the processor. Test coverage is thorough across state logic, action mapping, processor handling, and ViewInspector interactions.

Code Review Details

No blocking findings.

The four existing review threads (state-file placement of the computed property, // MARK: Bank Account Fields grouping, the customValue accessor, and the visibility-toggle architecture suggestion) are either already addressed in the current diff or acknowledged by the reviewer as non-blocking follow-ups.

Notes verified during review:

  • ViewVaultItemState.bankAccountItemState changing to { get set } does not break its sole conformer CipherItemState, which backs it with a stored property.
  • The duplicate ViewBankAccountItemViewTests class name across the snapshot and ViewInspector test files matches the existing ViewDriversLicenseItemViewTests convention in the codebase.
  • isBankAccountDetailsSectionEmpty is logically consistent with the view's per-field hiding and the accountTypeItem/customValue guard.
  • Sensitive fields (account number, PIN, IBAN) are masked by default and never logged; copy flows through the standard copyPressed action.

@github-actions

github-actions Bot commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

Warning

@SaintPatrck Uploading code coverage report failed. Please check the "Upload to codecov.io" step of Process Test Reports job for more details.

Base automatically changed from vault/pm-38144-ios-bank-account-add-edit to main June 15, 2026 13:44
Add the read-only detail view for Bank Account vault items. Each
non-empty field is shown, with copy buttons on the identifying numbers
(account number, routing number, SWIFT code, IBAN, PIN) and reveal
toggles masking the account number, PIN, and IBAN by default. The whole
section is hidden when the item has no bank account details.

Wires the new view into the existing ViewItem dispatch, action,
processor, and state plumbing, mirroring the established card and
identity view patterns. Reuses BankAccountItemState (from the add/edit
surface) so no new localization keys are required.
@SaintPatrck SaintPatrck force-pushed the vault/pm-38145-ios-bank-account-view branch from f6ed75b to 0d59623 Compare June 15, 2026 17:19
@SaintPatrck SaintPatrck marked this pull request as ready for review June 15, 2026 17:20
@SaintPatrck SaintPatrck requested review from a team and matt-livefront as code owners June 15, 2026 17:20
@codecov

codecov Bot commented Jun 15, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 90.13540% with 51 lines in your changes missing coverage. Please review.
✅ Project coverage is 87.94%. Comparing base (8c9d9eb) to head (72f023b).
⚠️ Report is 16 commits behind head on main.

Files with missing lines Patch % Lines
...ntItem/ViewBankAccountItemView+SnapshotTests.swift 0.00% 44 Missing ⚠️
...Vault/VaultItem/ViewItem/ViewItemDetailsView.swift 0.00% 7 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2769      +/-   ##
==========================================
+ Coverage   87.93%   87.94%   +0.01%     
==========================================
  Files        1728     1741      +13     
  Lines      168727   170500    +1773     
==========================================
+ Hits       148365   149951    +1586     
- Misses      20362    20549     +187     

☔ View full report in Codecov by Harness.
📢 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.

Comment thread BitwardenShared/UI/Vault/VaultItem/ViewItem/ViewItemAction.swift

@fedemkr fedemkr left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Looks good, have some minor suggestions but they shouldn't block the PR.
I think with Matt suggested changes this would be good to approve.


/// The account type field, displaying the selected type's localized name, hidden when no type is selected.
@ViewBuilder private var accountTypeItem: some View {
if case let .custom(type) = store.state.accountType {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

⛏️ There's a computed property customValue to get the value directly:

Suggested change
if case let .custom(type) = store.state.accountType {
if let type = store.state.accountType.customValue {

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Applied suggestion in 72f023b

accessibilityIdentifier: "ShowBankAccountNumberButton",
isPasswordVisible: isVisible,
) {
store.send(.bankAccountItemAction(.toggleAccountNumberVisibilityChanged(!isVisible)))

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

🎨 If possible, I would like us to move to the approach used in ViewSSHKeyItemView where we don't pass the final result of the state and just fire the action of toggling the visibility leaving the actual logic to the processor. This would align better with the architecture of the Unidirectional data flow.
Just in case, this is not blocking the PR and we can just tackle this when we refactor the other places where this approach is currently being used.
Same applies to IBAN and PIN item views.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Logged https://bitwarden.atlassian.net/browse/PM-39242 to track this refactor.

- Move isBankAccountDetailsSectionEmpty into BankAccountItemState, relocating
  its tests to BankAccountItemStateTests
- Group bank account cases under a MARK in CopyableField
- Use accountType.customValue in place of the case-let unwrap
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ai-review Request a Claude code review app:password-manager Bitwarden Password Manager app context t:feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants