Expand diff to have more context
Users want to review the entire file (with diffs) during code review of a merge request, and not just a small snippet. How do we make that easy? Probably by expanding the diff of a file in a merge request to view the entire file with the diff.
Why do we need this? What problems / pain points are we solving?
When doing code review, people want to expand a file to see context. We currently have controls to expand in both directions, that allows a good number of lines to show more context. And that is important, because it solves the problem of the person wanting to see the immediate context, i.e. neighboring code, the entire function/method, etc. This is the first scenario.
But there is another use case (second scenario), which is that the person wants to see the entire file right away. For example, if the person wants to see the name of the class, or maybe they are looking for some definitions near the top of the file, they want to be able to quickly scroll up to the top of the file. Currently, this requires a person to click many times in order to do so. This is a pain point we want to solve with this feature.
Out of scope
We are not doing any smart expanding to a certain dynamic point in the file. Expand to the end of the current function, code block, etc. This may be a future improvement if necessary.
Reviewboard does this nicely in two ways:
- expand until next indentation marker (class, method, function)
- expand full file