Skip to content

feat(extension): preserve current PR tab in stack prev/next nav#413

Merged
mergify[bot] merged 1 commit intomainfrom
devs/jd/worktree-changes-link/preserve-current-pr-tab-stack-prev-next-nav--c8087ddd
May 5, 2026
Merged

feat(extension): preserve current PR tab in stack prev/next nav#413
mergify[bot] merged 1 commit intomainfrom
devs/jd/worktree-changes-link/preserve-current-pr-tab-stack-prev-next-nav--c8087ddd

Conversation

@jd
Copy link
Copy Markdown
Member

@jd jd commented May 4, 2026

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.

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
Copilot AI review requested due to automatic review settings May 4, 2026 16:14
@mergify mergify Bot deployed to Mergify Merge Protections May 4, 2026 16:14 Active
@mergify
Copy link
Copy Markdown
Contributor

mergify Bot commented May 4, 2026

Merge Protections

Your pull request matches the following merge protections and will not be merged until they are valid.

🟢 Required Reviews

Wonderful, this rule succeeded.
  • any of:
    • #approved-reviews-by >= 2
    • author = dependabot[bot]

🟢 Enforce conventional commit

Wonderful, this rule succeeded.

Make sure that we follow https://www.conventionalcommits.org/en/v1.0.0/

  • title ~= ^(fix|feat|docs|style|refactor|perf|test|build|ci|chore|revert|ui)(?:\(.+\))?:

🟢 🔎 Reviews

Wonderful, this rule succeeded.
  • #changes-requested-reviews-by = 0
  • #review-requested = 0
  • #review-threads-unresolved = 0

🟢 📕 PR description

Wonderful, this rule succeeded.
  • body ~= (?ms:.{48,})

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Updates the stack prev/next navigation links on GitHub PR pages so they keep the user on the same PR subpage (e.g. /files, /commits) when moving between PRs in a stack, instead of always returning to the Conversation tab.

Changes:

  • Extend PR page URL parsing to capture a subpath after the PR number.
  • Pass subpath through the render context and append it when building stack prev/next link URLs.
  • Add a unit test asserting that prev/next links preserve the current subpath.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
src/mergify.js Parse and propagate PR subpath, and include it when generating stack navigation hrefs.
src/tests/mergify.test.js Add coverage to ensure stack prev/next links preserve the current subpath.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/mergify.js
@jd jd marked this pull request as ready for review May 4, 2026 16:25
@mergify mergify Bot requested a review from a team May 4, 2026 16:28
@jd jd requested a review from a team May 5, 2026 10:10
@mergify
Copy link
Copy Markdown
Contributor

mergify Bot commented May 5, 2026

Merge Queue Status

This pull request spent 1 minute 53 seconds in the queue, including 1 minute 24 seconds running CI.

Required conditions to merge

mergify Bot added a commit that referenced this pull request May 5, 2026
@mergify mergify Bot added the queued label May 5, 2026
mergify Bot added a commit that referenced this pull request May 5, 2026
@mergify mergify Bot merged commit 40f51b6 into main May 5, 2026
8 checks passed
@mergify mergify Bot deleted the devs/jd/worktree-changes-link/preserve-current-pr-tab-stack-prev-next-nav--c8087ddd branch May 5, 2026 10:13
@mergify mergify Bot removed the queued label May 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

4 participants