Repository navigation
Fix: Features are not being applied on page change - #4571
Conversation
| pageDetect.isEmptyRepo, | ||
| ], | ||
| awaitDomReady: false, | ||
| deduplicate: 'has-rgh', |
There was a problem hiding this comment.
Why? This should be the default.
There was a problem hiding this comment.
The new default for deduplicate is undefined, which means to check both has-rgh and has-rgh-inner. IMO this makes sense for the new default since most features need to be aware of both.
But since more-dropdown affects the DOM outside of #repo-content-pjax-container, we want it to look at has-rgh only. Otherwise when has-rgh-inner is removed it will run again, even though the repo header hasn't changed.
There was a problem hiding this comment.
Then my suggested logic doesn't work. The intent was to create logic that works for every feature, but if as you say features need to specify which deduplicator to use, then the logic is no longer sound.
Same PR? |
There was a problem hiding this comment.
I think everything here needs to be undone. I can't merge this PR as is because it changes the default behavior for all the features. That requires testing of every feature and it's not practical.
In short the problem is that we receive a "page updated" event but we don't know which part updated and which elements are still on the page. I don't think this detection can be automated.
For now we can take the same exact approach we took for #3945: Marking each currently-broken feature with a custom selector. However this new selector can probably be has-rgh-inner instead of using one per feature.
we can also drop many of the custom
deduplicateselectors we added for #3945Same PR?
You're right that's not urgent. Later. We'll clean this all up after we fix Refined GitHub.
|
Thoughts? Alternative solutions? If this works well for you without breaking other features, then we could also merge it and clean it up later. 😅 I just worry that it fixes some features and breaks others. |
|
It does work well as far as I've seen, but I do agree that changing the default for every feature is a risky move. I still thinks it makes sense as a default though. For now I'll change this PR to add |
|
Okay, I've combed through the output of rg --files-without-match 'deduplicate:' source/features/*.tsx | sortand quickly tested every feature I added the new deduplication to. There might be a few tricky cases where this doesn't cut it entirely, e.g. I've noticed |
|
Excellent! Version coming! Let’s see how it works in the field. Thanks for working on this! |
Fixes #4567
Test URLs
Navigate using PJAX, e.g.:
All features should work properly, and features affecting the repo header (e.g
ci-link,quick-repo-deletion) should be properly deduplicated.Screenshot
capture-1626426371.mp4