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

Fix quick-review-comment-deletion #5970

Merged
merged 2 commits into from
Sep 15, 2022

Conversation

chcamiloam
Copy link
Contributor

@yakov116 yakov116 changed the title Fix quick-review-comment-deletion is broken Fix quick-review-comment-deletion Sep 12, 2022
@@ -33,7 +33,7 @@ function init(signal: AbortSignal): Deinit {
delegate(document, '.rgh-review-comment-delete-button', 'click', onButtonClick, {signal});
delegate(document, '.rgh-quick-comment-edit-button', 'click', onEditButtonClick, {signal});

return observe('.review-comment > .unminimized-comment form:not(.js-single-suggested-change-form) .js-comment-cancel-button:not(.rgh-delete-button-added)', {
return observe('.review-comment form.js-comment-update:not(.js-single-suggested-change-form) .js-previewable-comment-form .form-actions .js-comment-cancel-button:not(.rgh-delete-button-added)', {
Copy link
Member

@fregante fregante Sep 13, 2022

Choose a reason for hiding this comment

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

Thanks for the PR!

I think this selector can be greatly shortened now. In this specific instance, the issue was just > .unminimized-comment, so dropping it would already fix it.

Better yet, probably this:

.review-comment .js-comment-cancel-button:not(.rgh-delete-button-added)

But it needs testing to ensure it doesn't also apply to unrelated parts. You an add a console.log inside addDeleteButton to see what's being matched exactly.

Context:

  • For example, .js-single-suggested-change-form was added in 5edc743, but it doesn't apply anymore.

@fregante fregante added the bug label Sep 13, 2022
@fregante fregante marked this pull request as draft September 15, 2022 07:45
@chcamiloam chcamiloam marked this pull request as ready for review September 15, 2022 10:20
@fregante fregante merged commit f90b884 into refined-github:main Sep 15, 2022
@fregante
Copy link
Member

ཐུགས་རྗེ་ཆེ་

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.

quick-review-comment-deletion is broken
2 participants