File tree browser preserves scroll position when switching between files
Summary
When navigating between files using the repository file tree browser, the scroll position from the previous file is incorrectly preserved when viewing the new file. This causes the viewer to jump to an arbitrary position in the newly selected file rather than starting at the top.
Steps to reproduce
- Navigate to a repository with the file tree browser enabled (e.g., https://gitlab.com/gitlab-org/gitlab/-/tree/master)
- Open a file and scroll down to a position partway through the file
- Click on a different file in the file tree browser
- Observe that the new file opens scrolled to approximately the same position as where you were in the previous file
Edited by 🤖 GitLab Bot 🤖