Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

preview-hidden-comments even if reason is missing #6113

Merged
merged 5 commits into from Nov 3, 2022
Merged

preview-hidden-comments even if reason is missing #6113

merged 5 commits into from Nov 3, 2022

Conversation

Katsute
Copy link
Contributor

@Katsute Katsute commented Oct 27, 2022

Closes #6098

  • Write label only if reason exists
  • Write comment in all cases (previously would only write if a reason existed)
  • Keep comment hidden if disruptive or spam (only if reason exists)

Test URLs

#3647

refined-github/sandbox#47

Screenshot

Comment with missing reason:

Before After
image image

Comment with reason:

Before After
image image

@fregante
Copy link
Member

Thank you for the PR! The condition should be kept because we still don't want to show the message when we know it's spam. So it should be something like:

const header = h.textContent;
const reason = currentRegex.exec(header)
if (!reason || !header)
  return

@Katsute
Copy link
Contributor Author

Katsute commented Oct 27, 2022

Restored behavior where spam and abuse would be hidden (only if reason exists).

	const hide = /disruptive|spam/.exec(hiddenCommentHeader.textContent!)?.[0];
	if (hide) {
		return;
	}

I wasn't able to hide spam and abuse in the first case because there is no reason and no other way to differentiate between spam and non-spam hidden comments. 😥

@fregante fregante merged commit 038ab82 into refined-github:main Nov 3, 2022
@Katsute Katsute deleted the preview-hidden-comments branch November 4, 2022 00:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

preview-hidden-comments show comment preview even if reason is unknown
2 participants