From 5601351c9330b4c6a1327d4721cff13e5c4e0714 Mon Sep 17 00:00:00 2001 From: Lourince Daging Date: Wed, 22 Jul 2026 16:58:17 +0200 Subject: [PATCH] fix(extension): remove dead matchPullRequestTarget from content script MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit matchPullRequestTarget duplicated matchGitHubPageTarget minus the kind field and was left stranded by #7462/#7487 — nothing in production consumed it, only the __loopoverContentInternals test hook re-exported it. Remove the function and its export entry, and drop the now-dead assertions/type from the content-script test. Closes #8023 --- apps/loopover-extension/content.js | 7 ------- test/unit/extension-content.test.ts | 13 ------------- 2 files changed, 20 deletions(-) diff --git a/apps/loopover-extension/content.js b/apps/loopover-extension/content.js index 29f94aed4a..f5e58b5306 100644 --- a/apps/loopover-extension/content.js +++ b/apps/loopover-extension/content.js @@ -13,12 +13,6 @@ function matchGitHubPageTarget(pathname) { return { kind: "pull_request", owner, repo, pullNumber: Number(number) }; } -function matchPullRequestTarget(pathname) { - const target = matchGitHubPageTarget(pathname); - if (!target) return null; - return { owner: target.owner, repo: target.repo, pullNumber: target.pullNumber }; -} - function mountOverlay(target) { if (document.querySelector("[data-loopover-pr-context]")) return; const container = document.createElement("aside"); @@ -192,7 +186,6 @@ function renderActions(body, actions) { if (globalThis.__LOOPOVER_EXTENSION_TEST__) { globalThis.__loopoverContentInternals = { matchGitHubPageTarget, - matchPullRequestTarget, createOverlayLoader, renderPullContext, renderSection, diff --git a/test/unit/extension-content.test.ts b/test/unit/extension-content.test.ts index e8b9957503..12965f594e 100644 --- a/test/unit/extension-content.test.ts +++ b/test/unit/extension-content.test.ts @@ -25,18 +25,6 @@ describe("extension content script", () => { // Issue pages are out of scope — no kind:"issue" classification, and no match. expect(internals.matchGitHubPageTarget("/JSONbored/loopover/issues/145")).toBeNull(); expect(internals.matchGitHubPageTarget("/JSONbored/loopover/pulls")).toBeNull(); - expect(internals.matchPullRequestTarget("/JSONbored/loopover/pull/146")).toEqual({ - owner: "JSONbored", - repo: "loopover", - pullNumber: 146, - }); - expect(internals.matchPullRequestTarget("/JSONbored/loopover/pull/146/files")).toEqual({ - owner: "JSONbored", - repo: "loopover", - pullNumber: 146, - }); - expect(internals.matchPullRequestTarget("/JSONbored/loopover/issues/146")).toBeNull(); - expect(internals.matchPullRequestTarget("/JSONbored/loopover")).toBeNull(); }); it("renders private pull-context sections and escapes API text", () => { @@ -134,7 +122,6 @@ function loadContentInternals(overrides: Record = {}) { matchGitHubPageTarget: ( pathname: string, ) => { kind: "pull_request"; owner: string; repo: string; pullNumber: number } | null; - matchPullRequestTarget: (pathname: string) => { owner: string; repo: string; pullNumber: number } | null; createOverlayLoader: (container: { querySelector: (selector: string) => unknown }, target: unknown) => () => Promise; renderPullContext: (payload: unknown) => string; };