Skip to content

[PM-40747] feat: Add vault folder delete and duplicate name validation#7194

Open
Ashishchidhava wants to merge 1 commit into
bitwarden:mainfrom
Ashishchidhava:feature/folder-delete-and-duplicate-name-validation
Open

[PM-40747] feat: Add vault folder delete and duplicate name validation#7194
Ashishchidhava wants to merge 1 commit into
bitwarden:mainfrom
Ashishchidhava:feature/folder-delete-and-duplicate-name-validation

Conversation

@Ashishchidhava

@Ashishchidhava Ashishchidhava commented Jul 22, 2026

Copy link
Copy Markdown

🎟️ Tracking

Local enhancement: folders on My vault had no delete action, and creating folders with the same name was allowed (e.g. two folders both named “Himalya”).

📔 Objective

Improve folder management from My vault and prevent duplicate folder names.

1. Delete / edit folder from My vault

  • Folder rows on My vault now show a ⋯ more options menu.
  • Options:
    • Edit → opens the existing Edit folder screen
    • Delete → confirmation dialog, then deletes the folder and shows a snackbar
  • Synthetic “No Folder” rows are unchanged (no overflow menu).
  • Reuses existing vaultRepository.deleteFolder and edit-folder navigation (no new delete API).

2. Duplicate folder name validation

  • Creating or renaming a folder to a name that already exists is blocked (case-insensitive).
  • Nested names compare the full resolved path (e.g. Parent/Child).
  • Edit mode still allows saving when the name is unchanged for that same folder.
  • Applied in:
    • Add/Edit folder screen (FolderAddEditViewModel)
    • Inline “add folder” from item add/edit (VaultAddEditViewModel)
  • The Add folder screen subscribes to foldersStateFlow so validation uses a loaded folder list (fixes a race where .value was often empty and duplicates were allowed).
  • New string: a_folder_with_this_name_already_exists → “A folder with this name already exists.”

3. Supporting UI / navigation

  • BitwardenGroupItem supports an optional overflow selection list (used by vault folder rows).
  • Navigation wired for NavigateToEditFolder through vault → nav bar → unlocked graph.

Tests

  • FolderAddEditViewModelTest: duplicate name blocked; edit with unchanged name still saves.
  • VaultViewModelTest: folder edit navigation, delete confirmation, successful delete snackbar.
  • Screen/nav tests updated for the new onNavigateToEditFolderScreen callback.

📸 Screenshots

Verified on device:

  • My vault folder rows show with Edit / Delete
Screenshot 2026-07-22 at 16 46 14
  • Saving a duplicate folder name shows the error dialog
Screenshot 2026-07-22 at 16 46 06 Screenshot 2026-07-22 at 16 45 52

Test plan

  • Open My vault → confirm each real folder row has a menu
  • Edit opens Edit folder and saving works
  • Delete shows confirmation → folder is removed → snackbar appears
  • Add folder with an existing name (same casing and different casing) → error: “A folder with this name already exists.”
  • Rename a folder to another existing name → same error
  • Rename a folder without changing the name → save succeeds
  • Add a nested folder name that does not collide with an existing full path → save succeeds

@Ashishchidhava
Ashishchidhava requested review from a team and david-livefront as code owners July 22, 2026 06:23
@CLAassistant

CLAassistant commented Jul 22, 2026

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@bitwarden-bot

Copy link
Copy Markdown
Collaborator

Thank you for your contribution! We've added this to our internal tracking system for review.
ID: PM-40747
Link: https://bitwarden.atlassian.net/browse/PM-40747

Details on our contribution process can be found here: https://contributing.bitwarden.com/contributing/pull-requests/community-pr-process.

@bitwarden-bot bitwarden-bot changed the title feat: Add vault folder delete and duplicate name validation [PM-40747] feat: Add vault folder delete and duplicate name validation Jul 22, 2026
@Ashishchidhava
Ashishchidhava force-pushed the feature/folder-delete-and-duplicate-name-validation branch from ca8b19e to f2ebf89 Compare July 22, 2026 06:30
Make folders manageable from My vault and prevent creating folders with the same name.
@Ashishchidhava
Ashishchidhava force-pushed the feature/folder-delete-and-duplicate-name-validation branch from f2ebf89 to 022d573 Compare July 22, 2026 06:30
@Ashishchidhava

Copy link
Copy Markdown
Author

Small cleanup note for reviewers: the example duplicate folder name in the description was just a local test string — happy to adjust copy or follow any Product/Engineering guidance on UX (e.g. overflow placement, delete confirmation wording).

Happy to iterate quickly on any review feedback.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants