Fix file tree not updating on code intel actions
Created by: attfarhan
Fixes https://github.com/sourcegraph/sourcegraph/issues/4710. The file tree wouldn't update on go-to-def or find refs if the new location was in a sub-folder of the current location, due to this logic. We didn't want to reset the tree to render only the current directory if we were going into child folder because when users click into sub directories they should still see the directory they started in. However, we do want to do it for code intel actions/other navigation actions because we also don't want to have to open X
number of directories in the file tree, causing X
HTTP requests.
Now, we add a action
query parameter to the the file name in FileMatch, and the FileMatchChildren components. When action
is seen in the URL, the tree will render only the current directory.