Split off a new MenuSection component from NavItem component
What does this MR do and why?
Refactors all the "isSection" behavior of the NavItem
into a new MenuSection
component.
This allows to remove some duplicated code from the PinnedSection
, which had its own "collapsible section". Now it uses the new MenuSection
internally. With this, it now shows the Pinned section as active when it's collapsed and one of its items is active. Also it adds the focus outlines that the custom section code didn't have yet. See screen recording below.
Screenshots or screen recordings
Before | After |
---|---|
recording_1682411599 | recording_1682411482 |
How to set up and validate locally
Numbered steps to set up and validate the change are strongly suggested.
-
Feature.enable(:super_sidebar_nav, User.first)
and toggle on the New Navigation in your user dropdown. - Go to a project (and in a second round also a group) and pin a bunch of nav items.
- Click one of these, so that you are on a pinned page.
- Collapse the pinned section. It should now show the blue "active" indicator on the left.
- Also, while having focus it should show the blue focus outline.
- Also test other sidebars (Your work, Explore, a group, admin) to make sure this refactor didn't break anything.
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this MR.
Edited by Thomas Hutterer