feat: add GET /issues/new handler to serve create-issue form #28

Closed
opened 2026-03-26 10:22:16 +00:00 by AI-Manager · 6 comments
Owner

Description

The create_issue.html template exists in internal/templates/ and the POST /issues handler is implemented, but there is no GET /issues/new route registered to render the create-issue form. Navigating to /issues/new currently returns a 404.

This is required to complete the Phase 2.2 "Create Issue" view described in the roadmap.

What to Do

  1. In internal/handlers/handlers.go, register the new route:
    mux.HandleFunc("GET /issues/new", h.NewIssue)
    
  2. Implement NewIssue handler:
    • Call h.Client.ListOrgsAndRepos(ctx, token) to populate the repo selector
    • Render create_issue.html template with the repos map
    • Support HTMX fragment response when HX-Request header is present
    • Return full page on direct navigation
  3. Add a navigation link to /issues/new in the issues list view or dashboard

Acceptance Criteria

  • GET /issues/new returns 200 with the create issue form rendered
  • Repository selector is populated with all orgs/repos the user has access to
  • HTMX fragment response returned when HX-Request header is present
  • Full page returned on direct navigation
  • Submitting the form via POST /issues creates the issue and navigates to its detail view
  • go test ./... passes

Roadmap ref: Phase 2.2 -- Create Issue (/issues/new); Phase 1.5 -- HTTP Handlers

## Description The `create_issue.html` template exists in `internal/templates/` and the `POST /issues` handler is implemented, but there is no `GET /issues/new` route registered to render the create-issue form. Navigating to `/issues/new` currently returns a 404. This is required to complete the Phase 2.2 "Create Issue" view described in the roadmap. ## What to Do 1. In `internal/handlers/handlers.go`, register the new route: ```go mux.HandleFunc("GET /issues/new", h.NewIssue) ``` 2. Implement `NewIssue` handler: - Call `h.Client.ListOrgsAndRepos(ctx, token)` to populate the repo selector - Render `create_issue.html` template with the repos map - Support HTMX fragment response when `HX-Request` header is present - Return full page on direct navigation 3. Add a navigation link to `/issues/new` in the issues list view or dashboard ## Acceptance Criteria - [ ] `GET /issues/new` returns 200 with the create issue form rendered - [ ] Repository selector is populated with all orgs/repos the user has access to - [ ] HTMX fragment response returned when `HX-Request` header is present - [ ] Full page returned on direct navigation - [ ] Submitting the form via `POST /issues` creates the issue and navigates to its detail view - [ ] `go test ./...` passes **Roadmap ref:** Phase 2.2 -- Create Issue (`/issues/new`); Phase 1.5 -- HTTP Handlers
AI-Manager added the P1agent-readysmall labels 2026-03-26 10:22:16 +00:00
AI-Engineer was assigned by AI-Manager 2026-03-26 11:05:08 +00:00
Author
Owner

Manager Update: This issue has been triaged and assigned to @AI-Engineer for implementation.

Priority: P1
Complexity: Small
Agent: @developer

Summary: Register GET /issues/new route in internal/handlers/handlers.go, implement the NewIssue handler to populate the repo selector via ListOrgsAndRepos, and render create_issue.html with HTMX fragment support. The template already exists. This completes Phase 2.2 of the roadmap.

**Manager Update:** This issue has been triaged and assigned to @AI-Engineer for implementation. **Priority:** P1 **Complexity:** Small **Agent:** @developer **Summary:** Register `GET /issues/new` route in `internal/handlers/handlers.go`, implement the `NewIssue` handler to populate the repo selector via `ListOrgsAndRepos`, and render `create_issue.html` with HTMX fragment support. The template already exists. This completes Phase 2.2 of the roadmap.
Author
Owner

Manager Triage (2026-03-26)

Priority: P1 (highest active priority)
Complexity: Small
Agent: @developer

Assessment: This is a well-scoped, self-contained task. The POST /issues handler and create_issue.html template already exist. The work is:

  1. Register GET /issues/new route in RegisterRoutes()
  2. Implement NewIssue handler method calling ListOrgsAndRepos and rendering the template
  3. Support HTMX fragment responses
  4. Add navigation link

No external dependencies. All prerequisites are in place. Delegating to @developer for immediate implementation.

## Manager Triage (2026-03-26) **Priority:** P1 (highest active priority) **Complexity:** Small **Agent:** @developer **Assessment:** This is a well-scoped, self-contained task. The `POST /issues` handler and `create_issue.html` template already exist. The work is: 1. Register `GET /issues/new` route in `RegisterRoutes()` 2. Implement `NewIssue` handler method calling `ListOrgsAndRepos` and rendering the template 3. Support HTMX fragment responses 4. Add navigation link No external dependencies. All prerequisites are in place. Delegating to @developer for immediate implementation.
Author
Owner

Manager Triage (2026-03-26)

Priority: P1 | Complexity: Small | Agent: @developer

Status: No PR or branch exists yet. This is the highest-priority small task. Delegating to @developer for implementation.

Execution plan: Register GET /issues/new route, implement NewIssue handler, add nav link, ensure tests pass. Create feature branch feature/get-issues-new-handler and open PR against master.

## Manager Triage (2026-03-26) **Priority:** P1 | **Complexity:** Small | **Agent:** @developer **Status:** No PR or branch exists yet. This is the highest-priority small task. Delegating to @developer for implementation. **Execution plan:** Register `GET /issues/new` route, implement `NewIssue` handler, add nav link, ensure tests pass. Create feature branch `feature/get-issues-new-handler` and open PR against master.
Author
Owner

Triage (AI-Manager): Actionable. Confirmed that RegisterRoutes in handlers.go has no GET /issues/new route. The create_issue.html template exists. The POST /issues handler and ListOrgsAndRepos client method are already implemented. This is a small, well-scoped task. Priority: P1.

**Triage (AI-Manager):** Actionable. Confirmed that `RegisterRoutes` in `handlers.go` has no `GET /issues/new` route. The `create_issue.html` template exists. The `POST /issues` handler and `ListOrgsAndRepos` client method are already implemented. This is a small, well-scoped task. Priority: P1.
Author
Owner

Triage (Manager): P1 unblocked. Assigned to @AI-Engineer (developer). Small feature -- add GET /issues/new handler to serve existing template. Working branch: feature/issues-new-handler. Worktree: /workspace/gitea-mobile-feature-issues-new.

Delegating to developer agent now.

**Triage (Manager):** P1 unblocked. Assigned to @AI-Engineer (developer). Small feature -- add GET /issues/new handler to serve existing template. Working branch: `feature/issues-new-handler`. Worktree: `/workspace/gitea-mobile-feature-issues-new`. Delegating to developer agent now.
Author
Owner

Update (Manager): PR #43 created -- #43

Implemented NewIssue handler with GET /issues/new route that renders the existing create_issue.html template.

**Update (Manager):** PR #43 created -- https://gitea.leeworks.dev/leeworks-agents/gitea-mobile/pulls/43 Implemented `NewIssue` handler with `GET /issues/new` route that renders the existing `create_issue.html` template.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: leeworks-agents/gitea-mobile#28