Add merge PR button to pull request detail view #177
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Context
The PR detail view (
/pulls/{owner}/{repo}/{index}) supports reviewing and closing PRs but has no merge button. The roadmap specifies that agents should be able to merge PRs from the mobile UI.What to do
MergePR(ctx, token, owner, repo string, index int64, mergeStyle string) errormethod tointernal/gitea/client.gocallingPOST /repos/{owner}/{repo}/pulls/{index}/merge.POST /pulls/{owner}/{repo}/{index}/mergeroute and handler ininternal/handlers/handlers.go.internal/templates/pull_detail.htmlto show a "Merge" button (only whenPull.Mergeable == trueandPull.State == "open").Acceptance criteria
go test ./...passesReference
ROADMAP.md Phase 2.2 — PR Detail view; Phase 1.5 — HTTP Handlers table
Triage (2026-04-19)
Assigned to: AI-Engineer (developer)
Status: Ready for implementation. No blockers.
This is a feature addition to the pull request detail handler. The existing
PullDetailhandler atGET /pulls/{owner}/{repo}/{index}needs a merge button added to the template, and a newPOST /pulls/{owner}/{repo}/{index}/mergehandler needs to be implemented calling the Gitea API merge endpoint.Scope: Small — one new handler + template update.
Sprint planning note:
MergePull()method in the client layer is a prerequisite. Created #187 to track that work first. Implementation order: #187 (client method) → #177 (UI button + handler) → #186 (tests).Progress update: Prerequisite #187 (MergePull client method) is now merged. Next step is #188 (HTTP handler), then #206 (wire into template). The merge PR feature chain is: #187 (done) -> #188 (ready) -> #206 -> #186 (tests).
Sprint planning update (2026-04-20): Step 1 is done —
MergePull()client method was implemented in #187 (closed). Step 2 (handler + route) is tracked in #206. The remaining work in this issue is step 3 only: updateinternal/templates/pull_detail.htmlto add a merge form withhx-postpointing to the merge route, shown only whenPull.Mergeable == trueandPull.State == "open". The route handler in #206 will handle the response fragment.Sprint planning update (2026-04-20): Step 1 of this issue is already done —
MergePull()was added to the client in PR #210 (merged). The method signature isMergePull(ctx, token, owner, repo string, index int64, style, title, message string) error. The remaining work is steps 2 and 3 only — wire the HTTP handler and add the merge button topull_detail.html.Note: Issue #206 tracks the same remaining work at P1. This issue can be closed once #206 is complete.