Fix code suggestions on line ranges with expanded lines

What does this MR do?

Fixes the missing "Insert suggestion" button in Rapid Diffs when a comment's line range includes lines revealed with "Show lines after". The fix only affects code suggestions; no other commenting behavior changes.

Each hunk is rendered as its own table section and expanded lines are added to the following hunk's section, so the code that collects the lines of a suggestion stopped at the section boundary and turned suggestions off. Collection now continues across hunk sections.

Before and after

Before After

Reproduction steps

Use any merge request that has a file with more than one hunk.

  1. Open the merge request and go to the Changes tab.
  2. Find a hunk that has a "Show lines after" button below it and click it.
  3. Hover the line gutter and drag the comment handle from a line inside the original hunk down into the newly revealed lines.
  4. Look at the comment form toolbar.

Expected: the "Insert suggestion" button is shown, and clicking it prefills the suggestion with every selected line.

On master: the "Insert suggestion" button is missing.

🤖 Generated with Claude Code

Edited by Stanislav Lashmanov

Merge request reports

Loading
Loading