Skip to content

feat(website): Add confirmation dialog for citation deletion#6919

Merged
theosanderson merged 1 commit into
mainfrom
claude/seqsets-remove-confirm-k8jxsr
Jul 16, 2026
Merged

feat(website): Add confirmation dialog for citation deletion#6919
theosanderson merged 1 commit into
mainfrom
claude/seqsets-remove-confirm-k8jxsr

Conversation

@theosanderson

@theosanderson theosanderson commented Jul 16, 2026

Copy link
Copy Markdown
Member

resolves #

Description

Added a confirmation dialog that appears when users attempt to delete a citation from the admin dashboard. This prevents accidental deletions by requiring explicit confirmation before the deletion is processed.

Changes:

  • Refactored handleDelete to display a confirmation dialog before deletion
  • Renamed the async deletion logic to deleteCitation for clarity
  • The confirmation dialog displays the citation title (or DOI if title is unavailable) for better user context
  • Removed unnecessary ESLint disable comment since handleDelete is now synchronous
  • Updated integration tests to click the confirmation button in the deletion flow

PR Checklist

  • All necessary documentation has been adapted.
  • The implemented feature is covered by appropriate, automated tests.
  • Any manual testing that has been done is documented (i.e. what exactly was tested?)

Test Plan

The integration test deleteCitation has been updated to verify the complete deletion flow including the confirmation dialog. The test now clicks the "Confirm" button and verifies the citation row is hidden, ensuring the feature works end-to-end.

https://claude.ai/code/session_011J2KqZ78uAwuMYZL2J6gCV

🚀 Preview: Add preview label to enable

The "Remove" button for CURATED SeqSet citations on the admin dashboard
previously deleted the citation immediately on click, with no way to back
out of an accidental click. This adds a confirmation dialog gate before the
delete request is sent, matching the existing pattern used for deleting
SeqSet versions (displayConfirmationDialog).

The dialog names the citation being removed so the admin can confirm they
are removing the right one. The actual delete logic is unchanged and only
runs once the admin confirms.

The integration test helper (admin.page.ts deleteCitation) is updated to
click the confirmation dialog's "Confirm" button after clicking "Remove".

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011J2KqZ78uAwuMYZL2J6gCV
@claude claude Bot added the website Tasks related to the web application label Jul 16, 2026
@theosanderson theosanderson changed the title Add confirmation dialog for citation deletion feat(website): Add confirmation dialog for citation deletion Jul 16, 2026
@theosanderson
theosanderson requested a review from tombch July 16, 2026 13:07
@theosanderson
theosanderson marked this pull request as ready for review July 16, 2026 13:09
@claude

claude Bot commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

Claude finished @theosanderson's task in 1m 12s —— View job


Reviewing PR #6919

Todo list:

  • Gather context (PR diff, changed files)
  • Review AdminSeqSetCitationsSection.tsx changes
  • Review admin.page.ts test changes
  • Cross-check against existing displayConfirmationDialog usage (e.g. SeqSetItemActions.tsx) for consistency
  • Post final summary review

Summary

Clean, small change. The implementation follows the exact same displayConfirmationDialog pattern already used elsewhere in the codebase (e.g. SeqSetItemActions.tsx), and the integration test update (page.getByRole('button', { name: 'Confirm' })) matches the convention used by every other confirmation-dialog test in this repo (group.page.ts, edit.page.ts, seqset.page.ts, etc.), so it should be reliable.

A few notes (none blocking):

  • Splitting handleDelete (sync, shows dialog) from deleteCitation (async, does the actual delete) is a nice fix — it also correctly removes the need for the eslint-disable @typescript-eslint/no-misused-promises, since AdminSeqSetCitationsTable's onDelete prop is typed as (sourceDOI: string) => void.
  • The citation title fallback (citation?.source.title ?? sourceDOI) only falls back to the DOI when the citation isn't found in citationList at all, not when title is an empty string. That's fine in practice since AddSeqSetCitationForm already requires and trims a non-empty title before a citation can be created.
  • No security concerns — the confirmation text is rendered as JSX text content (not dangerouslySetInnerHTML), so no XSS risk from citation titles/DOIs.

No inline comments — nothing actionable to flag.

@theosanderson
theosanderson merged commit a4ad140 into main Jul 16, 2026
59 checks passed
@theosanderson
theosanderson deleted the claude/seqsets-remove-confirm-k8jxsr branch July 16, 2026 13:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

website Tasks related to the web application

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants