Last active
April 17, 2025 13:18
-
-
Save linuswillner/e806b6c21cdb5af13ef99a65fda1074d to your computer and use it in GitHub Desktop.
Revisions
-
linuswillner revised this gist
Apr 17, 2025 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -31,7 +31,7 @@ const SHOW_COPILOT_REVIEWS_QUERY = 'show_copilot_reviews=true' const COPILOT_REVIEW_HIDDEN_DIV = ` <div style="${COPILOT_HIDDEN_REVIEW_CSS}"> <span>🤖🚫 <i style="${COPILOT_HIDDEN_REVIEW_TEXT_CSS}">"Review" from GitHub Copilot hidden.</i></span> <button style="${SHOW_ANYWAY_BUTTON_CSS}" onclick="window.location.assign(\`\${window.location.href}?${SHOW_COPILOT_REVIEWS_QUERY}\`)">Show anyway</button> </div> ` -
linuswillner revised this gist
Apr 17, 2025 . 1 changed file with 2 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -1,7 +1,7 @@ // ==UserScript== // @name Hide GitHub Copilot reviews // @description Declutter GitHub pull requests by hiding reviews from Copilot // @version 2 // @namespace https://github.com/*/*/pull/* // @include https://github.com/*/*/pull/* // ==/UserScript== @@ -32,7 +32,7 @@ const SHOW_COPILOT_REVIEWS_QUERY = 'show_copilot_reviews=true' const COPILOT_REVIEW_HIDDEN_DIV = ` <div style="${COPILOT_HIDDEN_REVIEW_CSS}"> <span>🤖🚫 <i style="${COPILOT_HIDDEN_REVIEW_TEXT_CSS}">Review from GitHub Copilot hidden.</i></span> <button style="${SHOW_ANYWAY_BUTTON_CSS}" onclick="window.location.assign(\`\${window.location.href}?${SHOW_COPILOT_REVIEWS_QUERY}\`)">Show anyway</button> </div> ` -
linuswillner revised this gist
Apr 17, 2025 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -32,7 +32,7 @@ const SHOW_COPILOT_REVIEWS_QUERY = 'show_copilot_reviews=true' const COPILOT_REVIEW_HIDDEN_DIV = ` <div style="${COPILOT_HIDDEN_REVIEW_CSS}"> <span>🤖🚫 <i style="${COPILOT_HIDDEN_REVIEW_TEXT_CSS}">Review from GitHub Copilot hidden.</i></span> <button style="${SHOW_ANYWAY_BUTTON_CSS}" onclick="window.location.replace(\`\${window.location.href}?${SHOW_COPILOT_REVIEWS_QUERY}\`)">Show anyway</button> </div> ` -
linuswillner revised this gist
Apr 17, 2025 . 1 changed file with 8 additions and 8 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -11,18 +11,18 @@ function css(input) { } const COPILOT_HIDDEN_REVIEW_CSS = css(` display: flex; align-items: center; gap: 7px; padding: 10px; `) const COPILOT_HIDDEN_REVIEW_TEXT_CSS = css(` opacity: 0.85 `) const SHOW_ANYWAY_BUTTON_CSS = css(` border-radius: 5px; border: none; padding: 5px; `) @@ -31,13 +31,13 @@ const SHOW_COPILOT_REVIEWS_QUERY = 'show_copilot_reviews=true' const COPILOT_REVIEW_HIDDEN_DIV = ` <div style="${COPILOT_HIDDEN_REVIEW_CSS}"> <span>🤖🚫 <i style="${COPILOT_HIDDEN_REVIEW_TEXT_CSS}">Review from GitHub Copilot hidden.</i></span> <button className="show-copilot-review" style="${SHOW_ANYWAY_BUTTON_CSS}" onclick="window.location.replace(\`\${window.location.href}?${SHOW_COPILOT_REVIEWS_QUERY}\`)">Show anyway</button> </div> ` function timelineItemIsFromCopilot(itemDiv) { return itemDiv.innerText.includes('Copilot AI reviewed') } function findCopilotReviews() { @@ -50,10 +50,10 @@ function hideCopilotReviews() { return } const copilotReviews = findCopilotReviews() for (const review of copilotReviews) { review.innerHTML = COPILOT_REVIEW_HIDDEN_DIV } } -
linuswillner created this gist
Apr 17, 2025 .There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,60 @@ // ==UserScript== // @name Hide GitHub Copilot reviews // @description Declutter GitHub pull requests by hiding reviews from Copilot // @version 1 // @namespace https://github.com/*/*/pull/* // @include https://github.com/*/*/pull/* // ==/UserScript== function css(input) { return input.replace(/\s+/g, ' ') } const COPILOT_HIDDEN_REVIEW_CSS = css(` display: flex; align-items: center; gap: 7px; padding: 10px; `) const COPILOT_HIDDEN_REVIEW_TEXT_CSS = css(` opacity: 0.85 `) const SHOW_ANYWAY_BUTTON_CSS = css(` border-radius: 5px; border: none; padding: 5px; `) const SHOW_COPILOT_REVIEWS_QUERY = 'show_copilot_reviews=true' const COPILOT_REVIEW_HIDDEN_DIV = ` <div style="${COPILOT_HIDDEN_REVIEW_CSS}"> <span>🤖🚫 <i style="${COPILOT_HIDDEN_REVIEW_TEXT_CSS}">Review from GitHub Copilot hidden.</i></span> <button className="show-copilot-review" style="${SHOW_ANYWAY_BUTTON_CSS}" onclick="window.location.replace(\`\${window.location.href}?${SHOW_COPILOT_REVIEWS_QUERY}\`)">Show anyway</button> </div> ` function timelineItemIsFromCopilot(itemDiv) { return itemDiv.innerText.includes('Copilot AI reviewed') } function findCopilotReviews() { const timelineItems = Array.from(document.querySelectorAll('.js-timeline-item')) return timelineItems.filter(timelineItemIsFromCopilot) } function hideCopilotReviews() { if (window.location.search.includes(SHOW_COPILOT_REVIEWS_QUERY)) { return } const copilotReviews = findCopilotReviews() for (const review of copilotReviews) { review.innerHTML = COPILOT_REVIEW_HIDDEN_DIV } } window.addEventListener('load', hideCopilotReviews)