`no-self-reference` - Fix false positives on AJAX navigation by scarf005 · Pull Request #9078 · refined-github/refined-github · GitHub
Skip to content

no-self-reference - Fix false positives on AJAX navigation#9078

Closed
scarf005 wants to merge 2 commits into
refined-github:mainfrom
scarf005:fix/9077/no-self-reference-false-positive-when-links-reference-each-other
Closed

no-self-reference - Fix false positives on AJAX navigation#9078
scarf005 wants to merge 2 commits into
refined-github:mainfrom
scarf005:fix/9077/no-self-reference-false-positive-when-links-reference-each-other

Conversation

@scarf005

Copy link
Copy Markdown
Contributor

…igation

Compare issue links against the current page at callback time so Turbo page replacement no longer reuses an outdated URL and disables the wrong link.

Refs: refined-github#9077

Co-authored-by: chatgpt-codex-connector[bot] <199175422+chatgpt-codex-connector[bot]@users.noreply.github.com>
Assisted-by: openai/gpt-5.4 on opencode
@scarf005 scarf005 changed the title - Fix false positives after Turbo issue navigation (#9077) no-self-reference - Fix false positives after Turbo issue navigation (#9077) Mar 11, 2026
@github-actions github-actions Bot added the bug label Mar 11, 2026
Comment thread source/features/no-self-reference.tsx
@fregante fregante changed the title no-self-reference - Fix false positives after Turbo issue navigation (#9077) no-self-reference - Fix false positives on AJAX navigation Mar 12, 2026
@fregante fregante marked this pull request as ready for review March 12, 2026 22:25

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Image

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How is this possible? Isn't the code the same as in your PR?

image

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think both PRs are discarding the hash, which was not the case before. Only links without hash were being selected by the observer.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I made the same mistake

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Or this mistake of mine made it into both PRs

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should just use :not(href*="#"]) in the selector and then use location.href without .split here.

const selfLink = {
href: 'https://github.com/refined-github/refined-github/issues/9077#issuecomment-2',
};
assert.isTrue(isCurrentPageLink(selfLink));

@SunsetTechuila SunsetTechuila Mar 13, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That should return false

@fregante fregante left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See notes

@scarf005

Copy link
Copy Markdown
Contributor Author

@fregante @SunsetTechuila should I close this PR in favor of #9086?

@SunsetTechuila

Copy link
Copy Markdown
Contributor

No

@fregante fregante closed this Mar 13, 2026
@fregante

Copy link
Copy Markdown
Member

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Development

Successfully merging this pull request may close these issues.

no-self-reference: false positive when links reference each other

3 participants