Skip to content

Links to line numbers on the commits page are broken

Created by: mike-r-mclaughlin

Steps to reproduce:

  1. Go to a commit (for example: https://sourcegraph.com/github.com/sourcegraph/sourcegraph/-/commit/92c011f5dde0d5b2dd3136cf0619b0dfa9a0d930)
  2. Scroll down and click on a line number
  3. Notice that the page scrolls back to top

Expected behavior:

The page stays where it is and you can send a link to someone else anchored to that line in the given file.

Actual behavior:

The page scrolls to top when clicking the line number. If you send the link to another user, it will not be anchored to the right file + line number.

Example:

This is a link to line 170 on the right side of enterprise/cmd/frontend/internal/batches/resolvers/code_host_connection_test.go (https://sourcegraph.com/github.com/sourcegraph/sourcegraph/-/commit/92c011f5dde0d5b2dd3136cf0619b0dfa9a0d930#diff-1a6d10012fb20670efaf3cd3b8769fb3)

/cc @taylorsperry @jasongornall