Skip to content

Highlight collapsed diffs in MRs

What does this MR do?

For #249251 (closed)

Adds a taller warning and more apparent button for expanding collapsed files.

Notable

  1. Because there's currently no clean way to differentiate between automatically and manually collapsed files, this MR doesn't fully address #16047 (closed).

  2. Because of some Webpack shenanigans, the L10n strings cannot go in the constants.js file, so I've created a new i18n.js file just for those strings. Considering how many I18n strings are in the diffs sub-directory, this is probably a better separation anyway.

Webpack shenanigans

vitallium: there is a WebWorker TreeWorker which causes problems. app/assets/javascripts/diffs/store/actions.js imports it on line 10. Webpack processes this import and adds file with constants to the processing pipeline. TreeWorker import your constants but our locale functions rely on window where we store all locale phrases during initialization. But window is not available in Web Workers.

vitallium: Our webpack configuration instructs to load any file ending with _worker with worker-loader

vitallium: Here is the dependency graph for the tree_worker.js image

Screenshots

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

Merge request reports

Loading