Skip to content

Instantly share code, notes, and snippets.

@JohnStarich
Last active December 14, 2023 05:28
Show Gist options
  • Save JohnStarich/a70fd0afe2b06641a909ccc587bf0f11 to your computer and use it in GitHub Desktop.
Save JohnStarich/a70fd0afe2b06641a909ccc587bf0f11 to your computer and use it in GitHub Desktop.
Show all hidden GitHub comments that were resolved by someone else
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