Skip to content

[PM-36379] fix: Show the item type in the save snackbar - #7308

Open
andrebispo5 wants to merge 2 commits into
mainfrom
PM-36379-card-saved-snackbar-message
Open

[PM-36379] fix: Show the item type in the save snackbar#7308
andrebispo5 wants to merge 2 commits into
mainfrom
PM-36379-card-saved-snackbar-message

Conversation

@andrebispo5

@andrebispo5 andrebispo5 commented Aug 26, 2026

Copy link
Copy Markdown
Contributor

🎟️ Tracking

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

📔 Objective

  • Saving a card showed "Item added" or "Item saved", which doesn't tell you what you actually saved.
  • The snackbar now names the type, so creating or editing a card reads "Card saved".
  • Did the same for the rest: logins, identities, secure notes, SSH keys, bank accounts, licenses, and passports.
  • Create and edit share one message now, since "Card saved" reads fine for both.

📸 Screenshots

| Before |

image

| After |

image image image image image image image

@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 26, 2026
@codecov

codecov Bot commented Aug 26, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 36.36364% with 7 lines in your changes missing coverage. Please review.
✅ Project coverage is 86.25%. Comparing base (36bd55a) to head (2a1a1c5).

Files with missing lines Patch % Lines
.../ui/vault/feature/addedit/VaultAddEditViewModel.kt 36.36% 6 Missing and 1 partial ⚠️
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     
Flag Coverage Δ
app-data 17.92% <0.00%> (-0.01%) ⬇️
app-ui-auth-tools 18.95% <0.00%> (-0.34%) ⬇️
app-ui-platform 16.36% <0.00%> (-0.01%) ⬇️
app-ui-vault 27.29% <36.36%> (-0.64%) ⬇️
authenticator 6.06% <0.00%> (-0.03%) ⬇️
lib-core-network-bridge 4.08% <0.00%> (-0.03%) ⬇️
lib-data-ui 1.20% <0.00%> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ 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.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@andrebispo5
andrebispo5 marked this pull request as ready for review August 26, 2026 11:16
@andrebispo5
andrebispo5 requested review from a team and david-livefront as code owners August 26, 2026 11:16
Copilot AI lite review requested due to automatic review settings August 26, 2026 11:16
@github-actions

github-actions Bot commented Aug 26, 2026

Copy link
Copy Markdown
Contributor

🤖 Bitwarden Claude Code Review

Overall Assessment: APPROVE

Reviewed the type-specific save snackbar change in VaultAddEditViewModel, the eight new string resources, and the accompanying test updates. The new savedSnackbarMessage getter reads state.cipherType, the same exhaustive source of truth already used by screenDisplayName, and that value is set once from the navigation args and never mutated, so add, edit, and clone flows all resolve the correct type. Autofill save and passkey registration paths still short-circuit to ExitApp before the snackbar, so they are unaffected. New string names follow the content-derived snake_case convention, and regression tests cover the card create and card edit cases plus the updated login expectations.

Code Review Details
  • ♻️ : new_item_created is now unreferenced after its only usage was replaced
    • ui/src/main/res/values/strings.xml:123

Copilot AI left a comment

Copy link
Copy Markdown

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/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 VaultAddEditViewModel to 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.

Comment on lines +153 to +157
<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>

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.

♻️ 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.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

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()

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

👍

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

Labels

app:authenticator Bitwarden Authenticator app context 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