From f13d15b4dd6451c8ad116f5531b0a8c970b56073 Mon Sep 17 00:00:00 2001 From: Aaron Kimbrell Date: Tue, 29 Sep 2026 01:14:13 -0500 Subject: [PATCH] feat(dashboard): the sidebar keeps its open groups and can be hidden The menu's groups stay open or closed from page to page (localStorage "dash.sidebar", this browser only), applied by an inline script right after the menu so the first paint already shows them. The group of the current page opens and stays open until it is closed. A new top bar button hides the menu on wide screens; that choice is applied in , also before the first paint. Check: open and close a few menu groups, switch pages and reload; the groups stay as left, with no flicker. On a wide window the menu button left of the user menu hides the menu, and it stays hidden across pages and reloads. Narrow screens: the Menu button still slides the menu out. Test: SidebarStateJs (ctest, needs node). Co-Authored-By: Claude Opus 5.5 --- dDashboardServer/static/css/dashboard.css | 5 + dDashboardServer/templates/base.jinja2 | 3 + dDashboardServer/templates/header.jinja2 | 57 +++++++++++- docs/Dashboard.md | 3 + tests/dWebTests/CMakeLists.txt | 3 + tests/dWebTests/sidebar-state.test.mjs | 108 ++++++++++++++++++++++ 6 files changed, 178 insertions(+), 1 deletion(-) create mode 100644 tests/dWebTests/sidebar-state.test.mjs diff --git a/dDashboardServer/static/css/dashboard.css b/dDashboardServer/static/css/dashboard.css index c1451cfcf..9e9c0fdc2 100644 --- a/dDashboardServer/static/css/dashboard.css +++ b/dDashboardServer/static/css/dashboard.css @@ -233,3 +233,8 @@ details.about-text > summary::before { details.about-text > summary:hover { color: var(--bs-body-color); } details.about-text[open] > summary { margin-bottom: .35rem; } details.about-text > :not(summary) { color: var(--bs-secondary-color); font-size: .875rem; } + +/* Wide screens: the menu can be hidden (the top bar's menu button; header.jinja2 keeps the choice) */ +@media (min-width: 992px) { + html.sidebar-hidden nav.sidebar { display: none !important; } +} diff --git a/dDashboardServer/templates/base.jinja2 b/dDashboardServer/templates/base.jinja2 index cf88929b6..322e06060 100644 --- a/dDashboardServer/templates/base.jinja2 +++ b/dDashboardServer/templates/base.jinja2 @@ -5,6 +5,8 @@ {% block title %}DarkflameServer{% endblock %} + {# The menu hidden on wide screens stays hidden from page to page (header.jinja2), set before the first paint #} + @@ -17,6 +19,7 @@
+ DarkflameServer