[PM-42029] fix: Match the add item menu order to the designs - #3002
[PM-42029] fix: Match the add item menu order to the designs#3002andrebispo5 wants to merge 3 commits into
Conversation
🤖 Bitwarden Claude Code ReviewOverall Assessment: APPROVE Reviewed the reordering of |
There was a problem hiding this comment.
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.canCreateCasesto: Login, Card, Bank account, Identity, Driver’s License, Passport, Secure note. - Updated default
itemTypesUserCanCreatevalues (and the floating action menu view default) to use the repository/menu order (.reversed()). - Added unit tests asserting the default ordering for
VaultListStateandVaultGroupState.
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.
| /// List of available item type for creation. | ||
| var itemTypesUserCanCreate: [CipherType] = CipherType.canCreateCases | ||
| var itemTypesUserCanCreate: [CipherType] = CipherType.canCreateCases.reversed() | ||
|
|
Codecov Report✅ All modified and coverable lines are covered by tests. 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. 🚀 New features to boost your workflow:
|
|
|
||
| var getTOTPKeyIfAllowedToCopyResult: Result<String?, Error> = .success(nil) | ||
|
|
||
| var getItemTypesUserCanCreateResult: [BitwardenShared.CipherType] = CipherType.canCreateCases |
There was a problem hiding this comment.
🤔 Are all these reversed() calls even necessary? It seems like the issue was purely in the order in CipherType?
There was a problem hiding this comment.
Fair question. The CipherType reorder is what fixes the reported bug, but the defaults still need the reversal:
appeared()awaitsrefreshVault()beforeloadItemTypesUserCanCreate(), and the FAB overlay sits outside theLoadingView, 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.
🎟️ Tracking
https://bitwarden.atlassian.net/browse/PM-42029
📔 Objective
canCreateCasesreads the same way you see it on screen.📸 Screenshots