Skip to content

Automatically expand file on merge request with changes to single file

What does this MR do?

By forcing single-file diffs to be expanded/collapsed: false, we can allow the frontend to display them uncollapsed, removing the need for users to "Click to expand" in this situation. All other limits to display, such as safe_max_lines and safe_max_bytes still apply.

Screenshots

Testing locally with a 50kb diff,

Existing

diffs_batch.json

image

MR page

image


With this change

diffs_batch.json

image

MR page

image

Does this MR meet the acceptance criteria?

Conformity

Availability and Testing

Security

If this MR contains changes to processing or storing of credentials or tokens, authorization and authentication methods and other items described in the security review guidelines:

  • Label as security and @ mention @gitlab-com/gl-security/appsec
  • The MR includes necessary changes to maintain consistency between UI, API, email, or other methods
  • Security reports checked/validated by a reviewer from the AppSec team

Related to #254823 (closed)

Edited by Kerri Miller

Merge request reports