Skip to content

Improve logic for overlapping blame chunks (blob blame)

Jacques Erasmus requested to merge 425267-handle-overlapping-chunks into master

What does this MR do and why?

I noticed that sometimes when a line number (hash) is in the URL, the overlapping chunk does not render blame information. This MR improves the logic for overlapping blame chunks to catch these edge cases.

Screenshots or screen recordings

Before After
Some blame information is missing Blame information for the overlapping chunk is rendered
Screenshot_2023-11-02_at_14.08.02 Screenshot_2023-11-02_at_14.08.53

How to set up and validate locally

  1. Enable the graphql_git_blame, blob_blame_info and highlight_js_worker feature flags
  2. Open a .json file via the repository files browser
  3. Click the Blame button in the blob header
  4. Select a line number
  5. Refresh the page
  6. The page should automatically scroll to the selected line
  7. When scrolling down the page the blame information should render as expected

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Related to #425267 (closed)

Edited by Jacques Erasmus

Merge request reports