From fb93888d3fa01d4ec1e036133bfd5a25346cca6f Mon Sep 17 00:00:00 2001 From: nixpanel Date: Sat, 4 Jul 2026 09:35:00 -0500 Subject: [PATCH] Wire up remaining placeholder settings, implement menu search (v2.4.0) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Custom dashboard, Modern plugins page, and Modern comments page toggles previously had no effect at all — their respective takeovers/ redirects (DashboardTakeover, SubApps' Plugins/Comments handling, MenuSerializer's link rewrites) ran unconditionally regardless of the setting. All three now default to their previous always-on behavior but can actually be turned off. - Menu search had zero implementation. Sidebar.vue now shows a real search box (gated on the setting) that filters both the WP-native menu and the Aurora nav section by title, auto-expanding matching sections. - Removed "Modern posts table" and "Modern users page" toggles (and their now-empty Posts/Users settings categories) — both described a custom management page that was never built. A checkbox with nothing behind it is worse than no checkbox. Verified all four live: dashboard/plugins/comments toggles correctly flip between the Aurora and native experience and back; menu search filters correctly and clears back to the full menu. Co-Authored-By: Claude Sonnet 5 --- CHANGELOG.md | 24 +++++++ admin/src/Pages/DashboardTakeover.php | 7 ++ admin/src/Pages/SubApps.php | 8 +++ admin/src/Shell/MenuSerializer.php | 9 ++- app/package.json | 2 +- app/src/pages/settings/settingsConfig.js | 28 -------- app/src/shell/components/Sidebar.vue | 87 ++++++++++++++++++++++-- aurora-admin.php | 4 +- 8 files changed, 129 insertions(+), 40 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6e4ab58..029b221 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,30 @@ 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.0] - 2026-07-04 + +### Added +- Settings > Menu's "Menu search" toggle now actually does something — + previously had no implementation at all. Shows a real search box at the + top of the sidebar that filters both the WP-native menu list and the + Aurora nav section by title, auto-expanding every section with a match. + +### Fixed +- Settings > Dashboard's "Custom dashboard" toggle now actually gates the + dashboard takeover — previously the Aurora dashboard always replaced the + native one regardless of this setting, with no way to turn it back off. +- Settings > Plugins' "Modern plugins page" and Settings > Comments' + "Modern comments page" toggles now actually gate their respective + takeovers/redirects the same way — previously both ran unconditionally + regardless of these settings. + +### Removed +- Settings > Posts' "Modern posts table" and Settings > Users' "Modern + users page" toggles — both described a custom management interface that + was never built. Shipping a checkbox with nothing behind it is worse + than not having the checkbox; removed rather than left as dead UI. Their + categories are removed too, since they had no other fields. + ## [2.3.1] - 2026-07-04 ### Fixed diff --git a/admin/src/Pages/DashboardTakeover.php b/admin/src/Pages/DashboardTakeover.php index e126723..7039679 100644 --- a/admin/src/Pages/DashboardTakeover.php +++ b/admin/src/Pages/DashboardTakeover.php @@ -27,6 +27,13 @@ class DashboardTakeover public static function is_dashboard() { + // Settings > Dashboard > "Custom dashboard" — previously always on + // regardless of this setting; default true so existing installs keep + // their current behavior until explicitly turned off. + if (!Settings::get("use_custom_dashboard", true)) { + return false; + } + return isset($GLOBALS["pagenow"]) && $GLOBALS["pagenow"] === "index.php"; } diff --git a/admin/src/Pages/SubApps.php b/admin/src/Pages/SubApps.php index d950288..943f6a4 100644 --- a/admin/src/Pages/SubApps.php +++ b/admin/src/Pages/SubApps.php @@ -3,6 +3,7 @@ namespace AuroraAdmin\Pages; use AuroraAdmin\Utility\Assets; use AuroraAdmin\Licensing\License; +use AuroraAdmin\Options\Settings; defined("ABSPATH") || exit(); @@ -111,6 +112,13 @@ class SubApps { global $pagenow; + // Settings > Comments > "Modern comments page" — previously always + // redirected regardless of this setting; default true so existing + // installs keep their current behavior until explicitly turned off. + if (!Settings::get("modern_comments", true)) { + return; + } + if ($pagenow !== "edit-comments.php" || !current_user_can("edit_posts")) { return; } diff --git a/admin/src/Shell/MenuSerializer.php b/admin/src/Shell/MenuSerializer.php index 9804acb..75ebc56 100644 --- a/admin/src/Shell/MenuSerializer.php +++ b/admin/src/Shell/MenuSerializer.php @@ -1,6 +1,8 @@ Plugins / Settings > Comments. + if ($slug === "plugins.php" && Settings::get("modern_plugins", true)) { return admin_url("plugins.php?page=aurora-admin-plugins"); } - if ($slug === "edit-comments.php") { + if ($slug === "edit-comments.php" && Settings::get("modern_comments", true)) { return admin_url("admin.php?page=aurora-admin-comments"); } diff --git a/app/package.json b/app/package.json index e968818..0277546 100644 --- a/app/package.json +++ b/app/package.json @@ -1,6 +1,6 @@ { "name": "aurora-admin-app", - "version": "2.3.1", + "version": "2.4.0", "private": true, "type": "module", "scripts": { diff --git a/app/src/pages/settings/settingsConfig.js b/app/src/pages/settings/settingsConfig.js index 79293de..87cffa0 100644 --- a/app/src/pages/settings/settingsConfig.js +++ b/app/src/pages/settings/settingsConfig.js @@ -152,20 +152,6 @@ export const settingsCategories = [ }, ], }, - { - id: 'posts', - title: 'Posts', - subtitle: 'Post management and display preferences', - icon: 'dashicons-admin-post', - fields: [ - { - key: 'modern_posts', - type: 'toggle', - label: 'Modern posts table', - description: 'Use the Aurora posts management interface.', - }, - ], - }, { id: 'plugins', title: 'Plugins', @@ -230,20 +216,6 @@ export const settingsCategories = [ }, ], }, - { - id: 'users', - title: 'Users', - subtitle: 'User management and administration settings', - icon: 'dashicons-admin-users', - fields: [ - { - key: 'modern_users', - type: 'toggle', - label: 'Modern users page', - description: 'Use the Aurora users management interface.', - }, - ], - }, { id: 'comments', title: 'Comments', diff --git a/app/src/shell/components/Sidebar.vue b/app/src/shell/components/Sidebar.vue index addcd8c..0ebbf1b 100644 --- a/app/src/shell/components/Sidebar.vue +++ b/app/src/shell/components/Sidebar.vue @@ -86,13 +86,13 @@ const openId = ref( : null) ); -const isExpanded = (item) => openId.value === item.id; +const isExpanded = (item) => isSearching.value || openId.value === item.id; const toggle = (item) => { openId.value = openId.value === item.id ? null : item.id; }; -const auroraExpanded = computed(() => openId.value === AURORA_ID); +const auroraExpanded = computed(() => isSearching.value || openId.value === AURORA_ID); const toggleAuroraNav = () => { openId.value = auroraExpanded.value ? null : AURORA_ID; // Only Aurora's own expand state needs to persist across page loads — @@ -101,6 +101,34 @@ const toggleAuroraNav = () => { localStorage.setItem('aurora-nav-expanded', auroraExpanded.value ? '1' : '0'); }; const isAuroraActive = (item) => normalize(item.url) === current.value; + +// Settings > Menu > "Show a search box at the top of the admin menu" — +// filters both the WP-native menu list and the Aurora nav section by +// title (own item or any submenu item), auto-expanding every section with +// a match so results are visible without also having to click into them. +const showMenuSearch = computed(() => !!props.serverData?.settings?.menu_search); +const searchQuery = ref(''); +const isSearching = computed(() => searchQuery.value.trim() !== ''); +const matchesQuery = (text) => + (text || '').toLowerCase().includes(searchQuery.value.trim().toLowerCase()); + +const filteredMenu = computed(() => { + if (!isSearching.value) return props.menu; + return props.menu + .filter((item) => !item.separator) + .map((item) => { + const titleMatch = matchesQuery(item.title); + const matchingSubs = (item.submenu || []).filter((sub) => matchesQuery(sub.title)); + if (!titleMatch && !matchingSubs.length) return null; + return titleMatch ? item : { ...item, submenu: matchingSubs }; + }) + .filter(Boolean); +}); + +const filteredAuroraNav = computed(() => { + if (!isSearching.value) return props.auroraNav; + return props.auroraNav.filter((item) => matchesQuery(item.title)); +});