Skip to content

Ensure the 'fixed layout' preference is honored whenever possible

What does this MR do?

Currently, when viewing any Merge Request the user's fixed-layout preference is overridden if they have set "Side-by-Side" view as their preference when viewing diffs. This makes sense if they are currently viewing a diff, but this is confusing when their layout preference is overridden while they are on another tab (i.e. "Discussion" or "Builds").

This MR moves all responsibility for overriding the fixed layout from the Ruby page layout helper into frontend JavaScript where it is only applied when needed.

Are there points in the code the reviewer needs to double check?

Check that nothing broke for users which have their layout preference set to "Fluid" as well as those which have it set to "Fixed". I've already done this but double checking is always good idea 😄.

Screenshots (if relevant)

side-by-side-toggle-fixed

Does this MR meet the acceptance criteria?

What are the relevant issue numbers?

Closes #22343 (closed)

Other Notes

As @lbennett noted in #22343 (closed), this is something of a band-aid. It fixed most of the issue, but we still need to have a discussion about whether or not is acceptable to override user layout preferences for "Side-by-Side" views in general. At least this MR limits the scope of this behavior to a single tab within an MR or merge conflict page.

Merge request reports