-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
comments-time-machine-links - Restore feature on issues
#8712
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
Conversation
should I open a separate PR that adapts the feature for the react dropdowns? |
|
Why is it a partial fix? What does it take to fix it? It would be great to just fix it in a single PR if possible |
This fixes a bug where the
Ok |
|
let me know if you have any ideas for how I can integrate my code into the existing one |
comments-time-machine-links: Fix on partially prerendered pagescomments-time-machine-links: Fix on new issue pages
comments-time-machine-links: Fix on new issue pagescomments-time-machine-links - Restore feature on issues
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.
Looks good. Any improvements can be a followup PR. I'll release a new RGH version today. There's one small issue that I'm looking into
When I hovered over it, this link did not have the URL parameter, then I refreshed the page and it appeared. My guess is that GitHub updated the contents of the comment but did not remove our "rgh-seen" class. You can confirm this by opening #8698 and waiting a few minutes.
This is basically the risk we run into when we This just explains the theory, in practice sometimes we have no choice and/or React still updates the contents/textnodes without removing our rgh-seen class. |
No, it's just that |
It's the same thing. "re-rendering markdown-body` is the same as "update the (DOM) contents of the comment" |
This doesn't happen. New elements are created, and observers work as expected. You can check and see that the caller id changes when the comment body re-renders |
Caller IDs don't change, they're static across browser reloads and are connected to a specific
I've been working on Refined GitHub for 8 years and I wrote the observer, I know what's happening. refined-github/source/features/comments-time-machine-links.tsx Lines 169 to 176 in 4be765a
This observer tracks the The Verifying this is pretty simple:
You will see the So, again:
The fix is to change that observer to select the individual links in the comments rather than the |
|
Alright, thank you for the detailed explanation |
| const timestamp = $('relative-time', comment).attributes.datetime.value; | ||
| addInlineLinks(comment, timestamp); | ||
| }, {signal}); | ||
| delegate(`:is(${commentSelector}) button[data-component="IconButton"]:has(> .octicon-kebab-horizontal)`, 'click', addDropdownLinkReact, {signal}); |
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.
they added test id comment-header-hamburger

fixes #8698
Test URLs
#8698
Screenshot