When a user selects a sidebar item with nested routes, the dropdown expands as expected. However, clicking the same selected item again does nothing, even though users naturally expect it to collapse. This leads to:
Reduced control over sidebar visibility
Unnecessary scrolling when sections cannot be collapsed
Lower consistency with typical documentation UI behavior
Expected Behavior
Clicking an already-selected sidebar item should toggle the visibility of its dropdown.
Clicking a non-selected item behaves normally (navigate + expand).
When navigating away, the collapsed state should reset automatically so the correct item appears expanded by default.