Detect React navigation and re-apply features#9830
Merged
Conversation
fregante
commented
Jul 15, 2026
fregante
left a comment
Member
Author
There was a problem hiding this comment.
The last workaround that mentions is #6554. This might have to be fixed via svelte instead.
refined-github/source/features/default-branch-button.tsx
Lines 69 to 72 in adf982b
| include: [ | ||
| pageDetect.isConversation, | ||
| // Workaround for https://github.com/refined-github/refined-github/issues/6554 | ||
| pageDetect.isRepoIssueOrPRList, |
Member
Author
There was a problem hiding this comment.
I'll merge this PR after I verified these
| function init(signal: AbortSignal): void { | ||
| // TODO: Revert #9086 after https://github.com/refined-github/refined-github/issues/6554 | ||
| // Exclude reference to a comment on the same page | ||
| observe('.markdown-body:not(section[aria-label="Events"] *) a.issue-link:not([href*="#"])', underlineSelfReference, { |
Member
Author
There was a problem hiding this comment.
The previous code wasn't substantially better, so it's ok to leave this workaround and drop the comment.
fregante
commented
Jul 15, 2026
fregante
left a comment
Member
Author
There was a problem hiding this comment.
All issues verified and fixed. Going ahead
| // Do not move to `includes` until React AJAX issues are resolved: | ||
| // https://github.com/refined-github/refined-github/pull/7524#issuecomment-2211692096 | ||
| // https://github.com/refined-github/refined-github/issues/6554 | ||
| if (new URLSearchParams(location.search).get('type') !== 'repositories') { |
Member
Author
There was a problem hiding this comment.
This is actually where "leave the listeners active" is a problem: the selector was too broad, so #7520 was resurfaced:
|
|
||
| function initSearch(signal: AbortSignal): void { | ||
| observe('.search-title a', addSearchConversationLinks, {signal}); | ||
| observe('a[class^="Repositories-module__stargazersLink"]', addSearchConversationLinks, {signal}); |
Member
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

I want to test-drive just this listener, we can then address any issues separately. React navigation is long overdue and this should cover most of the functionality.
I think we don't really need to unload features, with few exceptions, it's mostly a performance optimization. They're still unloaded when a regular pjax navigation happens. Our
delegateandobservecalls are natively deduplicated already, so it won't actually break anything ifinitis called twice in a row.Svelte components will eventually enable us to have features that auto-update.