I recently had to review a Pull Request in Azure DevOps that had many added, removed, and changed lines of code. I struggled to focus on the code because I kept having to scroll horizontally to see changes that went beyond the limit of what can be shown on a single screen.
Like many developers, my main development rig is a laptop with a three-screen setup: two external displays with 1920×1080 resolutions, and the integrated laptop monitor. An effective, if standard setup.
A single screen isn’t enough to see the list of changed files, the source file, and target file. The solution is to stretch the Azure DevOps browser tab across the two external screens. The treeview listing and original code are on the left-hand screen, with the target file on the right-hand screen. Horizontal scrolling is reduced to a minimum, except for really, really long lines, which you should avoid anyways.
There are a few things to note about this setup. Make sure you click on the first file in the Pull Request. Doing so makes the changes you’re about to do apply to every file in the Pull Request. Now, to avoid jumping from screen to screen, align the vertical gutter between the original and target files so that it’s completely on the right-hand screen. This way, the comment button for the target file appears on the right-hand screen, rather than the left.
There’s a bit of lost real estate on the left-hand screen due to the file listing treeview. You can minimize its impact by making the treeview width smaller than the longest path in the Pull Request.
On the laptop screen, open the project that you’re reviewing in Visual Studio. Sometimes it’s just easier to jump into the code to understand how it all flows together, rather than looking at the individual pieces of the Pull Request.
By this point, you’re probably screaming at me to use the unified diff, which makes most of these issues go away. The unified diff makes it harder to understand the before and after of a method with lots of changes. So for anything but the simplest of Pull Requests, I default to the side-by-side diff.
Another option is use the Pull Request feature that is part of VS2019’s Team Explorer, as it can do a multi-screen side-by-side diff quite well. But what it lacks is the ability to dig into the code that you’re reviewing. I’d like to be able to hit F12 while in diff mode to go to a function’s implementation, and then hit Ctrl-minus to come back to review mode. Having to switch context from code review to navigating to a method makes the experience feel a bit broken.
So for the time being, I’ll be sticking to the multi-screen review from the browser.