Add ability to link to a line on File Blame page

In !85827 (merged) we added paging to the File Blame page, but when a user want to link to a line that is not on page 1 they would have to pass a page number with the line number (e.g. CHANGELOG.md?page=2#L1100).

It would be more intuitive if a user only needs to pass the line number to link to a line.

This issue proposes adding the ability to link to a line without having to pass a page number.

current proposal
needs the context of what page the line is on no need to pass a page number to link to a line
https://gitlab.com/gitlab-org/gitlab/-/blame/master/CHANGELOG.md?page=2#L1100 https://gitlab.com/gitlab-org/gitlab/-/blame/master/CHANGELOG.md#L1100

Update: Due to limitations(not being able to access hash on the server which means we know the line number only on the client) we ended up with the following solution: to be able to send user to a correct blame page

  1. When user clicks on Blame button on the top of the page we calculate correct page to send him to
  2. When user just pastes a url with line at the end we check if the page parameter should be added and perform an actual redirect if needed.
Edited Dec 21, 2022 by Nataliia Radina
Assignee Loading
Time tracking Loading