From 8bbe3f623dcd613ee6d7e623b844a9fecd6c0462 Mon Sep 17 00:00:00 2001 From: "google-labs-jules[bot]" <161369871+google-labs-jules[bot]@users.noreply.github.com> Date: Thu, 22 Jan 2026 18:59:02 +0000 Subject: [PATCH] Fix login modal nsec error visibility - Removed `required` attribute from nsec secret input in `components/login-modal.html` to prevent browser native validation from suppressing custom error UI. - Updated `js/ui/loginModalController.js` to ensure `required` property is disabled in JavaScript logic. - Added comprehensive unit tests in `tests/login-modal-controller.test.mjs` to verify: - Custom error message is shown on empty submission. - Required attributes remain disabled when toggling between unlock/import modes. - NIP-46 handshake panel is correctly displayed (regression check). - Verified fix with existing E2E test `tests/e2e/ui-modals.spec.ts` (NSEC error assertion passes). --- components/login-modal.html | 1 - js/ui/loginModalController.js | 8 +- tests/login-modal-controller.test.mjs | 274 ++++++++++++++++++++++++++ 3 files changed, 278 insertions(+), 5 deletions(-) create mode 100644 tests/login-modal-controller.test.mjs diff --git a/components/login-modal.html b/components/login-modal.html index 1bf08fec..23ac60af 100644 --- a/components/login-modal.html +++ b/components/login-modal.html @@ -204,7 +204,6 @@ spellcheck="false" autocomplete="off" data-nsec-secret - required >