Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save drewrwilson/0002f3f125e09e387649e91cad41efe1 to your computer and use it in GitHub Desktop.
Save drewrwilson/0002f3f125e09e387649e91cad41efe1 to your computer and use it in GitHub Desktop.
Uncheck all "Viewed" checkbox on a github pull request
/*
πŸ‘‰ Ok, imagine this: You're reviewing a pull request with 107 files. That's a lot of files!
βœ… To keep track of your place while you review, you're clicking that nice Viewed checkbox
next to each file after you review it. Great, that button collapses the file and make it much more
manageable.
😱 But wait. You're through 47 files and the author just pushed a change. Oh no. Did the commit impact those
files? 42 files are collapsed. What are you supposed to do, manually uncheck 47 files?? AHHHHHH!!
😎 Don't panic!
1. Open your console on the pull request webpage.
2. Paste this snippet into your console.
3. Slam that enter key.
This script will select all the currently-checked Viewed checkbox and click on them, unselecting them all in a second.
πŸ˜… πŸ˜… πŸ˜…
*/
document.querySelectorAll("input.js-reviewed-checkbox[checked]").forEach((element) => {
element.click();
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment