Skip to content

Store expanded state of Pinned section as cookie

Thomas Hutterer requested to merge super_sidebar_pin_collapse_cookie into master

What does this MR do and why?

This implements a small missing piece of #378547 (closed). With this change, the Pinned section in the new sidebar remembers its expanded/collapsed state 🍪

Screenshots or screen recordings

recording_1680706692

How to set up and validate locally

  • Enable the feature flag: Feature.enable(:super_sidebar_nav, User.first)
  • Toggle on the New navigation in the user dropdown.
  • Go to either a project or a group. Only their sidebars have pins.
  • Collapse the Pinned section. This sets a cookie.
  • Reload or navigate to another page with a project/group sidebar.
  • The Pinned section should still be collapsed.
  • Open it again, reload, should stay open.
  • Bonus points: Delete the cookie and it should default to open again.

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Edited by Thomas Hutterer

Merge request reports