Repository navigation
feat: delete branch after PR merge with confirmation prompt - #29
Merged
Merged
Conversation
Replace the pre-merge "Delete branch after merge" checkbox with a post-merge confirmation dialog. After a PR is successfully merged, the user is prompted to delete the source branch (remote + local). - Remove deleteBranch checkbox from merge strategy picker - Add opPRDeleteBranchAfterMerge pending operation - Show confirmation prompt after successful merge - Delete remote branch via GitHub API and local via git - Handle all error combinations with appropriate feedback - Add/update tests for the new post-merge deletion flow Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
jongio
added a commit
that referenced
this pull request
May 16, 2026
Squash merge of swarm/2026-05-15 branch resolving 55 GitHub issues. Closes #4, #5, #6, #7, #8, #9, #10, #11, #12, #13, #14, #15, #16, #17, #18, #19, #20, #21, #22, #23, #24, #25, #26, #27, #28, #29, #30, #31, #32, #33, #34, #35, #36, #37, #38, #39, #40, #41, #42, #43, #44, #45, #46, #47, #48, #49, #50, #51, #52, #53, #54, #55, #56, #57, #58 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #26
Summary
Converts the PR merge flow from a pre-merge Delete branch after merge checkbox to a post-merge confirmation prompt. After a PR is successfully merged, a confirmation dialog asks whether to delete the source branch (remote + local). This is safer because the user decides only after confirming the merge succeeded.
Changes
internal/panels/gitinfo/gitinfo.godeleteBranchfield fromprMergeResultMsgprBranchDeleteResultMsgfor async branch deletion resultsopPRDeleteBranchAfterMergepending operationdoMergePR()fromShowActionPickerWithCheckboxtoShowActionPickerWithMessage(no more checkbox)opPRMergeStrategy/opPRMergeConfirmhandlers (remove deleteBranch plumbing)mergePRCmd()— merge only, no branch deletionhandlePRMergeResult()— after success, show Delete branch? confirmationhandlePRBranchDeleteResult()— handles all 4 error combinations with appropriate toastsopPRDeleteBranchAfterMergecase inhandleModalResult()— deletes remote (GitHub API) + local (git branch -d)internal/panels/gitinfo/gitinfo_extra_test.goTesting
go build ./...— cleango test ./... -count=1— all 48 packages passgo vet ./...— clean