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
Observe subtree of dashboard news to fix hide-own-stars #1707
Conversation
I don’t see how the two are related (although I haven’t tested this) and I’d really prefer not using subtree |
These incidents are related, in the sense we are talking about the dashboard DOM that has the load-more button. I don't actually remember what the structure of dashboard DOM was before they added the recent activity section on the top. Maybe it was just news items inside the news section.
If this were the case (which is what I remember to be) the mutation observer was listening for only mutations on its immediate child elements, which worked as expected. But the current DOM is a but different.
And now mutations happen inside the So adding subtree is required, or we could move mutation observer from
Yeah I'd hate to use it too, but there seems to be no better options (as of now, open to better ideas, and proven wrong), and having the limitations as mentioned above. The number of mutation events that are generated are not different from the ones that were generated before, because debugging the number of times mutation events are generated are directly related to the number of times the load-more-items action happens. |
I see now 👌 How about just observing the new element and removing the old one? We do that in |
I've gone ahead and tried to do this, but hit with some problems, some of them already mentioned above
I'm using the word volatile attribute for I don't know of any perf issues regarding the usage of |
Sorry for the very long explainer, and also I've made a sketch just in case for moments just like this: |
How about 3b2772e? Not as easy as |
a3d197f
to
c948b11
Compare
@bfred-it Yeah, good enough, but still we have to remember that if GitHub ever the DOM of dashboard (when they complete the beta dashboard), this would break again. I'll update the PR ASAP. |
That's ok, I'll send that as a new PR |
Hey, I was supposed to work on this issue 😅! |
Yeah by your response was that it was too complicated so I had to write it myself 😋 |
Yes the other solutions are complicated, which is why I tried to avoid them, but still (even though I do not have any metrics 🤷♂️) |
Should probably fix #1619.
I could not test this for myself, but it should work. 🤞
There may be an easy of implementing this feature while using CSS using the
:has()
selector, which (as of now) is not implemented by any of the browsers.