Created
April 15, 2024 09:53
-
-
Save teyckmans/66d56bb9adc0fa6a2e0a604ff3786382 to your computer and use it in GitHub Desktop.
gitlab arc review boost
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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(); | |
} | |
} | |
}); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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