From 4c3cfb973d03a6ff95b87f27a8e8da4af74eb91f Mon Sep 17 00:00:00 2001 From: Peter Rounce Date: Wed, 17 Jun 2026 12:35:27 +0000 Subject: [PATCH] 2FA: close recovery-codes modal on Enter MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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) --- CLAUDE.md | 2 +- docker/card/admin-ui/src/components/two-factor-card.tsx | 9 ++++++++- docker/card/build/build.go | 2 +- 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/CLAUDE.md b/CLAUDE.md index 50e8e83..9d82644 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -93,7 +93,7 @@ Entry point: `main.go` → opens SQLite DB → runs CLI or starts HTTP server on - `phoenix/` — HTTP client for Phoenix Server API (invoices, payments, balance, channels). Uses basic auth from phoenix config (password cached at startup with `sync.Once`) - `crypto/` — AES-CMAC authentication and AES decryption for Bolt Card NFC protocol - `util/` — Error handling helpers (`CheckAndLog`), random hex generation, QR code encoding -- `build/` — Version string (currently "0.22.0"), date/time injected at build +- `build/` — Version string (currently "0.22.1"), date/time injected at build - `web-content/` — Static assets under `public/`, SPA build output under `admin/spa/` ### Route Groups (`web/app.go`) diff --git a/docker/card/admin-ui/src/components/two-factor-card.tsx b/docker/card/admin-ui/src/components/two-factor-card.tsx index 77a77cc..f5d230c 100644 --- a/docker/card/admin-ui/src/components/two-factor-card.tsx +++ b/docker/card/admin-ui/src/components/two-factor-card.tsx @@ -171,7 +171,14 @@ export function TwoFactorCard() { {/* Recovery codes shown once */} !o && setRecoveryCodes(null)}> - + { + if (e.key === "Enter") { + e.preventDefault(); + setRecoveryCodes(null); + } + }} + > Save your recovery codes diff --git a/docker/card/build/build.go b/docker/card/build/build.go index 5340356..5fac32c 100644 --- a/docker/card/build/build.go +++ b/docker/card/build/build.go @@ -1,5 +1,5 @@ package build -var Version string = "0.22.0" +var Version string = "0.22.1" var Date string var Time string