Skip to content

Hide reference panel when not viewing code

Warren Gifford requested to merge mrn/deeper-panel into main

Created by: mrnugget

This fixes https://github.com/sourcegraph/sourcegraph/issues/31640 by only showing the experimental reference panel when viewing files. Previously the panel would stay open when navigating from a file view to a directory view, or from file view to search results.

In order to implement this I moved all of the state related to the reference panel to the RepoRevisionContainer and also only render the reference panel in there. The nice side-effect of that is that we now don't re-render Layout on any change to the clicked token anymore.

I also refactored some of the state keeping in the panel by getting rid of one callback (onClose)

Test plan

  • Tested locally with sg start enterprise-codeintel, opened reference panel on file (via click and URL), navigated away to directory/search, navigated back to file, opened it again.

Merge request reports

Loading