Skip to content

web: improve prefetch file blob

Administrator requested to merge vb/improve-prefetch-file into main

Created by: valerybugakov

Context

This PR makes sure:

  1. We have a consistent fetchBlob cache key.
  2. We do not prefetch blob on keyboard navigation if the experiment flag is not enabled.
  3. We do not call the fetchBlob function for the go-up-the-file-tree link on hover.

https://github.com/sourcegraph/sourcegraph/pull/40354 follow-up.

Test plan

  1. Run the application with the enabled experimental flag enableSidebarFilePrefetch.
  2. Open the blob page.
  3. Navigate between blobs using the keyboard up and down arrows.
  4. Notice that fetchBlob requests are issued once per selected/visited file. No requests are issued when the go-up-the-file-tree link is selected.

App preview:

Check out the client app preview documentation to learn more.

Merge request reports

Loading