Add comprehensive unit tests using mock HTTP servers for four key
aggregation methods in the Gitea client. Tests cover correct API
integration, caching behavior, sorting, state filtering, repo
filtering, pagination, and label handling.
Closesleeworks-agents/gitea-mobile#122Closesleeworks-agents/gitea-mobile#121
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Add per-PR review state aggregation by fetching reviews concurrently
via the existing semaphore pattern. Display review status (approved,
changes requested, awaiting) and merge status (ready/conflicts) as
compact badges in each PR card row.
- Add ReviewState field to PullRequest struct
- Add GetPullReviewState() and EnrichPullsWithReviewState() to client
- Call enrichment in ListPulls handler after fetching PRs
- Update pulls template with review and merge badges
- Add CSS for .review-badge and .merge-badge classes
Closesleeworks-agents/gitea-mobile#97
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Add a repo dropdown to the filter bar that appears when an org is
selected. The dropdown lists all repos in the selected org and
filters issues/pulls to the chosen repo. Changing the org resets
the repo filter. Infinite scroll preserves the repo filter.
Closesleeworks-agents/gitea-mobile#83
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Add a label text input to the filter bar on both issues and pulls
list views. The filter is passed through to the Gitea API's native
labels query parameter for server-side filtering. Infinite scroll
preserves the label filter across page loads.
Closesleeworks-agents/gitea-mobile#82
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Add the ability to assign users to issues from the mobile app:
- New ListCollaborators client method fetches repo collaborators
- New AssignIssue client method sets assignees via PATCH API
- New POST /issues/{owner}/{repo}/{index}/assignees handler
- Assignee dropdown populated with repo collaborators in issue detail
- HTMX inline response confirms assignment without page reload
Closesleeworks-agents/gitea-mobile#50
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Update ListAllIssues and ListAllPullRequests to accept state and page
parameters, returning paginated results (20 per page) with HasMore
metadata. ListIssues and ListPulls handlers now read page, org, and
state query params; HTMX requests for page > 1 return only card HTML
fragments for seamless infinite scroll. Both templates extract a
reusable "cards" block and pulls.html gains a scroll sentinel matching
the existing issues.html pattern. Filter changes reset to page 1.
Closesleeworks-agents/gitea-mobile#32
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Add SetIssueState client method and handler for toggling issue state
between open and closed via PATCH API. Add AddComment client method
wrapping PostComment. Register new routes POST /issues/{owner}/{repo}/{index}/state
and POST /issues/{owner}/{repo}/{index}/comments. Update issue_detail.html
template with comment form (HTMX inline append) and close/reopen button
(HTMX inline swap of state badge).
Closesleeworks-agents/gitea-mobile#29
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Add RenderMarkdown method to gitea client that calls POST /api/v1/markdown
to convert raw markdown text to safe HTML. Wire it into IssueDetail and
PullDetail handlers to render body content as formatted markdown.
Falls back gracefully to plain text if the API call fails.
Templates updated to use RenderedBody (template.HTML) with fallback
to raw Issue.Body/Pull.Body when rendering fails.
Closesleeworks-agents/gitea-mobile#35
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Add CloseIssue (PATCH state=closed) and PostComment (POST comment body)
methods to the Gitea client with cache invalidation. Add corresponding
handler routes POST /issues/{owner}/{repo}/{index}/close and
POST /issues/{owner}/{repo}/{index}/comment with HTMX support.
Include unit tests for both client methods.
Closesleeworks-agents/gitea-mobile#36
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Add GET /issues/{owner}/{repo}/{index} and GET /pulls/{owner}/{repo}/{index}
routes that fetch individual issues/PRs from the Gitea API and render them
using the existing issue_detail.html and pull_detail.html templates.
New client methods:
- GetIssue: fetch a single issue by owner/repo/index
- GetPull: fetch a single pull request by owner/repo/index
- GetIssueComments: fetch comments for an issue
- GetRepoLabels: fetch available labels for a repository
Both handlers support HTMX fragment responses and full-page rendering,
consistent with the existing handler pattern.
Closesleeworks-agents/gitea-mobile#24
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Add core aggregation layer wrapping the Gitea API for fan-out
concurrent fetching across repos and organizations with caching.
- internal/gitea/client.go: Gitea API client with aggregation
- ListOrgs/ListOrgRepos/ListOrgsAndRepos for org enumeration
- ListAllIssues: concurrent fetch across repos via goroutines with semaphore (5)
- ListAllPullRequests: same pattern for PRs
- GetTriageQueue: unassigned issues + open PRs, sorted by priority
- CreateIssue, ApplyLabel, SubmitReview: write operations with cache invalidation
- In-memory cache with 30s TTL using sync.RWMutex
- internal/gitea/client_test.go: unit tests for caching, priority scoring,
API calls with httptest server, and triage queue sorting
Closesleeworks-agents/gitea-mobile#3
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Initialize go.mod with gitea.leeworks.dev/0xwheatyz/gitea-mobile
- Create directory structure: cmd/server/, internal/{config,gitea,handlers,middleware,templates}/, static/
- Add minimal HTTP server with /health and / endpoints
- Add flake.nix with Go toolchain, gopls, and air for live reload
Closesleeworks-agents/gitea-mobile#1
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>