Skip to content

2FA: close recovery-codes modal on Enter (0.22.1)#42

Merged
PeterRounce merged 1 commit into
mainfrom
claude/2fa-recovery-enter-key
Jun 17, 2026
Merged

2FA: close recovery-codes modal on Enter (0.22.1)#42
PeterRounce merged 1 commit into
mainfrom
claude/2fa-recovery-enter-key

Conversation

@PeterRounce

Copy link
Copy Markdown
Member

Summary

  • Pressing Enter on the 2FA recovery-codes modal now activates the Done button (closes the dialog), matching the behaviour of the enrollment ("2FA check") modal where Enter submits the code.
  • Implemented via an onKeyDown handler on the recovery-codes DialogContent: Enter calls preventDefault() (which also suppresses the default Enter-activation of whichever button is focused, e.g. Copy) and clears the codes state to close. Mirrors the enrollment modal's existing pattern.

Why

The recovery-codes dialog had no keyboard shortcut for its primary action; users had to click Done. This makes the keyboard UX consistent with the other 2FA modal.

Version

Bump 0.22.00.22.1 (PATCH — frontend-only UX tweak).

Testing

  • npm run build in docker/card/admin-ui/ passes (frontend-only change; no FE test runner).

🤖 Generated with Claude Code

The recovery-codes dialog (shown once after enabling 2FA) had no
keyboard shortcut for its "Done" button, unlike the enrollment
("2FA check") modal where Enter on the code input submits.

Add an onKeyDown handler to the recovery-codes DialogContent so
Enter calls preventDefault() (also suppressing the default
Enter-activation of whichever button is focused, e.g. Copy) and
closes the dialog — equivalent to clicking Done. Mirrors the
enrollment modal's existing pattern.

Bump version 0.22.0 -> 0.22.1 (PATCH).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@PeterRounce PeterRounce merged commit e92cbe0 into main Jun 17, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant