Clicking filename in diff reloads page

Summary

Clicking the filename in the merge request diff causes the entire page to reload. It should scroll the filename to the top of the view and update the browser URL to something that links directly to that file so that the URL can be shared.

Steps to reproduce

  1. Open a merge request
  2. Click on the file name above a diff

Example Project

gitlab-com/www-gitlab-com!18225 (diffs)

What is the current bug behavior?

The entire page reloads in the diff state

What is the expected correct behavior?

  • The page should not reload.
  • The page URL should be updated to link directly to the file.
  • The file should scroll to the top of the view

Relevant logs and/or screenshots

Screen_Shot_2019-02-13_at_3.57.06_PM

Output of checks

This bug happens on GitLab.com