[FEATURE] Desktop: branch diff badge, diff pane and Create PR should use the PR's target branch, not the repo default branch
Status Open
Maintainer reply None cached
Activity 0 comments · opened Oct 8, 2026
Preflight Checklist
- [x] I have searched existing requests and this feature hasn't been requested yet
- [x] This is a single feature request
Problem Statement
In a Desktop Code session, the +N −M badge in the branch bar, the diff pane behind it and the Create PR button all use the repo's GitHub default branch as their base. In our repo the default branch is main, but every PR targets staging, and main lags staging by several merged PRs.
As a result, for a branch cut from the latest staging, the badge showed +1,894 −274 (53 files) where the real change was +685 −184 (31 files). Clicking it shows other teams' already-merged work as part of my branch. I read one of those changes as mine and thought my branch had picked up unrelated work. Create PR would also target main by default, which in our repo means production.
Proposed Solution
- Use the bound PR's base branch for the badge, diff pane and Create PR once a PR exists.
- Before a PR exists, use a per-repo setting (e.g.
worktree.baseBranch/ a "compare against" choice in the bar), falling back to the default branch. - Show the base being compared against next to the numbers (e.g.
vs staging +685 −184), so the baseline is never implicit.
Related
- #67916: asked to hide or configure the same badge because it compares against
main; closed as inactive and locked. - #92693: base-branch mode for the CLI
/diffpanel, which assumesmain/origin/HEADas the base. - #93786: no way to select a compare ref in the Desktop diff pane.