Skip to content

feat(web): change an open pull request's base branch (E3) - #386

Merged
PastaPastaPasta merged 6 commits into
masterfrom
feat/e3-edit-base
Oct 5, 2026
Merged

PastaPastaPasta merged 6 commits into
masterfrom
feat/e3-edit-base

Conversation

@PastaPastaPasta

@PastaPastaPasta PastaPastaPasta commented Oct 4, 2026 •

Copy link
Copy Markdown
Owner

What

Maintainers and writers can change an open pull request's base branch in the web, as dg pr edit --base already does. A pencil next to the base branch in the PR header ("wants to merge into main ✎") opens a picker of the repo's other branches. The pick goes through the usual confirm with its cost and records one retarget event.

Why

A PR opened against the wrong branch, or one whose stacked base merged, had to be retargeted from the command line. GitHub does it from the PR header. Merges in both clients already follow the newest retarget, so this was the missing piece for retargeting end to end.

How

  • New components/repo/edit-base.tsx. It offers every branch of the repo now except the current base and the PR's own source branch, the same checks dg makes before it signs. It renders nothing when there's no other branch.
  • Before signing, the new base is read again, as dg does, so a branch deleted since the page loaded is refused. The picker lists branches in the shared order, with the default branch first. If a refresh removes the pick, it submits what the select shows. Focus moves into the picker and back to the pencil, and Escape closes it.
  • In pull-content.tsx, a retarget pending write posts event kind 8 with the branch, previews its cost, confirms ("Change the base of PR feat(mint-identity): mint funded identities on devnet moutai (PV14) #5 to dev"), and waits for the fold to show the new base. It is shown only for an open PR to a viewer whose role can retarget (canRetarget: maintainers and writers), outside archived repos. Signing blocks disable it with the reason.

How tested

  • tsc, eslint, and a new edit-base.test.tsx (choices, the pick, disabled with a reason, nothing to offer).
  • Live on devnet sakura, scratch repo 2D3Akz31nwDupidzP4hJ16s8tqjByYe55Vtg1iQN1MrZ/mp-merge-a, with this branch's static build:
  • At 390 px in the dark theme, the picker wraps under the header line. Focus goes into it, Escape returns focus to the pencil, and axe is clean with the picker open (e3-edit-base-390-dark/).
  • Reviewed with the code-review skill. The fixes are in the third commit: the fresh branch read, the stale pick, the shared order and helpers, the member gate, and focus.
  • Evidence in /Users/pasta/workspace/dash-forge-qa/evidence/p0/merge-power/: e3-retarget-web/01..08-*.png (picker, confirm, after the retarget, merged into dev) plus the video, e3-retarget-setup.txt, e3-retarget-dg-2.txt and e3-retarget-web-dg-verify.txt.

Limits

  • Only members can retarget. Letting a PR's author retarget it needs an author event the contract doesn't have yet.

🤖 Generated with Claude Code

PastaPastaPasta and others added 2 commits October 4, 2026 14:30
Maintainers and writers get a pencil next to the base branch in the PR header. It picks another branch of the repo (never the current base or the PR's own source branch) and records one retarget event after the usual confirm with its cost, as dg pr edit --base does. Merges already follow the newest retarget.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
@coderabbitai

coderabbitai Bot commented Oct 4, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 44 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

⚙️ Run configuration
  • Configuration used: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: eb707e7a-a5b2-4f27-86cb-892b1223c46d
📥 Commits

Reviewing files that changed from the base of the PR and between 48e82ee and bc8e7cb.

📒 Files selected for processing (3)
  • forge-web/components/repo/edit-base.test.tsx
  • forge-web/components/repo/edit-base.tsx
  • forge-web/components/repo/pull-content.tsx
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

PastaPastaPasta and others added 4 commits October 4, 2026 14:41
The branch is read again before signing, as dg does, so a branch deleted since the page loaded is refused. The picker lists branches in the shared order (default branch first), submits what the select shows when a refresh removes the pick, moves focus into the picker and back to the pencil, and closes on Escape. The control follows the page's member gate.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
# Conflicts:
#	forge-web/components/repo/pull-content.tsx
# Conflicts:
#	forge-web/components/repo/pull-content.tsx
@PastaPastaPasta
PastaPastaPasta merged commit d095076 into master Oct 5, 2026
13 checks passed
@PastaPastaPasta
PastaPastaPasta deleted the feat/e3-edit-base branch October 5, 2026 04:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant