Add a confirmation step before deleting API keys and webhooks
Description
src/app/api-keys/page.tsx revokes a key the instant "Revoke" is clicked, and src/app/webhooks/page.tsx deletes a webhook on the first click of "Remove" — both destructive and irreversible, with no confirmation. The repo already ships ConfirmDialog (currently unused). This issue gates both deletions behind it.
Requirements and context
- Repository scope:
Agentpay-Org/Agentpay-frontend only.
- Wire
ConfirmDialog into both pages: clicking Revoke/Remove opens the dialog naming the target; only Confirm performs the apiDelete.
- Show a success
toast and refresh the list on success; surface failures via the existing role="alert".
- Keep the dialog dismissible via Cancel and ensure the originating button regains focus when it closes (coordinate with the dialog-a11y issue if landed).
Suggested execution
- Fork the repo and create a branch
git checkout -b feature/api-keys-11-confirm-before-revoke
- Implement changes
- Write code in:
src/app/api-keys/page.tsx and src/app/webhooks/page.tsx.
- Write comprehensive tests in: create
src/app/api-keys/page.test.tsx and src/app/webhooks/page.test.tsx — assert Cancel makes no call, Confirm deletes and refreshes, and error path alerts.
- Add documentation: note the confirm step in
README.md.
- Validate
role="dialog" / aria-modal semantics are reached.
- Test and commit
Test and commit
- Run
npm run lint, npm run typecheck, npm test, and npm run build.
- Cover edge cases: delete failure, double-confirm prevention, and empty list after deletion.
- Include the
npm test output.
Example commit message
feat(api-keys): gate key/webhook deletion behind ConfirmDialog with tests
Guidelines
- Minimum 95 percent test coverage for the changed pages.
- Clear, reviewer-focused documentation.
- Timeframe: 96 hours.
Community & contribution rewards
- 💬 Join the AgentPay community on Discord for questions, reviews, and faster merges: https://discord.gg/eXvRKkgcv
- ⭐ This is a GrantFox OSS / Official Campaign task and may be rewarded. When your PR is merged you'll be prompted to rate the project — if this issue and the maintainers helped you ship, we'd be grateful for a 5-star rating. Clear questions in Discord and tidy, well-tested PRs are the fastest path to a merge and a reward.
Add a confirmation step before deleting API keys and webhooks
Description
src/app/api-keys/page.tsxrevokes a key the instant "Revoke" is clicked, andsrc/app/webhooks/page.tsxdeletes a webhook on the first click of "Remove" — both destructive and irreversible, with no confirmation. The repo already shipsConfirmDialog(currently unused). This issue gates both deletions behind it.Requirements and context
Agentpay-Org/Agentpay-frontendonly.ConfirmDialoginto both pages: clicking Revoke/Remove opens the dialog naming the target; only Confirm performs theapiDelete.toastand refresh the list on success; surface failures via the existingrole="alert".Suggested execution
git checkout -b feature/api-keys-11-confirm-before-revokesrc/app/api-keys/page.tsxandsrc/app/webhooks/page.tsx.src/app/api-keys/page.test.tsxandsrc/app/webhooks/page.test.tsx— assert Cancel makes no call, Confirm deletes and refreshes, and error path alerts.README.md.role="dialog"/aria-modalsemantics are reached.Test and commit
npm run lint,npm run typecheck,npm test, andnpm run build.npm testoutput.Example commit message
feat(api-keys): gate key/webhook deletion behind ConfirmDialog with testsGuidelines
Community & contribution rewards