Skip to content

fix: improve delete confirmation word handling#679

Open
lte-z wants to merge 2 commits into
microsoft:mainfrom
lte-z:dev/lte_z/delete-confirmation-fallback
Open

fix: improve delete confirmation word handling#679
lte-z wants to merge 2 commits into
microsoft:mainfrom
lte-z:dev/lte_z/delete-confirmation-fallback

Conversation

@lte-z
Copy link
Copy Markdown

@lte-z lte-z commented May 25, 2026

Fixes #677

Changes

This PR improves word confirmation behavior for destructive delete operations.

Index deletion

  • Always uses delete as the confirmation word when dropping an index
  • Avoids requiring users to type opaque generated index names

Database and collection deletion

  • Keeps the resource name as the confirmation word when it is short and alphabetic-only
  • Falls back to delete when the resource name:
    • is longer than 16 characters
    • contains characters outside [a-zA-Z]

Confirmation utility

  • Added WordConfirmationOptions for word-confirmation fallback behavior
  • Added fallback resolution for complex confirmation words
  • Updated JSDoc for the new options parameter

Behavior

Indexes

  • Dropping an index now prompts for delete

Short alphabetic database and collection names

  • Names such as users and orders still prompt for the exact resource name

Complex database and collection names

  • Names such as test_db, order_items, and long resource names now prompt for delete

Screenshots

Delete long database confirmation

verylongdatabasename prompts for delete

Delete collection with non-alphabetic name confirmation

collection-name prompts for delete

Drop short index confirmation

Index deletion prompts for delete, even for short index names

Notes

  • Folder and connection deletion flows remain unchanged
  • Number challenge and button confirmation modes are unaffected

Copilot AI review requested due to automatic review settings May 25, 2026 06:32
@lte-z lte-z requested a review from a team as a code owner May 25, 2026 06:32
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Note

Copilot was unable to run its full agentic suite in this review.

Adds support for a fallback confirmation word for “word confirmation” dialogs so destructive actions aren’t blocked by long/complex entity names.

Changes:

  • Introduced WordConfirmationOptions and resolveConfirmationWord() to substitute a fallback word for complex/long confirmation words.
  • Extended getConfirmationAsInSettings() / getConfirmationWithWordQuestion() to accept word-confirmation options.
  • Updated several delete commands to use a simple “delete” confirmation word (directly or via fallback).

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.

File Description
src/utils/dialogs/getConfirmation.ts Adds fallback word resolution and plumbs options through word-confirmation flows.
src/commands/index.dropIndex/dropIndex.ts Changes the required confirmation word from the index name to the constant "delete".
src/commands/deleteDatabase/deleteDatabase.ts Uses fallback "delete" for complex database IDs.
src/commands/deleteCollection/deleteCollection.ts Uses fallback "delete" for complex collection names.

Comment thread src/commands/index.dropIndex/dropIndex.ts
Comment thread src/commands/deleteDatabase/deleteDatabase.ts
Comment thread src/utils/dialogs/getConfirmation.ts Outdated
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Improve delete confirmation: use 'delete' for indexes, smart fallback for complex names 🔐

2 participants