Fold the sidebar menu into a single accordion - #179
Merged
Conversation
The menu listed the whole product tree at once : every group shipped with `collapse show`, so about 75 rows were on screen before the user did anything. The accordion markup existed but never folded anything on desktop. Groups now ship folded and share one `data-bs-parent`, so exactly one is open at a time. Which one is derived from the URL : the script that highlights the active link opens its group, and re-folds the others after a boosted navigation (Bootstrap's accordion only reacts to its own toggles). Nothing is stored per user, because there is nothing a reload could not recompute. That script moves up to sit right after the sidebar markup rather than with the page scripts, so the menu is never painted in the wrong state. Also fixes the mobile drawer, which forced every group open for users who had collapsed the desktop rail : harmless when everything was expanded anyway, a visible inconsistency now. Section headers stay plain labels and flat entries stay visible : only lists that nest anything fold.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The sidebar listed the whole product tree at once. Every group shipped with
collapse show, so roughly 75 rows were on screen before the user did anything : the accordion markup existed but never folded anything on desktop.Groups now ship folded and share a single
data-bs-parent, so exactly one is open at a time, and which one is derived from the URL : the script that highlights the active link opens its group. Nothing is stored per user, because there is nothing a reload could not recompute.Section headers stay plain labels and flat entries (Roles, Sites, Frameworks, the Compliance and Incidents lists) stay visible : only entries that nest a sub-list fold. The menu goes from ~75 rows to ~36, with every leaf still one click away.
Related issue
None.
Type of change
Changes
collapse,aria-expanded="false") and carriesdata-bs-parent=".sidebar-body", making the menu one accordion : opening a group folds the previous one.display: block !importantignored.show). Harmless while everything was expanded anyway, a visible inconsistency now.core/tests/test_sidebar_nav.pyguarding the markup that makes this true : a group shipping withshowwould put the whole tree back on screen.Screenshots
Light, dashboard : groups folded, section headers and flat entries intact.
Dark,
/risks/register/: theRegistergroup is opened by the URL, everything else stays folded.Accordion : clicking
GoodsfoldsRegister.Collapsed icon rail : unchanged (the rail already hid sub-lists).
Mobile drawer : same folded structure, and now honours the fold state with the rail preference set.
Checklist
pytestpasses (3181 passed)ruff checkpassesmcp/tools.py(accurate docstrings and parameter descriptions)api/(serializers, viewsets, routes under/api/v1/)_()/{% trans %}with French translations inlocale/fr/LC_MESSAGES/django.po(no duplicatemsgid;compilemessagespasses)README.mdupdated (features, MCP tools, tech stack, install) when behaviour changedCHANGELOG.mdupdated under## [Unreleased]docs/brand/brand-guidelines.md); no em dash charactersdocs/specs/updated in the same PRNot ticked, and why
docs/screenshots/set is unaffected. The captures above were taken to verify the change, not to be committed.docs/specs/to update. The behaviour is documented where a reader looks for it, indocs/user-guide/finding-your-way.md, which this PR updates.🤖 Generated with Claude Code