Switching branches in repo tree view navigates backwards
Summary
Switching branches in the repository files view after having navigated to some arbitrary subfolder will switch the branch, but also navigate you backwards to the original folder that you started that browser tab in.
Steps to reproduce
- Open https://gitlab.com/gitlab-org/gitlab/-/tree/master in a new browser tab.
- Click through a sequence of subfolders. For example,
app > channels > application_cable
. - Click the dropdown above the file list and select a different branch – any one will do.
- Watch as the browser navigates you back to the root of the project within the new branch you selected.
The process can also be repeated by starting your browser tab inside a subfolder instead of the project root:
- Open https://gitlab.com/gitlab-org/gitlab/-/tree/master/db/fixtures in a new browser tab.
- Click through a sequence of subfolders. For example,
.. > .. > doc > api
. - Choose a different branch from the dropdown above the file list.
- Watch as the browser navigates you back to the
gitlab/db/fixtures
folder within the new branch you selected.
Example Project
Any project on gitlab.com, including Gitlab itself: https://gitlab.com/gitlab-org/gitlab
What is the current bug behavior?
Upon switching branches, you are redirected back to the very first repo folder you were in when the browser tab was opened.
What is the expected correct behavior?
Upon switching branches, the repo view should remain in the same repo folder you were in when you switched the branch. If the folder does not exist in this new branch, you should be redirected to the root of the project.
Relevant information
- Browser – Chrome Version 81.0.4044.138 (Official Build) (64-bit)
- OS – Windows 10 Build 1709