test(sweep): add capture surfaces for the Wave-1 standalone modals

Register sweep surfaces so the redesigned Wave-1 modals get captured for visual
review: modal-qr-popup, modal-request-payment, modal-validate-address,
modal-address-label, modal-daemon-prompt, and modal-antivirus (the last renders
only on Windows, where its #ifdef body compiles). Each is driven through the
dialog's public show()/flag; teardown closes it. Adds a static hide() to
RequestPaymentDialog / ValidateAddressDialog / AddressLabelDialog for clean sweep
teardown (they had no public close). The contact add/edit and explorer block-detail
modals are tab-embedded and not yet surfaced.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-07-14 17:15:24 -05:00
parent abbdf3f4f7
commit 21be39c725
6 changed files with 50 additions and 0 deletions

View File

@@ -24,6 +24,10 @@
#include "ui/windows/bootstrap_download_dialog.h"
#include "ui/windows/daemon_download_dialog.h"
#include "ui/windows/xmrig_download_dialog.h"
#include "ui/windows/qr_popup_dialog.h"
#include "ui/windows/request_payment_dialog.h"
#include "ui/windows/validate_address_dialog.h"
#include "ui/windows/address_label_dialog.h"
#include "ui/pages/settings_page.h"
#include "util/platform.h"
#include "wallet/wallet_capabilities.h"
@@ -325,6 +329,25 @@ void App::buildSweepCatalog()
a.show_pin_remove_ = false; a.pin_status_.clear();
memset(a.pin_old_buf_, 0, sizeof(a.pin_old_buf_));
});
// Wave-1 standalone dialogs (rendered globally from App::render, so any page works).
add("modal-qr-popup", ui::NavPage::Receive,
[](App&) { ui::QRPopupDialog::show(kDemoZAddr, "Savings"); },
[](App&) { ui::QRPopupDialog::close(); });
add("modal-request-payment", ui::NavPage::Receive,
[](App&) { ui::RequestPaymentDialog::show(kDemoZAddr); },
[](App&) { ui::RequestPaymentDialog::hide(); });
add("modal-validate-address", ui::NavPage::Receive,
[](App&) { ui::ValidateAddressDialog::show(); },
[](App&) { ui::ValidateAddressDialog::hide(); });
add("modal-address-label", ui::NavPage::Overview,
[](App& a) { ui::AddressLabelDialog::show(&a, kDemoZAddr, true); },
[](App&) { ui::AddressLabelDialog::hide(); });
add("modal-daemon-prompt", ui::NavPage::Settings,
[](App& a) { a.daemon_update_bundled_size_ = 12345678ull; a.show_daemon_update_prompt_ = true; },
[](App& a) { a.show_daemon_update_prompt_ = false; });
add("modal-antivirus", ui::NavPage::Mining,
[](App& a) { a.pending_antivirus_dialog_ = true; },
[](App& a) { a.pending_antivirus_dialog_ = false; });
add("modal-about", ui::NavPage::Overview,
[](App& a) { a.show_about_ = true; }, [](App& a) { a.show_about_ = false; });
add("modal-settings", ui::NavPage::Settings,

View File

@@ -251,6 +251,9 @@ public:
static bool isOpen() { return s_open; }
// Close the dialog (used by the UI sweep teardown).
static void hide() { s_open = false; }
private:
static inline bool s_open = false;
static inline App* s_app = nullptr;

View File

@@ -59,6 +59,15 @@ void RequestPaymentDialog::show(const std::string& address)
}
}
void RequestPaymentDialog::hide()
{
s_open = false;
if (s_qr_texture != 0) {
FreeQRTexture(s_qr_texture);
s_qr_texture = 0;
}
}
void RequestPaymentDialog::render(App* app)
{
if (!s_open) return;

View File

@@ -26,6 +26,11 @@ public:
* @brief Render the dialog (call each frame)
*/
static void render(App* app);
/**
* @brief Close the dialog + free its QR texture (used by the UI sweep teardown)
*/
static void hide();
};
} // namespace ui

View File

@@ -42,6 +42,11 @@ bool ValidateAddressDialog::isOpen()
return s_open;
}
void ValidateAddressDialog::hide()
{
s_open = false;
}
void ValidateAddressDialog::render(App* app)
{
if (!s_open) return;

View File

@@ -33,6 +33,11 @@ public:
*/
static bool isOpen();
/**
* @brief Close the dialog (used by the UI sweep teardown)
*/
static void hide();
private:
static bool s_open;
static bool s_validated;