Skip to content

Line counting in dynamically created diff headers should be more accurate

Everyone can contribute. Help move this issue forward while earning points, leveling up and collecting rewards.

Currently we have the following line counting slightly inaccurate in a few places.

Screen_Shot_2018-11-06_at_20_05_11

  1. When clicking on ... (once or multiple times) we see it sticking to the 20 value

    This is the size of blob lines being requested and inserted in the diff lines. But if we're willing to present an accurate value (following git standards) we should calculate how many lines it has until the next match line. So if it has 6 lines before the click and we're expanding 20, it should be 26, not 20. Second click, if we're expanding more 20, it should be 46, not 20.

  2. After leaving a comment in an expanded line and reloading the page, the backend creates top and bottom diff headers dynamically (based on comment positions), but the line counts in these headers are not accurate as well in a few scenarios

    This is being handled by https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/22852.

Edited by 🤖 GitLab Bot 🤖