From 4fa9cf5ae548ebbd80d0d044b4ea2827e9a03e12 Mon Sep 17 00:00:00 2001 From: "mergify[bot]" <37929162+mergify[bot]@users.noreply.github.com> Date: Fri, 1 May 2026 06:57:27 +0000 Subject: [PATCH 1/2] ci(mergify): upgrade configuration to current format --- .mergify.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.mergify.yml b/.mergify.yml index f374d77..f804b85 100644 --- a/.mergify.yml +++ b/.mergify.yml @@ -59,4 +59,4 @@ merge_protections: merge_protections_settings: reporting_method: deployments - auto_merge: true + auto_merge_conditions: true From f7051dee9b566f8b069b9b2880df44722178c049 Mon Sep 17 00:00:00 2001 From: Julien Danjou Date: Mon, 4 May 2026 18:13:50 +0200 Subject: [PATCH 2/2] feat(extension): preserve current PR tab in stack prev/next nav MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The stack prev/next nav at the top of a PR page used to always link to the bare PR URL, dropping the user back onto the Conversation tab. Now the link forwards whatever subpath the user is currently viewing (`/changes`, `/files`, `/commits`, …) so navigating between PRs in a stack keeps you on the same tab. Hash and query are intentionally not preserved — they typically point at PR-specific content (a diff anchor, a comment) that won't apply to the target PR. Change-Id: Ic8087dddcb12b508e8b2837e2b4c43bf41a66d86 --- src/__tests__/mergify.test.js | 20 ++++++++++++++++++++ src/mergify.js | 5 ++++- 2 files changed, 24 insertions(+), 1 deletion(-) diff --git a/src/__tests__/mergify.test.js b/src/__tests__/mergify.test.js index 21068bb..edda624 100644 --- a/src/__tests__/mergify.test.js +++ b/src/__tests__/mergify.test.js @@ -2251,6 +2251,26 @@ describe("buildStackNav", () => { el.querySelector('[data-mergify-stack-nav="next-empty"]'), ).not.toBeNull(); }); + + it("preserves the current subpath in prev/next links", () => { + const stack = stackOf(pull(1), pull(2, { is_current: true }), pull(3)); + const el = buildStackNav(stack, { + org: "o", + repo: "r", + number: 2, + subpath: "changes", + }); + expect( + el + .querySelector('[data-mergify-stack-nav="prev"]') + .getAttribute("href"), + ).toBe("/o/r/pull/1/changes"); + expect( + el + .querySelector('[data-mergify-stack-nav="next"]') + .getAttribute("href"), + ).toBe("/o/r/pull/3/changes"); + }); }); describe("injectStackNav", () => { diff --git a/src/mergify.js b/src/mergify.js index 56c67e4..f575d75 100644 --- a/src/mergify.js +++ b/src/mergify.js @@ -504,6 +504,7 @@ function getPullRequestData() { org: parts[1], repo: parts[2], pull: parts[4], + subpath: parts[5] || "", }; } @@ -832,6 +833,7 @@ async function _tryInject() { org: _data.org, repo: _data.repo, number: Number.parseInt(_data.pull, 10), + subpath: _data.subpath, }); const existingRow = document.querySelector("#mergify"); @@ -1704,7 +1706,8 @@ function buildStackNav(stackData, currentPull) { const a = document.createElement("a"); a.setAttribute("data-mergify-stack-nav", direction); a.setAttribute("data-mergify-stack-nav-num", String(pull.number)); - a.href = `/${currentPull.org}/${currentPull.repo}/pull/${pull.number}`; + const tail = currentPull.subpath ? `/${currentPull.subpath}` : ""; + a.href = `/${currentPull.org}/${currentPull.repo}/pull/${pull.number}${tail}`; a.title = `Open #${pull.number}: ${pull.title}`; a.style.cssText = "display:flex;align-items:center;gap:6px;" +