Remember collection state in navigation sidebar

Problem to solve

We adjusted the logic of the navigation sidebar to prevent auto closing collections when items are pinned in !142430 (merged). However, there were a few scenarios that were not considered during testing that have unexpected results.

Scenario 1: When starting from a page like the To-Do List, if navigating to a page that is pinned the navigation will center on and expand its parent collection.

Opening a comment Current Expected
Gitlab Todos Dashboard XL.png GitLab Merge Request 141459 XL.png GitLab Merge Requests XL.png

Scenario 2: After manually collapsing a collection, the collection will auto expand when going to the next page.

Going to page 2 Current Expected
GitLab Merge Requests XL.png GitLab Merge Requests Page 2 Opened.png GitLab Merge Requests Page 2 Opened (1).png

Scenario 3: Going to a pinned item does not leave mark the originating collection as active.

Navigate to pinned item Current Expected
Gitlab XL.png GitLab Merge Requests XL (1).png GitLab Merge Requests XL (2).png