Skip to content

Update diff file `collapsed` value to more accurate `automaticallyCollapsed`

What does this MR do?

For #16047 (closed)

This is one MR in a sequence to improve the way collapsed files are handled in Merge Request diffs.

To create the smallest impact possible, it's broken up into a few steps.

Step MR Description
1 We're here 👉🏻 Refactor the existing collapsed flags into something more accurate, like automaticallyCollapsed
This will leave a small inconsistency where user-collapsed files will be toggling the automaticallyCollapsed property.
2 Add a flag like userCollapsed alongside the auto flag
This will require Vuex actions, mutations, getters ("how many of each type?"), etc.
3 Update the UI to use both flags
This will require some resolution code ("which flag wins?"), and various tweaks to the UI code
4 Modify collapsed files to hide the body on userCollapsed and show the warning on automaticallyCollapsed
This includes making the warning orange and swapping the test to indicate it was performed automatically.

Screenshots

N/A, all backstage

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
Edited by Thomas Randolph

Merge request reports