Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Jan 24, 2026

Wiki diff URLs were not fully detected by hasCode. While wiki compare pages were already supported via isCompareWikiPage, wiki revision pages were missing.

Changes

Added isWikiRevision function

  • Detects wiki revision pages with pattern wiki/Page/{hash}
  • Matches git commit hashes using regex /^[\da-f]{5,40}$/
  • Examples:
    • https://github.com/user/repo/wiki/Home/b64098961263e40d985aaf7c5c03ef6f2ce4beda
    • https://github.com/user/repo/wiki/Page/664a8f7

Updated hasCode function

  • Added isWikiRevision(url) to detect wiki revision pages
  • Now properly detects all wiki diff-related URLs:
    • Wiki compare pages via isCompareWikiPage (e.g., wiki/Page/_compare/hash1...hash2)
    • Wiki revision pages via isWikiRevision (e.g., wiki/Page/hash)

Test coverage

  • Added test URLs for isWikiRevision
  • Added test URLs to isRepoWiki (wiki revision pages are wiki pages)
  • Added test URLs to isCompareWikiPage for the specific URL from the issue

Testing

  • ✅ All 17,236 tests pass
  • ✅ Linting passes
  • ✅ CodeQL security scan: 0 vulnerabilities

The hasCode function now correctly identifies all wiki pages that display code/diff content.

Original prompt

This section details on the original issue you should resolve

<issue_title>Include wiki diffs in hasCode</issue_title>
<issue_description>Example:

https://github.com/pixiebrix/pixiebrix-extension/wiki/Web-Extensions-behaviors/_compare/664a8f7^...664a8f7

There might be more URLs.</issue_description>

<agent_instructions>Use this as test URL, not the one in the original issue

https://github.com/refined-github/refined-github/wiki/Home/_compare/b64098961263e40d985aaf7c5c03ef6f2ce4beda...ae9e6e8443a39323823748a1645e8acd4cf39dde
```</agent_instructions>

## Comments on the Issue (you are @copilot in this section)

<comments>
<comment_new><author>@fregante</author><body>
Nah that's a bit much. To target previews we have to add specific listeners and I don't really want to add selection-observer there too 😬 </body></comment_new>
</comments>


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Co-authored-by: fregante <1402241+fregante@users.noreply.github.com>
Copilot AI changed the title [WIP] Include wiki diffs in hasCode functionality Add test coverage for wiki diff URLs Jan 24, 2026
Copilot AI requested a review from fregante January 24, 2026 10:11
@fregante
Copy link
Member

@copilot the task was Include wiki diffs in 'hasCode', which you did not complete.

@fregante fregante marked this pull request as ready for review January 24, 2026 10:16
Co-authored-by: fregante <1402241+fregante@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Jan 24, 2026

@copilot the task was Include wiki diffs in 'hasCode', which you did not complete.

You're right. I've now added the isWikiRevision function to detect wiki revision pages (e.g., wiki/Page/hash) and included it in hasCode. This covers both wiki compare pages (_compare) and wiki revision pages that show code/diffs. Commit 9f7f34e.

Co-authored-by: fregante <1402241+fregante@users.noreply.github.com>
Copilot AI changed the title Add test coverage for wiki diff URLs Include wiki diffs in hasCode Jan 24, 2026
@fregante fregante added the enhancement New feature or request label Jan 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Development

Successfully merging this pull request may close these issues.

Include wiki diffs in hasCode

2 participants