9th April 2023
Updated: 26th May 2026
Working through a large pull request (PR) review on GitHub often means jumping around, trying to determine how different pieces of the code interact, or getting pulled away to work on something completely different. When there are tens or even hundreds of files to review it can be easy to lose track of where you are.
Thankfully GitHub offers us the ability to mark a file as reviewed. Clicking the checkbox collapses the view of that particular file, so even if we walk away and come back to it later, we know that particular file has been reviewed.
Even better; if you finish reviewing all the files in a PR and check all those boxes, when any new commits are pushed it only un-checks the files that have been updated, so you don't end up re-reviewing files that haven't changed.
Sometimes though, it becomes necessary to re-review everything. Unfortunately, GitHub doesn't provide any way of checking or un-checking all the boxes at once. Thankfully, all we need is a snippet of Javascript to get the job done.
NB: Towards the end of 2025, GitHub updated their UI. Depending on whether you're using the old UI, or the new one, you'll need a different snippet. If the first one you try doesn't work, the other one should.
1document.querySelectorAll('button[class*="MarkAsViewedButton"][aria-pressed="false"]')2 .forEach(button => button.click())
Old UI:
1document.querySelectorAll(".js-reviewed-checkbox")2 .forEach(checkbox => !checkbox.checked && checkbox.click());
If you want to start from scratch, marking all the files as un-viewed, use this code instead;
New UI:1document.querySelectorAll('button[class*="MarkAsViewedButton"][aria-pressed="true"]')2 .forEach(button => button.click())
Old UI:
1document.querySelectorAll(".js-reviewed-checkbox")2 .forEach(checkbox => checkbox.checked && checkbox.click());
Code highlighting powered by Torchlight