Include Aurora nav section in the sidebar's single-open accordion (v2.3.1)

Aurora's branded nav section had its own independent expand/collapse
state, so it stayed open regardless of which native menu section was
expanded — the one exception to the single-open accordion. Unified
under one openId ref (a sentinel value for Aurora alongside real
native-menu item ids) so expanding either collapses the other.

Co-Authored-By: Claude Sonnet 5 <[email protected]>
This commit is contained in:
nixpanel
2026-07-04 08:40:04 -05:00
co-authored by Claude Sonnet 5
parent 39af8d650d
commit 1578481106
4 changed files with 39 additions and 14 deletions
+9
View File
@@ -5,6 +5,15 @@ 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.3.1] - 2026-07-04
### Fixed
- Sidebar accordion now treats the "Aurora" branded nav section as part of
the same single-open accordion as the WP-native menu list, instead of
being the one exception that stayed open regardless of what else was
expanded. Expanding any native section now collapses Aurora too, and
vice versa.
## [2.3.0] - 2026-07-04
### Added
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "aurora-admin-app",
"version": "2.3.0",
"version": "2.3.1",
"private": true,
"type": "module",
"scripts": {
+27 -11
View File
@@ -63,11 +63,28 @@ const isSectionActive = (item) => {
return (item.submenu || []).some((sub) => normalize(sub.url) === current.value);
};
// Accordion: only one section's submenu open at a time, so expanding one
// closes the rest instead of the list growing indefinitely. Starts on
// whichever section is active (each nav is a full page load in this
// multi-page admin, so there's no need to react to URL changes afterward).
const openId = ref(props.menu.find((item) => isSectionActive(item))?.id ?? null);
// Accordion: only one section's submenu open at a time — the WP-native
// menu list and the Aurora branded section below it are one shared
// accordion, not two independent ones, so expanding either closes
// whichever else was open (including Aurora, previously the one
// exception). AURORA_ID is a sentinel alongside the real native-menu item
// ids, since Aurora's own nav isn't one of the `menu` array's entries.
const AURORA_ID = '__aurora__';
const isAuroraSectionActive = () =>
props.auroraNav.some((item) => normalize(item.url) === current.value);
// Starts on whichever section is active (each nav is a full page load in
// this multi-page admin, so there's no need to react to URL changes
// afterward); falls back to Aurora expanded (its long-standing default)
// unless the user previously collapsed it, matching the old per-browser
// localStorage preference.
const openId = ref(
props.menu.find((item) => isSectionActive(item))?.id ??
(isAuroraSectionActive() || localStorage.getItem('aurora-nav-expanded') !== '0'
? AURORA_ID
: null)
);
const isExpanded = (item) => openId.value === item.id;
@@ -75,13 +92,12 @@ const toggle = (item) => {
openId.value = openId.value === item.id ? null : item.id;
};
// Aurora's own branded nav section (Settings, Menu Creator, Admin Notices,
// Role Editor, Activity Log, Database Explorer) — separate from the
// WP-native menu list above it. Expanded by default; per-browser preference
// kept in localStorage, same pattern as the main collapsed-menu state.
const auroraExpanded = ref(localStorage.getItem('aurora-nav-expanded') !== '0');
const auroraExpanded = computed(() => openId.value === AURORA_ID);
const toggleAuroraNav = () => {
auroraExpanded.value = !auroraExpanded.value;
openId.value = auroraExpanded.value ? null : AURORA_ID;
// Only Aurora's own expand state needs to persist across page loads —
// native sections already resolve their open/closed state from whether
// they're active on the current page.
localStorage.setItem('aurora-nav-expanded', auroraExpanded.value ? '1' : '0');
};
const isAuroraActive = (item) => normalize(item.url) === current.value;
+2 -2
View File
@@ -3,7 +3,7 @@
* Plugin Name: Aurora Admin
* Plugin URI: https://aurora.co
* Description: A modern, fast WordPress admin interface.
* Version: 2.3.0
* Version: 2.3.1
* Author: Aurora
* Text Domain: aurora-admin
* Domain Path: /languages/
@@ -14,7 +14,7 @@
defined("ABSPATH") || exit();
define("AURORA_ADMIN_VERSION", "2.3.0");
define("AURORA_ADMIN_VERSION", "2.3.1");
define("AURORA_ADMIN_PATH", plugin_dir_path(__FILE__));
define("AURORA_ADMIN_URL", plugins_url("aurora-admin/"));