Skip to content

[PM-42029] fix: Match the add item menu order to the designs - #3002

Open
andrebispo5 wants to merge 3 commits into
mainfrom
pm-42029-fab-item-type-order
Open

[PM-42029] fix: Match the add item menu order to the designs#3002
andrebispo5 wants to merge 3 commits into
mainfrom
pm-42029-fab-item-type-order

Conversation

@andrebispo5

@andrebispo5 andrebispo5 commented Aug 27, 2026

Copy link
Copy Markdown
Contributor

🎟️ Tracking

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

📔 Objective

  • The add item menu listed the types in the wrong order: Identity and Secure note came before Bank account, License and Passport.
  • Order now matches the designs: Login, Card, Bank account, Identity, License, Passport, Secure note, then Folder at the bottom.
  • The list gets reversed on its way to the menu, since iOS draws it bottom-up when it opens above the button. So canCreateCases reads the same way you see it on screen.
  • Also reversed the two state defaults and the view's default parameter. They were feeding the menu an unreversed list, so tapping the button before the vault list finished loading showed everything upside-down.

📸 Screenshots

Before After

@github-actions github-actions Bot added app:password-manager Bitwarden Password Manager app context t:bug Change Type - Bug labels Aug 27, 2026
@andrebispo5
andrebispo5 marked this pull request as ready for review August 27, 2026 16:16
Copilot AI lite review requested due to automatic review settings August 27, 2026 16:16
@andrebispo5
andrebispo5 requested a review from a team as a code owner August 27, 2026 16:16
@github-actions

github-actions Bot commented Aug 27, 2026

Copy link
Copy Markdown
Contributor

🤖 Bitwarden Claude Code Review

Overall Assessment: APPROVE

Reviewed the reordering of CipherType.canCreateCases to the design order and the three .reversed() defaults added in VaultListState, VaultGroupState, and the addVaultItemFloatingActionMenu view extension. The new defaults now match what VaultRepository.getItemTypesUserCanCreate() already returned, so the menu renders the same order whether or not the repository fetch has completed. Traced the reorder through the feature-flag and restrict-item-types filters in VaultRepository and confirmed the existing order-sensitive assertions in VaultRepositoryTests still hold, since the non-gated types keep their relative order under both lists. No security, correctness, or breaking-change concerns found.

Copilot AI left a comment

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.

Pull request overview

Updates the vault “Add item” menu ordering to match design expectations and ensures initial/default state ordering matches what the floating action menu expects (bottom-up rendering when presented above the button).

Changes:

  • Reordered CipherType.canCreateCases to: Login, Card, Bank account, Identity, Driver’s License, Passport, Secure note.
  • Updated default itemTypesUserCanCreate values (and the floating action menu view default) to use the repository/menu order (.reversed()).
  • Added unit tests asserting the default ordering for VaultListState and VaultGroupState.

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
BitwardenShared/UI/Vault/Vault/VaultList/VaultListStateTests.swift Adds a regression test asserting the default menu ordering.
BitwardenShared/UI/Vault/Vault/VaultList/VaultListState.swift Changes default itemTypesUserCanCreate to match menu/repository order.
BitwardenShared/UI/Vault/Vault/VaultGroup/VaultGroupStateTests.swift Adds a regression test asserting the default menu ordering.
BitwardenShared/UI/Vault/Vault/VaultGroup/VaultGroupState.swift Changes default itemTypesUserCanCreate to match menu/repository order.
BitwardenShared/UI/Platform/Application/Extensions/View.swift Updates floating action menu default availableItemTypes ordering.
BitwardenShared/Core/Vault/Models/Enum/CipherTypeTests.swift Updates expected ordering for canCreateCases.
BitwardenShared/Core/Vault/Models/Enum/CipherType.swift Reorders canCreateCases to match design.

💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment on lines 40 to 42
/// List of available item type for creation.
var itemTypesUserCanCreate: [CipherType] = CipherType.canCreateCases
var itemTypesUserCanCreate: [CipherType] = CipherType.canCreateCases.reversed()

@codecov

codecov Bot commented Aug 27, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 81.80%. Comparing base (c419835) to head (0f529c0).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3002      +/-   ##
==========================================
+ Coverage   79.53%   81.80%   +2.27%     
==========================================
  Files        1169     1046     -123     
  Lines       75095    67798    -7297     
==========================================
- Hits        59724    55461    -4263     
+ Misses      15371    12337    -3034     

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


var getTOTPKeyIfAllowedToCopyResult: Result<String?, Error> = .success(nil)

var getItemTypesUserCanCreateResult: [BitwardenShared.CipherType] = CipherType.canCreateCases

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 all these reversed() calls even necessary? It seems like the issue was purely in the order in CipherType?

@andrebispo5 andrebispo5 Aug 28, 2026

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.

Fair question. The CipherType reorder is what fixes the reported bug, but the defaults still need the reversal:

  • appeared() awaits refreshVault() before loadItemTypesUserCanCreate(), and the FAB overlay sits outside the LoadingView, so the button is tappable for the whole sync.
  • During that window the menu renders off the default. Unreversed, it comes out upside-down (Secure note at the top, Login at the bottom).
  • The repository hands back canCreateCases.reversed(), so the defaults have to match or they disagree with what replaces them.

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

Labels

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.

3 participants