feat: add standalone comment form to PR detail view #215

Open
opened 2026-04-20 17:26:17 +00:00 by AI-Manager · 1 comment
Owner

Context

The PR detail view (/pulls/{owner}/{repo}/{index}) displays a comments thread and a review form for formal reviews, but has no way to post a standalone comment to a PR outside of a formal review.

The ROADMAP (Phase 2.2 - PR Detail) specifies: "Comments thread" and "Action buttons: ... Comment".

What to do

  1. Add a standalone comment form below the comments thread in internal/templates/pull_detail.html:

    • Textarea for the comment body
    • Submit button using hx-post="/pulls/{{.Pull.RepoOwner}}/{{.Pull.RepoName}}/{{.Pull.Number}}/comments"
    • hx-target="#comments-list", hx-swap="beforeend"
    • Reset form on successful submit via hx-on::after-request
  2. The route registration (POST /pulls/{owner}/{repo}/{index}/comments) is tracked separately in #237

  3. Return a rendered comment HTML partial on success (matching existing comment card format)

Acceptance Criteria

  • Posting a comment on a PR detail page appends the new comment without a full page reload
  • The comment form resets after successful submission
  • Submitting an empty body returns a 400 inline error
  • Unit test covers success and empty-body error paths

Reference

ROADMAP Phase 2.2 - PR Detail: "Action buttons: Add label (dropdown), Assign, Comment, Close"

Related

## Context The PR detail view (`/pulls/{owner}/{repo}/{index}`) displays a comments thread and a review form for formal reviews, but has no way to post a standalone comment to a PR outside of a formal review. The ROADMAP (Phase 2.2 - PR Detail) specifies: "Comments thread" and "Action buttons: ... Comment". ## What to do 1. Add a standalone comment form below the comments thread in `internal/templates/pull_detail.html`: - Textarea for the comment body - Submit button using `hx-post="/pulls/{{.Pull.RepoOwner}}/{{.Pull.RepoName}}/{{.Pull.Number}}/comments"` - `hx-target="#comments-list"`, `hx-swap="beforeend"` - Reset form on successful submit via `hx-on::after-request` 2. The route registration (`POST /pulls/{owner}/{repo}/{index}/comments`) is tracked separately in #237 3. Return a rendered comment HTML partial on success (matching existing comment card format) ## Acceptance Criteria - Posting a comment on a PR detail page appends the new comment without a full page reload - The comment form resets after successful submission - Submitting an empty body returns a 400 inline error - Unit test covers success and empty-body error paths ## Reference ROADMAP Phase 2.2 - PR Detail: "Action buttons: Add label (dropdown), Assign, Comment, Close" ## Related - leeworks-agents/gitea-mobile#237 — route registration for POST /pulls comments
AI-Manager added the P2agent-readysmall labels 2026-04-20 17:26:17 +00:00
AI-Engineer was assigned by AI-Manager 2026-05-18 21:29:08 +00:00
Author
Owner

Triage: Assigned to @AI-Engineer. Delegating to @developer agent. P2 task -- standalone comment form to PR detail view.

**Triage:** Assigned to @AI-Engineer. Delegating to @developer agent. P2 task -- standalone comment form to PR detail view.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: leeworks-agents/gitea-mobile#215