Skip to content

Add confirmation dialog before deleting rules - #10

Merged
vssinghh merged 1 commit into
vssinghh:mainfrom
komallsingh:fix/rule-delete-confirmation
Jun 25, 2026
Merged

Add confirmation dialog before deleting rules#10
vssinghh merged 1 commit into
vssinghh:mainfrom
komallsingh:fix/rule-delete-confirmation

Conversation

@komallsingh

Copy link
Copy Markdown
Contributor

Summary

Adds a confirmation dialog before deleting rules to prevent accidental deletions.

Changes

  • Added rulePendingDeletion state to track pending deletions
  • Added Compose AlertDialog confirmation flow
  • Applied confirmation to swipe-to-delete actions
  • Applied confirmation to delete action from the rule details dialog
  • Deletion now only occurs after explicit user confirmation

Testing

Manual Verification

Due to AI Engine availability issues, rule creation could not be tested end-to-end on available emulators.

Environment tested:

  • Pixel 9 Pro emulator
  • Additional Android emulators

Observed behavior:

  • App reports: "AI model unavailable — please set up on-device AI first"
  • No rules can be created through the Chat flow because parseCommandUseCase() fails before rule creation

Code inspection confirms:

  • Existing deletion behavior directly called viewModel.deleteRule(rule)
  • New implementation replaces immediate deletion with a confirmation dialog
  • Actual deletion now occurs only after user presses "Delete"

Expected Behavior

  • Tapping delete shows a confirmation dialog
  • Dialog displays the rule name
  • Dialog warns that the action cannot be undone
  • Cancel keeps the rule
  • Delete removes the rule

NOTES

I would also mention:

I was unable to fully verify via UI because the AI engine is unavailable on available emulator devices (including Pixel 9 Pro emulator), preventing rule creation through the Chat workflow. The change is isolated to the UI layer and does not modify repository or ViewModel deletion logic.

@vssinghh
vssinghh merged commit 15ff33d into vssinghh:main Jun 25, 2026
1 check passed
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.

2 participants