From 0d01d8eda1798cbd5b95c749b12fdee561953d54 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 15 Apr 2026 18:10:05 +0000 Subject: [PATCH 1/2] Remove isRepo exception and fill test URL array with aliases Agent-Logs-Url: https://github.com/refined-github/github-url-detection/sessions/39c59fa2-5d47-4a9a-9e3a-b15a0792b4bd Co-authored-by: fregante <1402241+fregante@users.noreply.github.com> --- index.test.ts | 5 ----- index.ts | 45 ++++++++++++++++++++++++++++++++++++++++----- 2 files changed, 40 insertions(+), 10 deletions(-) diff --git a/index.test.ts b/index.test.ts index d18d2a4..8ac2212 100644 --- a/index.test.ts +++ b/index.test.ts @@ -54,11 +54,6 @@ for (const [detectName, detect] of Object.entries(pageDetect)) { }); } - // Skip negatives for this one, it's too long - if (detectName === 'isRepo') { - continue; - } - for (const url of allUrls) { if (!validURLs.includes(url)) { test(`${detectName} NO ${url}`, () => { diff --git a/index.ts b/index.ts index 7e3f3de..3c5c97a 100644 --- a/index.ts +++ b/index.ts @@ -457,11 +457,46 @@ export const isRepo = (url: URL | HTMLAnchorElement | Location = location): bool }; TEST: addTests('isRepo', [ - // Some of these are here simply as "gotchas" to other detections - 'https://github.com/sindresorhus/refined-github/blame/master/package.json', - 'https://github.com/sindresorhus/refined-github/issues/146', - 'https://github.com/sindresorhus/notifications/', // Gotcha for isNotifications - 'https://github.com/sindresorhus/refined-github/pull/148', + 'isActionRun', // Includes isActionJobRun URLs + 'isBranches', + 'isCompare', // Includes isQuickPR URLs + 'isDeletingFile', + 'isEditingFile', + 'isEditingRelease', + 'isFileFinder', + 'isForkingRepo', + 'isIssue', + 'isLabelList', + 'isMilestone', + 'isMilestoneList', + 'isNewAction', + 'isNewFile', + 'isNewIssue', + 'isNewRelease', + 'isPR', // Includes isPRConversation, isPRFiles (→isPRCommit), isPRCommitList + 'isPRConflicts', + 'isProjects', + 'isReleases', + 'isRepoPRList', + 'isRepoCommitList', + 'isRepoForksList', + 'isRepoGitObject', // Includes isRepoTree (→isRepoRoot→isRepoHome), isSingleFile (→isRenderedTextFile), isBlame + 'isRepoIssueList', + 'isRepoNetworkGraph', + 'isRepoSearch', + 'isRepoSettings', // Includes isRepoMainSettings + 'isRepoTaxonomyIssueOrPRList', + 'isRepoWiki', // Includes isNewWikiPage, isEditingWikiPage, isCompareWikiPage + 'isRepositoryActions', + 'isSingleCommit', + 'isSingleReleaseOrTag', + 'isTags', + // Repo URLs from detections that also cover non-repo pages + 'https://github.com/sindresorhus/refined-github/projects/3', // from isProject + 'https://github.com/tophf/mpiv/discussions/50', // from isDiscussion + 'https://github.com/withastro/roadmap/discussions/new?category=proposal', // from isNewDiscussion + 'https://github.com/tophf/mpiv/discussions', // from isDiscussionList + // These URLs are repos but don't match any specific detection 'https://github.com/sindresorhus/refined-github/milestones/new', // Gotcha for isRepoTaxonomyIssueOrPRList 'https://github.com/sindresorhus/refined-github/milestones/1/edit', // Gotcha for isRepoTaxonomyIssueOrPRList 'https://github.com/sindresorhus/refined-github/issues/new/choose', // Gotcha for isRepoIssueList From 67e5824a7789a11a105e925b0358a7dd6e88f142 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 15 Apr 2026 18:26:15 +0000 Subject: [PATCH 2/2] Run xo --fix to address lint issues Agent-Logs-Url: https://github.com/refined-github/github-url-detection/sessions/f3ee306a-f64c-4b9c-853a-b58305284358 Co-authored-by: fregante <1402241+fregante@users.noreply.github.com> --- index.ts | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/index.ts b/index.ts index 3c5c97a..06a0547 100644 --- a/index.ts +++ b/index.ts @@ -38,7 +38,6 @@ function exists(selector: string): boolean { * ``` */ async function waitFor(detection: () => boolean): Promise { - // eslint-disable-next-line no-await-in-loop -- We need to wait on each frame while (!detection() && document.readyState !== 'complete') { // eslint-disable-next-line no-await-in-loop await new Promise(resolve => { @@ -492,10 +491,10 @@ TEST: addTests('isRepo', [ 'isSingleReleaseOrTag', 'isTags', // Repo URLs from detections that also cover non-repo pages - 'https://github.com/sindresorhus/refined-github/projects/3', // from isProject - 'https://github.com/tophf/mpiv/discussions/50', // from isDiscussion - 'https://github.com/withastro/roadmap/discussions/new?category=proposal', // from isNewDiscussion - 'https://github.com/tophf/mpiv/discussions', // from isDiscussionList + 'https://github.com/sindresorhus/refined-github/projects/3', // From isProject + 'https://github.com/tophf/mpiv/discussions/50', // From isDiscussion + 'https://github.com/withastro/roadmap/discussions/new?category=proposal', // From isNewDiscussion + 'https://github.com/tophf/mpiv/discussions', // From isDiscussionList // These URLs are repos but don't match any specific detection 'https://github.com/sindresorhus/refined-github/milestones/new', // Gotcha for isRepoTaxonomyIssueOrPRList 'https://github.com/sindresorhus/refined-github/milestones/1/edit', // Gotcha for isRepoTaxonomyIssueOrPRList