fix(credentials): a refused revoke must say so where the user is looking - #243
Merged
Merged
Conversation
Revoking a credential closed its confirmation before the request ran, then reported failure through the panel-wide error under the panel header. On a long list the row sits far below that, so the dialog just vanished and the credential stayed. ConfirmationDialog already carried busy and error props that no caller used. The confirmation now stays open while the request runs, closes only on success, and draws the failure in its own body. This is the Revoke sibling of the Save access fix in #234. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LGizvh2GBb4wnVqs7qKNtP
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.
What part this touches
Settings → Credentials. Each stored secret gets a row with Rotate and
Revoke. Revoke opens
ConfirmationDialog, the shared yes/no modal usedacross the webApp.
That dialog already accepts two props no caller had ever passed:
busy, whichdisables its buttons and blocks dismissal, and
error, which draws a messagein its own body.
The bug
Press Revoke on a credential, confirm, and let the request fail. The
confirmation vanishes, the credential is still listed, and no explanation is
visible.
Two things hid it:
setRevokeTarget(null)ran BEFORE the request. The dialog was already gonewhen the failure landed.
error. That message draws once, directlyunder the panel header. On a list of fifteen credentials the row is far
below it, off screen.
This is the same defect #234 fixed for Save access in this same file. That
fix gave the access editor its own
accessError, drawn beside the button.Revoke was the sibling action and kept the old shape.
The fix
busyset.errorprop, so the message draws besidethe button that caused it.
confirmation for another credential.
errorkeeps load, add and rotate failures. The two are notfolded together.
No new markup and no new CSS.
ConfirmationDialogalready drew both states.The risk trade
The dialog now lives longer. It stays on screen for the length of the request
instead of closing at once, so a slow revoke feels slower.
busycovers that: both buttons disable and the overlay stops dismissing, sothe wait reads as work rather than as a stuck modal. The existing
if (revoking !== null) return;guard already blocked a second revoke.Rejected alternative: draw the message under the credential's row. It
duplicates what the dialog can already show, and it puts the text where the
user is not looking, which is the bug being fixed.
Tests
packages/webapp/test/org-credentials-panel.test.tsx, two new tests:keeps the credential listed;
later success closes the dialog.
Counts in this worktree:
Reverting only
OrgCredentialsPanel.tsxfails both, and the message is thebug stated plainly:
The dialog is gone before the failure can be shown.
Deploy
One artifact ships it: the control-plane Worker, which carries the webApp
bundle.
A push to
maindeploys canary. No migration. No box or payload change.Rollback:
A revert restores the silent close. It loses no data.
🤖 Generated with Claude Code
https://claude.ai/code/session_01LGizvh2GBb4wnVqs7qKNtP