-
Notifications
You must be signed in to change notification settings - Fork 688
Add base branch editing to PR overview #8232
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Co-authored-by: alexr00 <38270282+alexr00@users.noreply.github.com>
Co-authored-by: alexr00 <38270282+alexr00@users.noreply.github.com>
Co-authored-by: alexr00 <38270282+alexr00@users.noreply.github.com>
Co-authored-by: alexr00 <38270282+alexr00@users.noreply.github.com>
Co-authored-by: alexr00 <38270282+alexr00@users.noreply.github.com>
alexr00
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please also give the edit button a 4px top margin
src/github/pullRequestOverview.ts
Outdated
| if (selectedBranch) { | ||
| try { | ||
| await this._item.updateBaseBranch(selectedBranch); | ||
| await this._replyMessage(message, {}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@copilot Include the info about the base branch update in the reply message, and handle that reply message in the tsx so that the header updates properly.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated the implementation to include the base branch name in the reply message and handle it in the frontend to update the UI state properly in commit 9465868. The changeBaseBranch method now updates the PR state with the new base branch after receiving the response.
Co-authored-by: alexr00 <38270282+alexr00@users.noreply.github.com>
Added 4px top margin to the edit button via CSS in commit 9465868. |
alexr00
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great, now add the base change timeline event into the timeline events that we always get, and make sure to also include the new timeline event in the ChangeBaseReply.
Co-authored-by: alexr00 <38270282+alexr00@users.noreply.github.com>
Added BaseRefChanged timeline event support in commit 0633130. The event is now:
|
alexr00
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@copilot Instead of using the edit icon button, make the whole base branch look more buttony and put the click action on that.
Co-authored-by: alexr00 <38270282+alexr00@users.noreply.github.com>
Changed in commit e8ecac6. The edit icon button has been removed and the base branch itself is now a clickable button when the user has edit permissions. The button has hover and active states to indicate interactivity, using VS Code theme colors for consistency. |
Users can now change the base branch of a pull request directly from the PR overview panel when they have edit permissions and the PR is open.
Changes
UI: Made the base branch itself clickable when editable
Openand user hascanEditpermissionBackend:
pr.change-base-branchcommand handler inpullRequestOverview.tsupdateBaseBranch()method inpullRequestModel.tsusing GitHub'sUpdatePullRequestGraphQL mutation withbaseRefNameparameterGitHubRefinstance on successful updateTimeline Event Support:
BaseRefChangedEventtype to track base branch changescurrentRefNameandpreviousRefNameChangeBaseReplyand automatically displayed in the PR timelineType system:
IssueChangeEventinterface withbase?: truefor change notificationsChangeBaseReplyinterface withbaseandeventsfieldsExample
The QuickPick lists all repository branches excluding the current base branch. After selection, the panel refreshes automatically to reflect the change, and a timeline event is created showing the base branch change.
Original prompt
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.