From d8bf1ae0497b7728ceebd6c9b00763b6da79843a Mon Sep 17 00:00:00 2001 From: nixpanel Date: Sat, 4 Jul 2026 10:27:58 -0500 Subject: [PATCH] Fix Admin Notices not showing on the Dashboard (v2.4.2) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit admin_notices fires everywhere, but prints inside #wpbody, which DashboardTakeover hides entirely on the Dashboard (to hide the *native* dashboard, not ours) — notices went down with it as collateral damage. Notices::render_for_dashboard() now renders directly inside the visible dashboard frame instead, called from DashboardTakeover::render_mount(); the normal admin_notices path bails on the Dashboard so it isn't rendered twice. Second, independent bug found along the way: wp-admin/js/common.js unconditionally relocates every .notice element on the page to right after the page's

, regardless of where it was placed server-side — without opting out, it would've silently moved our notice right back into the hidden #wpbody. Used core's own documented `below-h2` class to opt out, only for the dashboard render path. Verified live: notice now shows correctly inside the dashboard frame with proper dark styling, and dismisses correctly. Co-Authored-By: Claude Sonnet 5 --- CHANGELOG.md | 16 ++++++++++ PROJECT_STATUS.md | 18 ++++++++++- admin/src/Notices/Notices.php | 46 +++++++++++++++++++++++++++ admin/src/Pages/DashboardTakeover.php | 4 +++ app/package.json | 2 +- app/src/shell/shell-frame.css | 15 +++++++++ app/src/shell/windowChrome.js | 9 ++++++ aurora-admin.php | 4 +-- 8 files changed, 110 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 606b2eb..80d8dd8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,22 @@ version bump. Starts at 2.1.0 — earlier history (the theming rebuild, window chrome/taskbar, Site Editor support, etc.) lives in `git log` and `PROJECT_STATUS.md`, not reconstructed here. +## [2.4.2] - 2026-07-04 + +### Fixed +- Admin Notices only ever showed on the Aurora Dashboard — everywhere + else, `admin_notices` fired normally, but on the Dashboard specifically + the notice was invisible: `DashboardTakeover` hides `#wpbody` entirely + there (to hide the *native* dashboard, not our own), and that's exactly + where WordPress prints `admin_notices` output. Notices now render + directly inside the Aurora dashboard frame instead on that one page. + Along the way, also worked around a separate WordPress core behavior + (`common.js` unconditionally relocates every `.notice` element to right + after the page's `

`) using core's own documented `below-h2` opt-out + class, since without it the notice would've just been silently moved + back into the hidden `#wpbody` by that script regardless of where it + was placed server-side. + ## [2.4.1] - 2026-07-04 ### Fixed diff --git a/PROJECT_STATUS.md b/PROJECT_STATUS.md index d7dd4f5..1e2b03c 100644 --- a/PROJECT_STATUS.md +++ b/PROJECT_STATUS.md @@ -1,6 +1,6 @@ # Aurora Admin v2 — Project Status -_Last updated: 2026-07-04 (latest session — file-integrity tamper protection for the license gate)_ +_Last updated: 2026-07-04 (latest session — remaining placeholder settings wired up, dashboard scrolling and admin notices fixed)_ ## What this project is @@ -628,6 +628,22 @@ compatibility, trust), which wasn't in scope here. ## Key bugs fixed (root causes, in case they resurface) +- **Admin Notices invisible on the Dashboard**: `admin_notices` prints + inside `#wpbody`, which `DashboardTakeover::hide_native()` hides + entirely (to hide the *native* dashboard, not ours) — collateral damage + for anything else relying on that hook there. Fixed with + `Notices::render_for_dashboard()`, called directly inside the visible + dashboard frame (`DashboardTakeover::render_mount()`), with `render()` + (the normal `admin_notices` hook) bailing on the Dashboard so it isn't + rendered twice. **Second, independent bug surfaced by the same fix**: + `wp-admin/js/common.js` unconditionally relocates every `.notice` + element on the page to right after the page's `

` + (`$('.notice').not('.inline, .below-h2').insertAfter($headerEnd)`) — + regardless of where it was placed server-side, it would've moved right + back into the hidden `#wpbody` on its own. Core's own `.below-h2` class + is the documented opt-out; added only for the dashboard render path + (`render_notices($keep_in_place)`), not the normal one, where the + relocation is harmless/expected. - **`.card` global class collision**: original Dashboard cards used `class="card"`, colliding with WP core's `.card { max-width: 520px }`. Fixed by renaming to `.aurora-card*` everywhere. Never use unprefixed diff --git a/admin/src/Notices/Notices.php b/admin/src/Notices/Notices.php index b683123..e406494 100644 --- a/admin/src/Notices/Notices.php +++ b/admin/src/Notices/Notices.php @@ -1,6 +1,8 @@ ($('div.notice').not('.inline, .below-h2').insertAfter(...)), + * regardless of where it was originally placed in the DOM. On every + * other page that's harmless (it's already heading there anyway); on + * the Dashboard it silently moves our notice into the native #wpbody, + * which is hidden entirely by DashboardTakeover — invisible, not gone. + * `below-h2` is core's own documented opt-out class for exactly this + * "leave this notice exactly where I put it" case. + */ + private static function render_notices($keep_in_place) { global $wpdb; $user = wp_get_current_user(); @@ -83,6 +126,9 @@ class Notices $type = in_array($row->type, ["success", "warning", "error", "info"], true) ? $row->type : "info"; $classes = "notice notice-{$type} aurora-native-notice"; + if ($keep_in_place) { + $classes .= " below-h2"; + } if ($row->dismissible) { $classes .= " is-dismissible"; } diff --git a/admin/src/Pages/DashboardTakeover.php b/admin/src/Pages/DashboardTakeover.php index 7039679..abacfbb 100644 --- a/admin/src/Pages/DashboardTakeover.php +++ b/admin/src/Pages/DashboardTakeover.php @@ -3,6 +3,7 @@ namespace AuroraAdmin\Pages; use AuroraAdmin\Utility\Assets; use AuroraAdmin\Options\Settings; +use AuroraAdmin\Notices\Notices; defined("ABSPATH") || exit(); @@ -80,6 +81,9 @@ class DashboardTakeover "settings" => Settings::get_safe(), ]; ?> +
+ +