Skip to content

[PM-41934] fix: Fix Bank Account behavior and UI bugs - #2983

Open
morganzellers-bw wants to merge 11 commits into
mainfrom
pm-41934-bank-account-behavior-fixes
Open

[PM-41934] fix: Fix Bank Account behavior and UI bugs#2983
morganzellers-bw wants to merge 11 commits into
mainfrom
pm-41934-bank-account-behavior-fixes

Conversation

@morganzellers-bw

@morganzellers-bw morganzellers-bw commented Aug 20, 2026

Copy link
Copy Markdown
Contributor

🎟️ Tracking

  • PM-41934 — Hide Bank Account filter when there are no bank account items
  • PM-41936 — Correct Bank Account type dropdown order and remove placeholder
  • PM-41937 — Correct Add Item type menu order to match designs
  • PM-41935 — Show "Bank account saved" toast after saving a bank account item
  • PM-41957 — Show "New folder created" toast when adding a folder from an item's folder dropdown

📔 Objective

Adds a batch of small Bank Account item behavior/UI bug fixes.

📸 Screenshots

Click to reveal

PM-41934 Hide Bank Account

pm_41934_hide_bank_acct

PM-41936 Account type dropdown order

pm_41936_account_type

PM-41937 Add item type menu order

pm_add_item_menu

@morganzellers-bw morganzellers-bw added the ai-review Request a Claude code review label Aug 20, 2026
@github-actions

github-actions Bot commented Aug 20, 2026

Copy link
Copy Markdown
Contributor

🤖 Bitwarden Claude Code Review

Overall Assessment: REQUEST CHANGES

Reviewed the Bank Account UI/behavior fixes: hiding the Bank Accounts types row when its count is zero, the new BankAccountType.displayOrder and its use as the account type menu options, the blank defaultValueLocalizedName placeholder removal, the BankAccountItemState.accountType default of .custom(.checking), and the CipherType.canCreateCases reorder. Traced the reorder through VaultRepository.getItemTypesUserCanCreate() (which reverses the list) into addVaultItemFloatingActionMenu, and confirmed the resulting upward menu order matches the screenshot. Also traced the new .custom(.checking) default through CipherView.bankAccountItemState(), bankAccountView, and isBankAccountDetailsSectionEmpty — existing items with a missing or unrecognized account type still map to .default and round-trip as nil, and the view screen only renders the bank account section for .bankAccount ciphers. One finding: the in-branch revert of the folder-created toast removes behavior that is already on main.

Code Review Details
  • ⚠️ : Revert removes the "New folder created" toast that exists on main (added by PR 2991), regressing PM-41957 for the item folder dropdown path
    • BitwardenShared/UI/Vault/VaultItem/AddEditItem/AddEditItemProcessor.swift:1153

@github-actions github-actions Bot added app:password-manager Bitwarden Password Manager app context app:authenticator Bitwarden Authenticator app context t:bug Change Type - Bug labels Aug 20, 2026
@codecov

codecov Bot commented Aug 20, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 81.87%. Comparing base (9de43d8) to head (4ff45ae).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2983      +/-   ##
==========================================
+ Coverage   79.60%   81.87%   +2.26%     
==========================================
  Files        1169     1046     -123     
  Lines       75194    67897    -7297     
==========================================
- Hits        59857    55589    -4268     
+ Misses      15337    12308    -3029     

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

@morganzellers-bw morganzellers-bw self-assigned this Aug 20, 2026
@morganzellers-bw
morganzellers-bw force-pushed the pm-41934-bank-account-behavior-fixes branch from 7963b10 to 2ebf3a5 Compare August 25, 2026 17:11
@morganzellers-bw
morganzellers-bw marked this pull request as ready for review August 26, 2026 14:02
@morganzellers-bw
morganzellers-bw force-pushed the pm-41934-bank-account-behavior-fixes branch from 239ccd3 to d3005e0 Compare August 26, 2026 16:58
@morganzellers-bw
morganzellers-bw marked this pull request as draft August 26, 2026 19:14
@github-actions github-actions Bot removed the app:authenticator Bitwarden Authenticator app context label Aug 27, 2026
@morganzellers-bw
morganzellers-bw force-pushed the pm-41934-bank-account-behavior-fixes branch from 30b3ed8 to a108efb Compare August 27, 2026 14:24
@morganzellers-bw
morganzellers-bw marked this pull request as ready for review August 27, 2026 14:24
@morganzellers-bw
morganzellers-bw force-pushed the pm-41934-bank-account-behavior-fixes branch 4 times, most recently from a1f4cf1 to d9f3900 Compare September 1, 2026 20:34
…nt items

addTypesSection() added the Bank Accounts row whenever the newItemTypes
flag was enabled, regardless of count. Guard it with a zero-count check,
matching the existing pattern used for Cards, so the filter only appears
once the user has at least one bank account item.
…laceholder

The Account Type menu rendered options alphabetically with a "--Select--"
placeholder on top instead of the design order. Add an explicit
displayOrder to BankAccountType and wire the menu to it; the unset state
now reads "Checking" instead of showing a placeholder.
CipherType.canCreateCases listed types in the wrong order, causing the
Add Item menu to show Secure note between Identity and Bank account
instead of after License/Passport. Reorder to match design.
…ccount item

Saving (adding or editing) a bank account cipher previously dismissed
back to the vault with no confirmation. Adds a dedicated
CipherItemOperationDelegate callback so the presenting screen can show
a "Bank account saved" toast, matching the expected UX for the new
item type.
The state was flipped from .default to .custom(.checking) on tap-up
via TapGesture, which lands too late relative to when the native Menu
snapshots its content for presentation - the checkmark didn't appear.
Switching to a touch-down-triggered DragGesture(minimumDistance: 0)
gives SwiftUI a render pass to update the selection before the menu
opens.
The touch-down gesture trick to fake a "menu opened" event was more
complexity than this needed. Defaulting BankAccountItemState's
accountType straight to .custom(.checking) makes the label, checkmark,
and persisted value agree from the start for any new bank account item,
with no special-casing required.
… folder from an item's folder dropdown"

This reverts commit 116b4b9.
@morganzellers-bw
morganzellers-bw force-pushed the pm-41934-bank-account-behavior-fixes branch from d9f3900 to 4ff45ae Compare September 1, 2026 20:54
extension AddEditItemProcessor: AddEditFolderDelegate {
func folderAdded(_ folderView: FolderView) {
state.folder = .custom(folderView)
state.toast = Toast(title: Localizations.folderCreated)

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.

⚠️ IMPORTANT: This reverts the "New folder created" toast that is already on main, regressing PM-41957 for the item folder dropdown path.

Details and fix

The branch commit 7519d77 ("Revert [PM-41957]...") reverts 116b4b9, but that commit is not part of this branch — it is in the PR's base. The merge base (9de43d8) contains state.toast = Toast(title: Localizations.folderCreated) in folderAdded(_:), so this diff is a net removal of shipped behavior rather than a no-op drop of in-branch work.

PR #2991 ("Show New folder created toast on all folder creation paths", merged 2026-09-01) added exactly these two lines — the processor line and the XCTAssertEqual(subject.state.toast, Toast(title: Localizations.folderCreated)) assertion in AddEditItemProcessorTests.test_folderAdded. VaultListProcessor.swift:839 still sets the toast, so after this merges the vault-list path keeps the toast while adding a folder from an item's folder dropdown silently loses it — the specific path PM-41957 was filed for.

The PR description strikes PM-41957 through, which suggests the intent was to drop that work from this PR, not to remove it from main. Suggest restoring both lines:

func folderAdded(_ folderView: FolderView) {
    state.folder = .custom(folderView)
    state.toast = Toast(title: Localizations.folderCreated)
}

If removing it is intentional (e.g. superseded by a different toast strategy), it would help to say so in the description so the revert is not read as an accidental rebase artifact.

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:bug Change Type - Bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant