-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Restore edit-comments-faster
on review comments
#3407
Conversation
This seems unnecessary. As I suggested earlier, the solution is to create a brand-new button instead of cloning the existing one. This way you just need to select the emoji dropdown and avoid all this document traversing/filtering. |
Filtering is needed because there can be two edit buttons in a single review comment. Check out the latest code, maybe the simplest one. |
Please always provide a link where this is testable, as requested in the PR template. And what it fixes exactly |
Sorry, added test link and make what this PR does more clear. I just found there are still rooms for improvement: currently it doesn't work if you unresolve a conversation |
Seems like GitHub removed the aforementioned lazy load logic, so this bug doesn't exist anymore. Closing for the moment. Update on 2020-08-24: it is back 😥 |
After using |
I'm still seeing the lazy-loaded context-menus. For the 3rd time, do not use |
That's why I reopened this PR (though it now also includes upgrading to
🤷♀️ That |
edit-comments-faster
in review commentsedit-comments-faster
for review comments
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you!
Note: hasComment
automatically implies a comment event listener though. This has no effect since we use onetime
, but we should keep it in mind.
Perhaps we can remove that implication once we refactor every/most hasComments
feature to use selector-observer
757cd6f
to
19f36b4
Compare
I reverted |
2.3 months in the making 🥳 |
Not sure what broke here. After this PR on #3621 only the first comment has a edit icon. the rest throw a whole bunch of console errors. |
Hidden comments break the feature because they have no reaction button. The |
Co-authored-by: Federico <me@fregante.com>
Maybe a continuation of #2992
Obsolete information
Explanation of the lazy load logic mentioned in #3396
comment-fields-keyboard-shortcuts
tries to find B which isn't loaded yetedit-comments-faster
in review comments doesn't work: only A triggers the function and the icon is added into an invisible containerThis PR
Determine if it's A triggering the function, and add the edit icon to the correct location in review comments (fix 2)Skip if it's B triggering the function, to prevent duplicate icon addition (fix 3)selector-observer
, fix "Edit comment" button injection is not reliable #3279Test: A PR with review comments (like
https://github.com/sindresorhus/refined-github/pull/3405#discussion_r460863841
)