From 5cfa713be19362a192d134ba634eca86b31b0ed1 Mon Sep 17 00:00:00 2001 From: DanS Date: Sat, 17 Oct 2026 23:59:03 -0500 Subject: [PATCH] test(sweep): capture the no-peers node banner on its full-node sweep target MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit renderNodeStatusBanner suppresses itself during a UI sweep (the forced demo state would otherwise paint a banner over every tab). Add a narrow opt-in (sweep_show_node_banner_) so ONLY the overview-no-peers target shows it; every other capture is unchanged. The target also clears connection_in_progress_ so the evaluator classifies the state as no-peers rather than "connecting". Verified in a full-node + DRAGONX_ENABLE_UI_SWEEP build: the banner renders as "Connected, but no network peers โ€” the node can't sync ยท Check your internet connection and firewall, then restart the node to find peers." (Restart button only appears with an embedded daemon, which the sweep has none of.) Co-Authored-By: Claude Opus 4.8 --- src/app.cpp | 4 +++- src/app.h | 1 + src/app_sweep.cpp | 4 +++- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/app.cpp b/src/app.cpp index 098a427..c0b8ba0 100644 --- a/src/app.cpp +++ b/src/app.cpp @@ -2637,7 +2637,9 @@ void App::renderNodeStatusBanner() // wallet switch, an in-flight daemon restart, the screenshot sweep (forces demo state), and // shutdown. tryConnect() sets connection_in_progress_ before the first render on normal // startup, so the ordinary boot path is covered by the evaluator's own in-progress guard. - if (capture_mode_ || isShuttingDown()) return; + // Suppressed during a UI sweep (its forced demo state would otherwise paint a banner over every + // tab) โ€” except on the one sweep target that exists to capture the banner itself. + if ((capture_mode_ && !sweep_show_node_banner_) || isShuttingDown()) return; if (getWizardPhase() != WizardPhase::None) return; if (wallet_switch_phase_.load() != 0) return; if (daemon_restarting_.load()) return; diff --git a/src/app.h b/src/app.h index aaba7ff..5f7130d 100644 --- a/src/app.h +++ b/src/app.h @@ -1676,6 +1676,7 @@ private: // The full sweep's private temp dir (demo wallet files and folders); "" when none. std::string sweep_sandbox_; bool sweep_chat_identity_fabricated_ = false; // seedChatDemoData() made the demo chat identity + bool sweep_show_node_banner_ = false; // let the node-status banner render on its sweep target void applyHealthyDemoState(); // reset the connection/encryption flags to the healthy demo values void sweepEnsureDemoChatIdentity(); // re-fabricate a demo chat identity if none (sweep teardown) void writeSweepManifest() const; diff --git a/src/app_sweep.cpp b/src/app_sweep.cpp index a0a9b8b..c518321 100644 --- a/src/app_sweep.cpp +++ b/src/app_sweep.cpp @@ -754,8 +754,10 @@ void App::buildSweepCatalog() a.state_.sync.syncing = false; a.state_.sync.blocks = 3124322; a.state_.sync.headers = 3124322; a.connection_status_ = "Connected"; + a.connection_in_progress_ = false; // else the evaluator treats it as "connecting", not no-peers + a.sweep_show_node_banner_ = true; // allow the banner (suppressed on every other target) }, - resetDemoSync); + [resetDemoSync](App& a) { a.sweep_show_node_banner_ = false; resetDemoSync(a); }); // Chat with no derived identity yet โ€” the states that previously ALL said "unlock your wallet" (P3). // Setup clears the fabricated demo identity (clearIdentity wipes only the key; the demo messages stay