From 93711d981d57338972de60e710fffe7000ee91db Mon Sep 17 00:00:00 2001 From: Alex Hope-O'Connor Date: Mon, 4 May 2026 12:58:38 +1000 Subject: [PATCH] Portal home: single Status card; rename params placement API - Merge initial status and guidance into one wm-card (Status) on Home. - Add .wm-home-summary styling for the primary status line. - Replace legacy setParamsPage with setParametersEmbeddedInWifi (matches _paramsInWifi / SPA Setup vs WiFi placement); remove setParamsPage. - Update README, handlers comment, and advanced-options tests. --- README.md | 2 +- lib/WiFiManager/include/WiFiManager.h | 13 ++++++++++--- lib/WiFiManager/include/WiFiManagerHandlers.h | 2 +- lib/WiFiManager/include/templates/CSS.h | 1 + lib/WiFiManager/include/templates/PortalAppJS.h | 8 ++++---- lib/WiFiManager/src/WiFiManager.cpp | 9 ++------- .../tests/test_advanced_options.cpp | 4 ++-- 7 files changed, 21 insertions(+), 18 deletions(-) diff --git a/README.md b/README.md index 71bc322..9664714 100644 --- a/README.md +++ b/README.md @@ -32,7 +32,7 @@ This fork currently includes the following architectural improvements: - **Capability-driven UI flags** in bootstrap/API payloads so features like info, update, erase, and action visibility can be controlled by backend state. - **SPA-native feedback UX** using in-DOM dialog/toast behavior rather than page-based action flows. - **Request-scoped shell rendering**: the root portal page is built for each `GET /` from `WM_ROOT_SHELL_TEMPLATE` using a fresh placeholder registry. Shell inputs are only `%PAGE_TITLE%`, `%STYLES%`, `%BOOTSTRAP_JSON%`, and `%PORTAL_APP_JS%` — filled in `WiFiManagerHandlers` from WiFiManager state and embedded assets (not from a server-wide template registry). -- **Customization via WiFiManager APIs** (`setTitle`, `setShowInfo`, `setParamsPage`, bootstrap-facing flags, etc.), not by exposing placeholder-registry mutation to consumers. +- **Customization via WiFiManager APIs** (`setTitle`, `setShowInfo`, `setParametersEmbeddedInWifi`, bootstrap-facing flags, etc.), not by exposing placeholder-registry mutation to consumers. - A clearer separation between: - shell rendering (handlers + SPA bootstrap) - JSON API responses diff --git a/lib/WiFiManager/include/WiFiManager.h b/lib/WiFiManager/include/WiFiManager.h index 5277d4d..a8edd8f 100644 --- a/lib/WiFiManager/include/WiFiManager.h +++ b/lib/WiFiManager/include/WiFiManager.h @@ -470,8 +470,15 @@ class WiFiManager // set the webapp title, default WiFiManager void setTitle(String title); - // add params to its own menu page and remove from wifi, NOT TO BE COMBINED WITH setMenu! - void setParamsPage(bool enable); + /** + * Where custom parameters (`WiFiManagerParameter`) appear in the portal SPA (one placement only). + * + * - true (default): parameters render on the WiFi route (`#/wifi`) together with SSID/password. + * - false: parameters render only on the Setup route (`#/setup`); they are not duplicated on WiFi. + * + * Bootstrap exposes the same flag as `features.paramsInWifi`. + */ + void setParametersEmbeddedInWifi(boolean embedded); // get last connection result, including autoconnect and portal credential-save attempts uint8_t getLastConxResult(); @@ -707,7 +714,7 @@ class WiFiManager boolean _apClientCheck = false; // keep cp alive if ap have station boolean _webClientCheck = true; // keep cp alive if web have client boolean _scanDispOptions = false; // show percentage in scans not icons - boolean _paramsInWifi = true; // show custom parameters on wifi page + boolean _paramsInWifi = true; // if false, custom params only on #/setup (see setParametersEmbeddedInWifi) boolean _showInfo = true; // show Info in portal SPA boolean _showInfoErase = true; // info page erase button boolean _showInfoUpdate = true; // info page update button diff --git a/lib/WiFiManager/include/WiFiManagerHandlers.h b/lib/WiFiManager/include/WiFiManagerHandlers.h index 8d8cb95..b57f671 100644 --- a/lib/WiFiManager/include/WiFiManagerHandlers.h +++ b/lib/WiFiManager/include/WiFiManagerHandlers.h @@ -21,7 +21,7 @@ #endif // Portal UI customization is driven by WiFiManager state and helpers such as setTitle(), setShowInfo(), -// setParamsPage(), setShowInfoUpdate(), etc., surfaced through bootstrap/API JSON — not by mutating template +// setParametersEmbeddedInWifi(), setShowInfoUpdate(), etc., surfaced through bootstrap/API JSON — not by mutating template // placeholder registries. // ----------------------------------------------------------------------------------------------- diff --git a/lib/WiFiManager/include/templates/CSS.h b/lib/WiFiManager/include/templates/CSS.h index 76eb2f5..6f7aaa5 100644 --- a/lib/WiFiManager/include/templates/CSS.h +++ b/lib/WiFiManager/include/templates/CSS.h @@ -79,6 +79,7 @@ const char CSS_STYLE[] PROGMEM = "