Repository navigation
[Issue #12624] Update api key Delete modal - #12791
Merged
Merged
Conversation
nkhazi
approved these changes
Oct 15, 2026
nkhazi
left a comment
Collaborator
There was a problem hiding this comment.
Looks good. Keying the rows by api_key_id makes sure the right key gets deleted after a new one is added, and the test covers it well. The shared submit button and the page-level alert are nice too.
Approved ✅
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes #12624
Changes proposed
ApiKeyModal.tsxto bring delete mode in line with the Figma design:Delete "{name}" API key?title, new description, no placeholder, yellow "Delete key" button with a trash iconApiKeyAlertProvider.tsxto hold a success message for the page, render it as a slim success alert in arole="status"region, and move focus to#main-contentwhen one is shownTableWithResponsiveHeader.tsxto accept optionalrowKeysand to key cells by column, so stateful cell content stays with its row when rows are added or reorderedApiKeyTableClient.tsxto pass each key'sapi_key_idas its row key and show the deleted key message after a deletepage.tsxto wrap the dashboard in the alert provider and place the alert between the header and the tableindex.tsto add and revise the delete modal and deleted key alert strings, and remove the unused delete placeholder and success modal stringsApiKeyModal.test.tsxto cover the new delete states (validation, preserved input with retry on server error, loading, Enter to submit, closing on success, unique input ids, a11y with errors shown), and removed the globaluseRefmockApiKeyTableClient.test.tsxto add a regression test for a new key added at the top, plus tests for the alert after a delete and its removal when the create, edit, or delete modal opensApiKeyTable.test.tsxto use the new strings, find the open modal by itsis-visibleclass, and drop the globaluseRefmockApiKeyAlertProvider.test.tsxto cover showing, replacing, and hiding the alert, focus moving to main content, and an a11y scanTableWithResponsiveHeader.test.tsxto verify cell state stays with its row when rowKeys are providedContext for reviewers
Keys come back newest-first and the table keyed rows and cells by index, so a newly created key took over row 0's existing modals and their state. That is how deleting a new key could show the wrong key's name. Keying rows by
api_key_idfixes it, and closing the modal on success removes the stale success screen entirely.Validation steps
Confirm tests pass.
Local testing:
/developers/api-dashboardwith at least two keys (create new ones if necessary).deleteand submit. Confirm the modal closes, focus moves to the main content, the row is removed, and a success alert above the table readsAPI key "{name}" has been deleted successfully.DELETE /api/user/api-keys/{id}request in devtools and submit. Confirm the "Unable to delete API key" alert appears,deletestays in the input, and the button can be clicked again.