sindresorhus/refined-github

Features are not being applied on page change #4567

yakov116 posted onGitHub

Please ensure:

  • The bug is caused by Refined GitHub. It doesn't happen if I disable the extension.

Describe the problem and how to replicate it

When changing pages unless I do a full refresh none of the CSS features are showing. I am not sure if this is an issue for all features. its all

Screenshots/video/gif showing the issue, if it’s visual

https://user-images.githubusercontent.com/16872793/125619918-b62ad23f-2bd6-473c-a388-eb4910dff436.mp4

Console errors, if any

No response

Example URL

https://github.com/sindresorhus/refined-github/issues

Browser(s) used

Chrome


Frik. Yes, I saw the bug but I always assume that it's Safari’s fault. Maybe they changed the pjax:* events? Every GitHub extension is broken if so

posted by fregante over 3 years ago

I think the <has-rgh> is not getting removed on page change. makes sense?

posted by yakov116 over 3 years ago

Uhhh this is the same bug as #3945. They started changing content inside #repo-content-pjax-container, which is a sibling of has-rgh.

It might be worth adding a secondary has-rgh-inner element inside #repo-content-pjax-container and also track that.

posted by fregante over 3 years ago

I am not going to attempt this. How do we know what features need to look at the #repo-content-pjax-container and what needs the other ones?

posted by yakov116 over 3 years ago

How do we know what features need to look at the #repo-content-pjax-container and what needs the other ones?

I guess there's no choice but to manually check every feature and add deduplicate: 'has-rgh-inner' where needed?

posted by cheap-glitch over 3 years ago

Very tricky but I guess

posted by yakov116 over 3 years ago

After a bit of playing around, it seems to me most of the features would rely on has-rgh-inner anyway, so maybe this could become the new default? Then features modifying the repo header or tabs (e.g. more-dropdown, ci-link, etc.) would have to explicitly specify deduplicate: 'has-rgh'.

posted by cheap-glitch over 3 years ago

After a bit of playing around, it seems to me most of the features

Most isRepo

posted by yakov116 over 3 years ago

Even show names is broken 😢

posted by yakov116 over 3 years ago

so maybe this could become the new default

My concern is that:

  • the new container might not appear on every page
  • if GitHub goes from a "outer" page to an "inner" page in the same Ajax session, we won't notice

I think the logic would be:

  1. has inner? deduplicate, return
  2. can have inner? add inner, run, return
  3. has-rgh? deduplicate, return
  4. add has-rgh, run, return
posted by fregante over 3 years ago

It looks like the current code doesn’t match my suggested flow. Maybe it’s:

  • Add has-rgh and has-rgh-inner at the same time, wherever possible
  • Default deduplicate to undefined, which would be the auto-mode:
if the repo-container exists
  if has-rgh-inner doesn’t exists
    run feature
else if has-rgh doesn’t exist
  run feature 
posted by fregante over 3 years ago

There are still more issues.

For example dim-bots

posted by yakov116 over 3 years ago

Yes, it's probable that I missed some features since I had to go manually through most of them. In most cases fixing it should be as simple as adding deduplicate: 'has-rgh-inner'.

posted by cheap-glitch over 3 years ago

But that runs on pages that do not have inner. (Commit pages)

posted by yakov116 over 3 years ago

I can't reproduce, can you describe the exact steps you took?

posted by cheap-glitch over 3 years ago

Will try later to see if I have a n issue ang will let you know

posted by yakov116 over 3 years ago

LOL I think we should wait a drop. Github needs to figure themselves out.

Go to https://github.com/sindresorhus/refined-github/compare/21.7.18...main Then go to the pull requests

image

posted by yakov116 over 3 years ago

Fund this Issue

$0.00
Funded

Pull requests