Skip to content

Limit the width of alerts on the MR page in fixed-width mode

Thomas Randolph requested to merge tor/defect/mr-alert-width into master

What does this MR do and why?

For #421940 (closed)

When viewing the Changes tab, the page does not include the container-limited class, which is used to identify the Fixed width user preference when used in combination with container-fluid (yes, even in Fixed mode). Because this is the ONLY way that fixed-width mode is identified in CSS, this MR adds a special class for the Diffs (Changes) App when container-limited is removed. This new class (diffs-container-limited) is used to limit the alert width.

Screenshots or screen recordings

Before After

How to set up and validate locally

  1. Add an alert at the bottom of the MR Tabs constructor:
    createAlert({
      message: "Test alert to be shown all times",
      variant: "warning",
    });
  2. Set your user preference for "Behavior" to "Fixed"
  3. Visit an MR that has code changes
  4. Move among the tabs, including the Changes tab
  5. Note that the alert has a static width

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Edited by Thomas Randolph

Merge request reports