[go: up one dir, main page]

Skip to content

Render diff rows in parallel mode from the inline diff lines state


Summary

We've assess that the information on the parallel mode is pretty much the same as in inline mode.

This is the logic backend is using to generate the parallel response: https://gitlab.com/gitlab-org/gitlab/-/blob/master/lib/gitlab/diff/parallel_diff.rb´

This can be derived off the same data structure. This will not only improve the time to switch between inline/parallel but will simplify a lot of the code.

How?

We've discussed potentially adding a new property:

  • universal_diff_lines

Or reusing the highlighted_diff_lines.

This way we could start adding the improvements done with this refactor in this branch of the state tree.

Improvements

Simplified state. Easier to update. Easier to add new features (single representation of diff lines instead of one for inline (highlighted_diff_lines) and one for parallel (parallel_diff_lines).

Risks

This distinction is pretty widespread in the app. Side effects will be felt across the entire app.

Involved components

Optional: Intended side effects

Optional: Missing test coverage

Edited by André Luís