feat: add close/reopen action to PR detail view #91
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?
Description
The PR detail view (
/pulls/{owner}/{repo}/{index}) currently shows the review form (approve/request-changes/comment) and a mergeable status indicator, but there is no way to close or reopen a pull request from the mobile UI. The issue detail view has close/reopen actions viaPOST /issues/{owner}/{repo}/{index}/closeandPOST /issues/{owner}/{repo}/{index}/state, but the PR detail view is missing equivalent handlers and UI.What to Do
POST /pulls/{owner}/{repo}/{index}/statehandler ininternal/handlers/handlers.gothat callsclient.SetIssueState(PRs share the issues state endpoint in Gitea)internal/templates/pull_detail.htmlusing HTMXhx-posttargeting the new routeAcceptance Criteria
POST /pulls/{owner}/{repo}/{index}/statehandler is registered and functionalgo test ./...passesRoadmap Reference
Phase 2.2 — PR Detail view: "Action buttons: Add label, Assign, Comment, Close"
The PR detail view is specified to have the same action buttons as the issue detail view.
Notes
This does not require human operator intervention — the work is entirely within the
gitea-mobilerepo. No deployment is needed until #16 (deploy + phone verify).Triage (2026-03-27): Assigned to @AI-Engineer. This is a self-contained small feature (P2) with no blockers. Delegating to a developer agent for implementation.
Scope: Add POST handler, register route, add HTMX button to PR detail template, handle state toggle. Straightforward code change in handlers.go and pull_detail.html.
Implementation complete. PR #92 has been created with the following changes:
POST /pulls/{owner}/{repo}/{index}/stateroute andSetPullStatehandler inhandlers.gopull_detail.htmlstate-closedwhen PR is closedThe handler reuses the existing
SetIssueStateGitea API call since PRs share the issues state endpoint. Code compiles cleanly. Pre-existing test failure (unrelated template path issue) is not affected.