From 5ab7834b227a8a1c724b9eb716ffa6d5d614e0be Mon Sep 17 00:00:00 2001 From: Anoyou <13214236+Anoyou@users.noreply.github.com> Date: Tue, 11 Aug 2026 23:29:59 +0800 Subject: [PATCH] fix(gui): prevent accidental Add Provider modal dismissal MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Clicking the modal-overlay backdrop closed the Add Provider modal and unmounted it, discarding everything the user had already typed (provider name, base URL, API key). The same teardown fired when a text selection drag started inside an input was released outside the card. Remove the overlay onClick so the backdrop no longer dismisses the modal. The explicit close paths are unchanged: the × button, Escape, and the existing close-on-successful-add. Add a regression test that mounts the modal, types into the form, clicks the backdrop, simulates a selection drag released on the backdrop, and asserts the modal stays open with its input intact; the × button and Escape still close it. --- gui/src/components/AddProviderModal.tsx | 8 +- .../add-provider-modal-backdrop.test.tsx | 155 ++++++++++++++++++ 2 files changed, 161 insertions(+), 2 deletions(-) create mode 100644 gui/tests/add-provider-modal-backdrop.test.tsx diff --git a/gui/src/components/AddProviderModal.tsx b/gui/src/components/AddProviderModal.tsx index 21a7e702f0..979b680976 100644 --- a/gui/src/components/AddProviderModal.tsx +++ b/gui/src/components/AddProviderModal.tsx @@ -229,8 +229,12 @@ export default function AddProviderModal({ return ( <> -