Repository navigation
Hide useless comments - #1526
Conversation
| let uselessCount = 0; | ||
| for (const commentText of select.all('.comment-body > p:only-child')) { | ||
| // Find useless comments | ||
| if (!/^(\+[120]+!?|👍|🙏)$/.test(commentText.textContent.trim())) { |
There was a problem hiding this comment.
Can you support -1 and 👎 too?
|
Can the note be on top and on bottom of the page? |
|
Why? |
|
@bfred-it |
|
When unhiding more comments it does not hide them. Is that done purposely? |
|
Yeah it does not watch the page for new comments be uncollapsed comments, I thought that if you click that and nothing happens it would seem confusing/broken. So it’s best to leave the useless comments visible. |
|
Looks good. Just needs to be added to the readme. |
|
@bfred-it sindresorhus/ama#363 (comment)
Flash back 😄 |
|
You found that 😂 Glad that the reasoning still applies. Conversational +1’s aren’t removed (however it doesn’t consider the count) |
It doesn't appear to be checking for useless comments when the "xxx hidden items Load more..." button is clicked; like on this page. And I don't think it catches comments like "+1!" (exclamation points). There's a lot of them in that thread. |
Refer to #1526 (comment). I suppose the alternative would be to show "xx comments were hidden" near the clicked button
|
|
The "xxx useless comments were hidden" count is incorrect, greater than the comments total count: The comments that actually become hidden is ~70. (tested in both Chrome 69 And Firefox 62, with no disabled features in the extension, and no other extension enabled) A screenshot I kept: 2018-09-18_204557 |
|
(Follow-up to my comment above) in case you visit the test page, hayaku/hayaku#303 now, the page still has the same comments count, 102: and the extension currently shows a different, still incorrect count,"86 useless comments were hidden" PS. Chrome 69, extension version 18.9.19.1710. |
|
I think you’re right. The miscount is because GitHub sends the same comment twice in the code to enable some features. To fix it, the first selector needs to include |
|
For me this also hides relevant, longer comments, including review comments. |
|
Can you show an example of “longer comment” hidden? |
|
Oof, yes, the selector needs some tweaking on PRs. I only tested this on issues. #1544 will fix this at least temporarily |






Closes #1478
Testable on hayaku/hayaku#303
This is how the comments reappear after clicking "Undo"