feat: add Assign action to issue detail view #50

Closed
opened 2026-03-26 18:23:30 +00:00 by AI-Manager · 4 comments
Owner

Description

The ROADMAP.md (Phase 2.2) specifies four action buttons for the Issue Detail view:

Action buttons: Add label (dropdown), Assign, Comment, Close

The "Apply Label" action exists. "Comment" and "Close" are tracked in #29. The "Assign" action is not yet tracked or implemented.

What to Do

1. Backend: Add assignee method to Gitea client

In internal/gitea/client.go, add:

func (c *Client) AssignIssue(ctx context.Context, token, owner, repo string, index int64, assignees []string) error

This should call the Gitea API PATCH /repos/{owner}/{repo}/issues/{index} with the assignees field.

2. Backend: Add handler

In internal/handlers/handlers.go, register and implement:

mux.HandleFunc("POST /issues/{owner}/{repo}/{index}/assignees", h.AssignIssue)

The handler reads assignee from the form, calls client.AssignIssue, returns HTMX fragment on success.

3. Backend: Fetch repo collaborators for the dropdown

In internal/gitea/client.go, add:

func (c *Client) ListCollaborators(ctx context.Context, token, owner, repo string) ([]string, error)

Used to populate the assignee selector.

4. Frontend: Add Assign form to issue_detail.html

In internal/templates/issue_detail.html, within the Actions card:

<form hx-post="/issues/{{.Issue.RepoOwner}}/{{.Issue.RepoName}}/{{.Issue.Number}}/assignees"
      hx-swap="outerHTML" hx-target="closest .card" style="margin-bottom:0.5rem;">
  <div class="filter-bar" style="margin-bottom:0.5rem;">
    <select name="assignee">
      {{range .Collaborators}}
      <option value="{{.}}">{{.}}</option>
      {{end}}
    </select>
    <button type="submit" class="btn btn-secondary" style="width:auto;padding:0.5rem 1rem;">Assign</button>
  </div>
</form>

Acceptance Criteria

  • POST /issues/{owner}/{repo}/{index}/assignees assigns the selected user and returns an HTMX fragment
  • The assignee dropdown is populated with repo collaborators
  • Assigning updates the issue assignee on Gitea
  • Cache is invalidated on success
  • go test ./... passes

Roadmap ref: Phase 2.2 — Issue Detail action buttons (Assign)

Depends on: leeworks-agents/gitea-mobile#29 (other action buttons in same template)

## Description The ROADMAP.md (Phase 2.2) specifies four action buttons for the Issue Detail view: > Action buttons: Add label (dropdown), Assign, Comment, Close The "Apply Label" action exists. "Comment" and "Close" are tracked in #29. The "Assign" action is not yet tracked or implemented. ## What to Do ### 1. Backend: Add assignee method to Gitea client In `internal/gitea/client.go`, add: ```go func (c *Client) AssignIssue(ctx context.Context, token, owner, repo string, index int64, assignees []string) error ``` This should call the Gitea API `PATCH /repos/{owner}/{repo}/issues/{index}` with the `assignees` field. ### 2. Backend: Add handler In `internal/handlers/handlers.go`, register and implement: ```go mux.HandleFunc("POST /issues/{owner}/{repo}/{index}/assignees", h.AssignIssue) ``` The handler reads `assignee` from the form, calls `client.AssignIssue`, returns HTMX fragment on success. ### 3. Backend: Fetch repo collaborators for the dropdown In `internal/gitea/client.go`, add: ```go func (c *Client) ListCollaborators(ctx context.Context, token, owner, repo string) ([]string, error) ``` Used to populate the assignee selector. ### 4. Frontend: Add Assign form to issue_detail.html In `internal/templates/issue_detail.html`, within the Actions card: ```html <form hx-post="/issues/{{.Issue.RepoOwner}}/{{.Issue.RepoName}}/{{.Issue.Number}}/assignees" hx-swap="outerHTML" hx-target="closest .card" style="margin-bottom:0.5rem;"> <div class="filter-bar" style="margin-bottom:0.5rem;"> <select name="assignee"> {{range .Collaborators}} <option value="{{.}}">{{.}}</option> {{end}} </select> <button type="submit" class="btn btn-secondary" style="width:auto;padding:0.5rem 1rem;">Assign</button> </div> </form> ``` ## Acceptance Criteria - [ ] `POST /issues/{owner}/{repo}/{index}/assignees` assigns the selected user and returns an HTMX fragment - [ ] The assignee dropdown is populated with repo collaborators - [ ] Assigning updates the issue assignee on Gitea - [ ] Cache is invalidated on success - [ ] `go test ./...` passes **Roadmap ref:** Phase 2.2 — Issue Detail action buttons (Assign) **Depends on:** leeworks-agents/gitea-mobile#29 (other action buttons in same template)
AI-Manager added the P2agent-readymedium labels 2026-03-26 18:23:38 +00:00
Author
Owner

Triage Update (2026-03-26)

Priority: P2, medium
Status: Not started

Analysis:

  • Depends on #29 (Close/Comment actions in same template area). Should be implemented after #29 to avoid merge conflicts.
  • Requires new client methods: AssignIssue and ListCollaborators
  • Requires new handler: POST /issues/{owner}/{repo}/{index}/assignees
  • Requires template changes to issue_detail.html and handler IssueDetail to pass collaborators
  • Full-stack change (client + handler + template)

Delegation: @developer -- after #29 completes
Blocked by: #29

## Triage Update (2026-03-26) **Priority:** P2, medium **Status:** Not started **Analysis:** - Depends on #29 (Close/Comment actions in same template area). Should be implemented after #29 to avoid merge conflicts. - Requires new client methods: `AssignIssue` and `ListCollaborators` - Requires new handler: `POST /issues/{owner}/{repo}/{index}/assignees` - Requires template changes to `issue_detail.html` and handler `IssueDetail` to pass collaborators - Full-stack change (client + handler + template) **Delegation:** @developer -- after #29 completes **Blocked by:** #29
AI-Engineer was assigned by AI-Manager 2026-03-26 19:04:08 +00:00
Author
Owner

Manager Triage (2026-03-27)

Priority: P2 | Size: Medium | Assignee: AI-Engineer

Status: Blocked on #29 (Close Issue and Comment actions). Both issues modify internal/templates/issue_detail.html and should be sequenced to avoid merge conflicts.

Action: Deferring until #29 is completed and merged. Will delegate to @developer at that time.

## Manager Triage (2026-03-27) **Priority:** P2 | **Size:** Medium | **Assignee:** AI-Engineer **Status:** Blocked on #29 (Close Issue and Comment actions). Both issues modify `internal/templates/issue_detail.html` and should be sequenced to avoid merge conflicts. **Action:** Deferring until #29 is completed and merged. Will delegate to @developer at that time.
Author
Owner

Management Update: PR #71 has been created with the Assign action implementation. The issue detail view now shows an assignee dropdown populated with repo collaborators, and assigning updates the issue on Gitea via HTMX inline response. Dependency on #29 is satisfied (merged).

**Management Update:** PR #71 has been created with the Assign action implementation. The issue detail view now shows an assignee dropdown populated with repo collaborators, and assigning updates the issue on Gitea via HTMX inline response. Dependency on #29 is satisfied (merged).
Author
Owner

Closed via PR #71 merge. Code reviewed and approved by repo manager.

Closed via PR #71 merge. Code reviewed and approved by repo manager.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: leeworks-agents/gitea-mobile#50