Last active
December 14, 2023 05:28
-
-
Save JohnStarich/a70fd0afe2b06641a909ccc587bf0f11 to your computer and use it in GitHub Desktop.
Show all hidden GitHub comments that were resolved by someone else
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
javascript:(function() { | |
/* | |
To use this bookmarklet, create a new bookmark in your browser and paste | |
the entire contents of this file into the URL address box. | |
*/ | |
const username = document.head.querySelector('meta[name="user-login"]').content; | |
const currentUsersReviews = Array.from(document.querySelectorAll('.timeline-comment.current-user')) | |
.map(e => document.getElementById(e.id)); /* find our reviews, then get parent container */ | |
const comments = | |
currentUsersReviews | |
.flatMap(review => Array.from(review.querySelectorAll('.js-comment-container'))); | |
comments | |
.filter(e => !e.open) | |
.forEach(e => e.querySelector('summary[role="button"]').click()); | |
setTimeout(() => { | |
const resolvedBySomeoneElse = | |
comments | |
.filter(e => | |
e.dataset.resolved === 'true' && | |
!e.innerText.includes(username + ' marked this conversation as resolved') | |
); | |
resolvedBySomeoneElse | |
.forEach((e, i) => { | |
if (i === 0) { | |
e.scrollIntoView({ block: 'center', behavior: 'smooth' }); | |
} | |
if (!e.open) { | |
e.querySelector('summary[role="button"]').click(); | |
} | |
}); | |
}, 500); | |
})() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment