-
Notifications
You must be signed in to change notification settings - Fork 692
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. |
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 the text of the base branch button should still have code styling, and the button styling should be like the "Refresh" button.
Co-authored-by: alexr00 <38270282+alexr00@users.noreply.github.com>
Updated in commit 4e67eca. The base branch button now:
|
Implementation Plan for Base Branch Editing
UpdatePullRequestmutation withbaseRefNameparameterpullRequestOverview.tspr.change-base-branchcommand handlerchangeBaseBranchmethod with QuickPick for branch selectioncontext.tsxchangeBaseBranchmethod toPRContextclassheader.tsxupdateBaseBranchmethod topullRequestModel.tsbaseproperty toIssueChangeEventinterfaceUpdateIssueResponsetypeEventType.BaseRefChangedto enumBaseRefChangedEventinterface intimelineEvent.tsBaseRefChangedEventinterface tographql.tsBaseRefChangedEventinqueriesShared.gqlutils.tsBaseRefChangedEventViewcomponent intimeline.tsxChangeBaseReplyto include timeline eventsSummary
Successfully implemented the feature to change the base branch of a Pull Request. The base branch is displayed with code styling inside a clickable secondary button (when the user has edit permissions and PR is open) that triggers the branch selection dialog. Timeline events are created to track base branch changes.
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.