From c601ea643180e0e259c8e665818900ef2d4fee74 Mon Sep 17 00:00:00 2001
From: Luann Moreira
Date: Tue, 26 May 2026 16:05:19 -0300
Subject: [PATCH] fix(ui-react): migrate raw overlay wrappers to Main Dialog
Components
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Five components were implementing dialogs with `fixed inset-0` div
wrappers instead of using the shared BaseDialog/ConfirmDialog primitives.
This meant no focus trap, no native ESC handling, and no backdrop-click
semantics — each component reinvented the wheel differently.
Migrate:
- MfaDisableDialog → BaseDialog (size="sm")
- MfaRecoveryCodesModal → BaseDialog (size="md")
- MfaRecoveryTimeoutModal → BaseDialog (canClose={() => false}) to block
both ESC and backdrop click — user must use the explicit Close button
- Profile (DeleteAccountWarningDialog) → BaseDialog (size="md")
- SessionDetails (Delete Recording, Close Session) → ConfirmDialog with
per-dialog error state so errors are cleared on re-open
Update tests:
- Add HTMLDialogElement.showModal/close stubs to global test/setup.ts
so all BaseDialog-using components work under jsdom
- Mock useFocusTrap in MfaDisableDialog, MfaRecoveryTimeoutModal, and
MfaRecover test files
- Replace old DOM-traversal backdrop tests (`.relative`/previousSibling)
with fireEvent on the native