feat(centralui): collapsible sidebar nav sections
Make the seven sidebar section groups (Admin, Design, Deployment, Notifications, Site Calls, Monitoring, Audit) collapsible. New NavSection component renders a header toggle button (chevron) and reveals its items only while expanded; NavMenu owns the expanded-section set. Behaviour: sections are collapsed by default; state persists in the `scadabridge_nav` cookie (written/read via the new nav-state.js JS interop, mirroring treeview-storage.js) so it survives reloads and reconnects; navigating into a section auto-expands it and remembers it. The Dashboard item stays sectionless and always visible. Tests: NavMenu bUnit tests expand sections before asserting items and add collapsed-by-default / toggle / cookie-persistence cases; Playwright nav tests expand sections before clicking links; new NavCollapseTests covers the feature E2E. Build 0 warnings; bUnit 545 passed; Playwright nav suite green (the unrelated AuditGridColumnTests resize-reload case remains pre-existing flaky — an un-awaited save race in that test).
This commit is contained in:
@@ -42,7 +42,17 @@
|
||||
padding-left: calc(1rem - 3px);
|
||||
}
|
||||
|
||||
.sidebar .nav-section-header {
|
||||
/* Collapsible section header — a full-width button styled as an uppercase
|
||||
eyebrow with a leading expand/collapse chevron. */
|
||||
.sidebar .nav-section-toggle {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 0.4rem;
|
||||
width: 100%;
|
||||
background: none;
|
||||
border: 0;
|
||||
cursor: pointer;
|
||||
text-align: left;
|
||||
color: var(--ink-faint);
|
||||
font-size: 0.7rem;
|
||||
font-weight: 600;
|
||||
@@ -52,6 +62,15 @@
|
||||
margin-top: 0.5rem;
|
||||
}
|
||||
|
||||
.sidebar .nav-section-toggle:hover {
|
||||
color: var(--ink);
|
||||
}
|
||||
|
||||
.sidebar .nav-section-toggle .bi {
|
||||
font-size: 0.8rem;
|
||||
line-height: 1;
|
||||
}
|
||||
|
||||
.sidebar .brand {
|
||||
color: var(--ink);
|
||||
font-size: 1.1rem;
|
||||
|
||||
Reference in New Issue
Block a user