Skip to content

hide-low-quality-comments - Restore feature - #10145

Merged
fregante merged 6 commits into
mainfrom
low
Sep 30, 2026
Merged

fregante merged 6 commits into
mainfrom
low

Conversation

@fregante

Copy link
Copy Markdown
Member

@github-actions github-actions Bot added the bug label Sep 29, 2026
observe('.markdown-body > p:only-child', maybeHide, {signal});
}

// This should NOT be made dynamic via observer, it's not worth updating the lowQuality count for fresh comments

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I did have to use the observer because the new issue page loads the content later after dom-ready.

I made two changes to support this:

  • the count is updated on the fly via svelte component
  • the "show" action adds a class to the container rather than looping hidden comments
  • the feature is then unloaded on "show"

Comment on lines +50 to +58
// If the person is having a conversation, then don't hide it
const author = $('a[data-testid="avatar-link"]', comment).getAttribute('href')!;
// If the first comment left by the author isn't a low quality comment (previously hidden or about to be hidden), then leave this one as well
const previousComment = $(
`[data-wrapper-timeline-id]:not(.rgh-low-quality-comment) a[data-testid="avatar-link"][href="${author}"]:not(.color-fg-muted)`,
);
if (closestComment(previousComment) !== comment) {
return;
}

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have not verified this condition and what it means, I just updated the selector

Comment on lines -36 to -37
for (const similarCommentsBox of $$('.js-discussion .Details-element:not([data-body-version])')) {
hideComment(similarCommentsBox);

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@fregante
fregante marked this pull request as ready for review September 30, 2026 08:04
@fregante

Copy link
Copy Markdown
Member Author

YOLO

@fregante
fregante merged commit 9126498 into main Sep 30, 2026
14 checks passed
@fregante
fregante deleted the low branch September 30, 2026 08:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Development

Successfully merging this pull request may close these issues.

hide-low-quality-comments broken on new issue UI

1 participant