Automatic single-file mode for large merge requests

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

Problem to solve

Large merge requests have performance and usability problems (see details in &516 (closed)). For this kind of merge requests, reviewing changes file-by-file addresses these problems.

!22427 (closed) implements a single-file mode when showing merge request files in the “Changes” tab. It is a user preference (off by default).

A single-file mode is great for large merge requests, but it can be undesirable for smaller merge requests, where there are few changed files. In these cases, it can be better to show all files at the same time.

On top of balancing performance and usability, we need to factor in the user's preferred way of reviewing changed files. Some competitor tools only show one file at a time, and we currently don't allow for a smooth migration in this particular point.

Finally, the new single-file mode user preference is not very discoverable because it's an opt-in preference. We believe that single-file mode is something that can benefit everyone, when applied correctly. So we should find a way to integrate it seamlessly with the experience so users don't have to know about it in the first place.

Intended users

Sasha (Software Developer)

Proposal

Add an automatic single-file mode that is enabled for “large merge requests”. What is a “large merge request” remains to be decided. This has been informally proposed in the past and recently resurfaced in !22427 (comment 309830446).

We could make that the default user preference, but still allow people to always use the single-file mode if they really want it. Like radio buttons in the user preferences: Merge request single-file mode: (•) Automatic ( ) Always

This proposal addresses these problems:

  1. Only when needed: The single-file mode is only automatically enabled for “large merge requests”. In other MRs, users can still reap the benefits of seeing all changed files at once.
  2. Discoverability: Users don't have to know about the user preference, they can have the best experience by default.
  3. Easier migration and support for power users: Even so, if users really want it, they can force the single-file mode for all merge requests, regardless of their “size.”

Future iterations

  1. Add toggle in ⚙️ dropdown: Consider adding the user preference in the preferences dropdown in the MR Changes tab, similar to the “Show whitespace changes” preference.
  2. Remove user preference: Track the number of people that use these options and consider making “Automatic” the default and only option, removing the need for a user preference.

Documentation

Availability & Testing

What does success look like, and how can we measure that?

  • Unsolicited positive feedback from the community
  • Less issues on merge request performance
  • Less requests and client/server load when viewing merge request changes

Links / references

Edited by 🤖 GitLab Bot 🤖