Skip to content

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

Closed

Description

@gkhngyk

Problem

Deleting an audit from the hub's recent-audits list fires immediately on the trash-icon click, with an optimistic removal and no confirmation. The detail page guards the very same action behind a confirm Dialog, and the deleteConfirm copy already exists in messages/en.json — so the list is both a data-loss hazard and inconsistent with its sibling.

Evidence

Suggested fix

Wrap the list's trash button in the same Dialog used on the detail page (title deleteAudit, description deleteConfirm, destructive confirm). No new copy is needed.

Small adjacent polish, same file: for non-completed audits the list renders the raw status string in the score slot (#L330 — : h.status), so users see lowercase running / failed where a score belongs. Render a small status badge (or translated label) instead.

Acceptance criteria

  • Deleting from the list requires the same confirmation as the detail page; cancelling keeps the audit.
  • Non-completed rows show a presentable status label instead of the raw enum string.

Activity

  1. added
    enhancement
    good first issue
    on Aug 3, 2026
  2. Adarshhic commented on Aug 3, 2026

    @Adarshhic
    Contributor

    Hi @gkhngyk, I'd like to work on this one — could you assign it to me?

    I've gone through the code and confirmed the issue:

    • audit/page.tsx#L333-L341 fires handleDelete(h.id) directly on click, with the optimistic removal in handleDelete (L138-147) meaning the row disappears before any confirmation.
    • audit/[id]/page.tsx#L122-147 already has the Dialog + deleteConfirm pattern to mirror.
    • deleteAudit / deleteConfirm / cancel keys already exist in messages/en.json, so no new copy needed for the confirmation part.

    Plan:

    1. Wrap the list's trash Button in the same Dialog (title deleteAudit, description deleteConfirm, destructive confirm calling handleDelete(h.id)).
    2. Replace the raw h.status render at L330 with a small status badge/translated label for non-completed rows (will add the missing label key(s) since none currently fit).

    Will open a PR referencing this issue once done.

  3. gkhngyk commented on Aug 3, 2026

    @gkhngyk
    ContributorAuthor

    Assigned — this pairs naturally with #611 since both reuse the same confirm-dialog pattern. Note the second half of the issue too: the raw status string rendered in the score slot for non-completed audits.

  4. gkhngyk commented on Aug 10, 2026

    @gkhngyk
    ContributorAuthor

    @Adarshhic checking in — still up for this one? No pressure either way, just let us know.

    Two things changed since it was assigned, both in your favour:

    If you'd rather hand it back, that's completely fine — say the word and we'll return it to the pool.

  5. Adarshhic commented on Aug 10, 2026

    @Adarshhic
    Contributor

    Hi @gkhngyk, still in on this one — thanks for the check-in. Confirmed both points:

    • The status-label fix from fix: localize audit hub and report strings #673 is already in on main (t('status.${h.status}') at L405), so only the delete confirmation is left, as you said.
    • The trash button at audit/page.tsx:412 still fires handleDelete(h.id) directly with no gate.

    Will reuse the Dialog pattern from #653 (bulk dismiss confirm) applied here to wrap this delete button, matching the existing pattern in audit/[id]/page.tsx. Should be quick since the pattern's already proven — will push a PR shortly.

  6. added
    site audit
    on Aug 12, 2026
  7. BharadwajKanneveti commented on Aug 23, 2026

    @BharadwajKanneveti
    Contributor

    @gkhngyk this one was open for sometime can I pick it up?

  8. gkhngyk commented on Aug 23, 2026

    @gkhngyk
    ContributorAuthor

    @BharadwajKanneveti yes — reassigning to you.

    @Adarshhic no hard feelings, and thanks for the analysis on this one; it's been two weeks since the last update so we're returning it to the pool. Plenty of others open if you want to pick one up.

    Scope is just the delete confirmation — the status-label half landed in #673. The Dialog in audit/[id]/page.tsx is the pattern to mirror, and deleteAudit / deleteConfirm / cancel already exist in messages/en.json.

  9. gkhngyk commented on Aug 25, 2026

    @gkhngyk
    ContributorAuthor

    @BharadwajKanneveti you hold #756 as well now, and the two are the same pattern: that one moves four confirm() calls onto the Dialog, this one puts the same dialog on a delete that has none. audit/[id]/page.tsx is the reference for both, and all this issue needs is at audit/page.tsx:412, where the trash button still calls handleDelete(h.id) straight from onClick.

    Worth doing in one sitting — separate PRs, so each stays easy to review.

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

Metadata

Metadata

Labels

enhancementgood first issuesite audit

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions