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

Disable quick-comment-edit on non-editable issues #6394

Merged
merged 1 commit into from
Mar 1, 2023

Conversation

fregante
Copy link
Member

@fregante fregante commented Mar 1, 2023

Note this fix is has selector-based: #5797

Test URLs

A conversation:

  • you commented on in the past
  • you can't edit or comment on anymore (locked or user blocked you)

Screenshot

Screenshot

@fregante fregante added the bug label Mar 1, 2023
@@ -59,5 +60,7 @@ void features.add(import.meta.url, {
include: [
pageDetect.hasComments,
],
// The feature is "disabled" via CSS selector when the conversation is locked.
// We want the edit buttons to appear while the conversation is loading, but we only know it's locked when the page has finished.
Copy link
Member Author

@fregante fregante Mar 1, 2023

Choose a reason for hiding this comment

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

I did not see any changes in the comment’s DOM, they're all marked as "editable".

If anyone sees any differences, please leave a comment or send a PR to move this check from CSS to the addQuickEditButton function (which should be able to tell whether the current comment is editable)

It would be even greater if this could be merged into a single "can comment be edited by current user", replacing the whole selector-based logic we have in canEditEveryComment

Copy link
Member Author

@fregante fregante Mar 1, 2023

Choose a reason for hiding this comment

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

Ugh, ridiculous. There are whole unused forms to update comments (form.js-comment-update) on every comment ever loaded even on locked issues.

@fregante fregante merged commit 8f9fba4 into main Mar 1, 2023
@fregante fregante deleted the quick-edit-on-locked branch March 1, 2023 10:58
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.

Edit button shows even if issue is locked
1 participant