Display unchanged lines if the gap between changes is under a certain threshold

Issue

In this example, we display the standard Show 20 lines etc buttons in between the two changed areas. Screen_Shot_2021-10-07_at_11.12.52_AM

There are a few problems with that

  1. There aren't 20 unchanged lines; there's only one
  2. Displaying the unchanged line 18 would take up less room than the expand row

Proposal

  • 5 or fewer unchanged lines: just show them.
  • 6-25 unchanged lines: show this “Expand all” button.
  • 26 or more unchanged lines: show the “Next 20 lines” and “Previous 20 lines” buttons.

Additional Implementation Details

We should implement this change with a feature flag so that we can be mindful of the impact this may have on performance or other commenting logic within the merge request. We don't need to rush on a roll out here.

Edited by Annabel Dunstone Gray