Skip to content

fix(audit): confirm deletion from recent audits - #790

Merged
gkhngyk merged 1 commit into
ansvisor:mainfrom
BharadwajKanneveti:fix/audit-delete-confirmation
Aug 27, 2026
Merged

gkhngyk merged 1 commit into
ansvisor:mainfrom
BharadwajKanneveti:fix/audit-delete-confirmation

Conversation

@BharadwajKanneveti

Copy link
Copy Markdown
Contributor

Summary

Add a confirmation dialog before deleting an audit from the recent-audits list.

Previously, clicking the trash icon immediately triggered the delete action. Now, clicking the trash icon opens a confirmation dialog, and the audit is deleted only after the user explicitly clicks Delete. Cancelling leaves the audit unchanged.

The existing translated status labels for non-completed audits are already present, so no additional changes were needed for that requirement.

Related issue

Closes #614

Type of change

  • feat — New feature
  • fix — Bug fix
  • chore — Maintenance / dependencies
  • docs — Documentation only
  • refactor — Code change that neither fixes a bug nor adds a feature
  • test — Adding or updating tests

Checklist

@gkhngyk gkhngyk left a comment

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.

Faithful mirror of the detail page's dialog — same title, description, outline Cancel and destructive confirm, and no new copy since deleteAudit / deleteConfirm / cancel were already there. That was the whole ask.

The thing I went looking for was the one-dialog-per-row choice, since the issue asked not to render N dialogs if the list can be long. It holds here on both counts: the list is capped at 50 server-side (server/src/routes/audits.js:361), and DialogContent renders through DialogPortal, so a closed dialog mounts its trigger and nothing else. Fifty triggers is not a cost worth pendingId state to avoid.

You also stayed clear of the trap in this particular row: the trigger is a sibling of the <Link>, not inside it. Nested, a click would have opened the dialog and navigated to the detail page at the same time.

And you read the second half of the issue correctly — the raw running / failed status label was fixed in #673 and is already going through t('status.${h.status}') on main, so there was nothing left to do there.

Nothing blocking. One observation not worth changing: the dialog title and the confirm button are both "Delete audit", which reads a little repetitive — but the detail page does the same, and matching it is the right call over being locally prettier.

Thanks for picking this one up.

@BharadwajKanneveti

Copy link
Copy Markdown
Contributor Author

Hi @gkhngyk , this is unrelated to the PR, but could I DM you about something when you have a moment? I’m not sure which platform you’re most active on. Can you please tell me?

@gkhngyk
gkhngyk merged commit 9f5367c into ansvisor:main Aug 27, 2026
5 checks 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.

Site Audit: deleting from the recent-audits list has no confirmation (detail page has one)

2 participants