[PM-36379] fix: Show the item type in the save snackbar - #7308
[PM-36379] fix: Show the item type in the save snackbar#7308andrebispo5 wants to merge 2 commits into
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #7308 +/- ##
==========================================
+ Coverage 85.22% 86.25% +1.02%
==========================================
Files 1033 898 -135
Lines 68135 65601 -2534
Branches 9940 9868 -72
==========================================
- Hits 58070 56582 -1488
+ Misses 6575 5550 -1025
+ Partials 3490 3469 -21
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
🤖 Bitwarden Claude Code ReviewOverall Assessment: APPROVE Reviewed the type-specific save snackbar change in Code Review Details
|
There was a problem hiding this comment.
Pull request overview
Updates the vault add/edit save snackbar copy so it includes the saved item type (e.g., “Card saved”) instead of generic “Item saved/Item added”, improving clarity across supported cipher types.
Changes:
- Added new string resources for per-item-type “*_saved” snackbar messages.
- Updated
VaultAddEditViewModelto use a cipher-type-derived snackbar message for both create and update success paths. - Updated and extended unit tests to assert the new snackbar messages (including new card coverage).
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| ui/src/main/res/values/strings.xml | Adds new per-item-type “saved” strings used by the snackbar. |
| app/src/main/kotlin/com/x8bit/bitwarden/ui/vault/feature/addedit/VaultAddEditViewModel.kt | Uses a new savedSnackbarMessage derived from cipherType for save success snackbar text. |
| app/src/test/kotlin/com/x8bit/bitwarden/ui/vault/feature/addedit/VaultAddEditViewModelTest.kt | Updates expectations for the snackbar message and adds card-specific save snackbar tests. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| <string name="bank_account_saved">Bank account saved</string> | ||
| <string name="card_saved">Card saved</string> | ||
| <string name="identity_saved">Identity saved</string> | ||
| <string name="license_saved">License saved</string> | ||
| <string name="login_saved">Login saved</string> |
| <string name="card_saved">Card saved</string> | ||
| <string name="identity_saved">Identity saved</string> | ||
| <string name="license_saved">License saved</string> | ||
| <string name="login_saved">Login saved</string> |
There was a problem hiding this comment.
♻️ DEBT: new_item_created is now unreferenced and can be removed.
Details
This PR replaced the only Kotlin usage of new_item_created (VaultAddEditViewModel.kt:2036) with state.savedSnackbarMessage. A search across the repo shows the resource is now only declared in ui/src/main/res/values/strings.xml:123 and its translated variants, with no code references remaining.
Removing the base declaration keeps the translation source clean so translators aren't maintaining dead copy. item_updated is still used (VaultItemListingViewModel.kt:2378, VaultMoveToOrganizationViewModel.kt:342, VaultAddEditViewModel.kt:2457), so only new_item_created is affected.
There was a problem hiding this comment.
We should remove this if it's not needed
| VaultItemCipherType.SSH_KEY -> BitwardenString.ssh_key_saved.asText() | ||
| VaultItemCipherType.BANK_ACCOUNT -> BitwardenString.bank_account_saved.asText() | ||
| VaultItemCipherType.DRIVERS_LICENSE -> BitwardenString.license_saved.asText() | ||
| VaultItemCipherType.PASSPORT -> BitwardenString.passport_saved.asText() |
🎟️ Tracking
https://bitwarden.atlassian.net/browse/PM-36379
📔 Objective
📸 Screenshots
| Before |
| After |