Skip to content

Instantly share code, notes, and snippets.

@teyckmans
Created April 15, 2024 09:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save teyckmans/66d56bb9adc0fa6a2e0a604ff3786382 to your computer and use it in GitHub Desktop.
Save teyckmans/66d56bb9adc0fa6a2e0a604ff3786382 to your computer and use it in GitHub Desktop.
gitlab arc review boost
function isHidden(el) {
if (el === null || el === undefined) {
return true;
}
var style = window.getComputedStyle(el);
return (style.display === 'none')
}
document.addEventListener("keydown", function (event) {
const mergeRequestDiv = document.querySelector("#content-body > div.merge-request")
const commentBox = document.querySelector("div.comment-toolbar");
if (mergeRequestDiv !== null && isHidden(commentBox)) {
if (event.key === "v") {
event.preventDefault();
const fileReviewCheckbox = document.querySelector("[data-testid=fileReviewCheckbox]")
fileReviewCheckbox.click();
}
if (event.key === "n") {
const prevItem = document.querySelector("[class~=prev-page-item]")
prevItem.click();
}
if (event.key === "m") {
const nextItem = document.querySelector("[class~=next-page-item]")
nextItem.click();
}
}
});
@teyckmans
Copy link
Author

add this boost for gamifying your gitlab reviews

v = marking a file as viewed
n = navigate to the previous file
m = navigate to the next file

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment