No Loading Indicator & Modal Not Closing After Deleting a Rule
Description When deleting a rule in the Rules section, the UI does not provide any visual feedback. There’s no loading spinner or progress indicator, and the rule dialog remains open even after the rule has been successfully deleted.
Steps to Reproduce
- Click on any rule.
- When the dialog open click on delete.
- Observe there is no loading indicator.
- Even the toast shows deleted the dialog does not close.
https://github.com/user-attachments/assets/7f08f152-994d-4249-b81c-0f6965c5793d
A summary of the changes CodeRabbit can apply:
In apps/web/app/(app)/[emailAccountId]/assistant/RuleForm.tsx: add an isDeleting useState, set loading={isDeleting} on the Delete button, wrap the delete flow with setIsDeleting(true)/finally setIsDeleting(false), and on success call onSuccess() when isDialog (otherwise router.push to /automation?tab=rules) so the dialog closes and a loading spinner shows during deletion.
Add delete-state and async deletion flow to RuleForm.tsx: introduce isDeleting state, show loading on the Trash button, set isDeleting true/false around the delete action, call deleteRuleAction with confirmation, handle success by calling onSuccess when in a dialog or routing to /automation?tab=rules otherwise, and show toast messages on success/failure.
- [ ] Executed edits - (🔄 Check again to try again)
[!CAUTION] The CodeRabbit agent's plans did not produce any file changes.