Always link to the merge request for the current branch in the Web IDE
The Web IDE is integrated with merge requests, but the integration only works if you open the merge request in the web IDE through the merge request interface. This means that if you open the branch some other way, none of the merge request features are present, including if you reload the page. This is pretty strange as a user and should be improved.
Additionally if you commit to the branch, the subsequent reload removes the link to the merge request. The link to the merge request needs to be more stable and consistent.
Further details
There should always be:
- branch/merge request drop down correctly populated
- merge request description accessible from the right panel
- link to leave the web ide and view the merge request
Proposal
When a branch is opened in the Web IDE:
- check the server if there is a merge request associated with that branch
- if the current branch is part of a merge request show merge request links
- if the current branch is part of multiple merge requests, show the newest merge request
Note: unlike opening a merge request in the Web IDE from the merge request interface, we shouldn't switch to the review interface and open all the files. This would be confusing if the page is reloaded or the branch is opened from the repository view.