Register the PR assignees route pointing to the existing AssignIssue
handler, which works for both issues and PRs via the Gitea API.
Add integration tests covering valid, HTMX, and missing assignee cases.
Closesleeworks-agents/gitea-mobile#228
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Add MergePull() that calls POST /repos/{owner}/{repo}/pulls/{index}/merge
with the specified merge style (merge, rebase, rebase-merge, squash).
Defaults to "merge" if no style specified. Includes unit tests for
success, default style, and error cases.
This is a prerequisite for #177 (merge PR button in UI) and #206
(POST /pulls merge handler).
Closesleeworks-agents/gitea-mobile#187
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Add isTokenError() helper that detects HTTP 401/403 responses from the
Gitea API, and redirectOnTokenError() that redirects to /settings with
an error=token_expired query parameter. Update Dashboard, ListIssues,
and ListPulls handlers to check for token errors. The settings page now
displays an error banner explaining the token needs to be refreshed.
Closesleeworks-agents/gitea-mobile#192
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Update all label spans in issue/PR list and detail templates to use
background-color with the actual hex color from Gitea, replacing the
previous text-color-only styling. Add label-pill CSS class with text
shadow for readability against colored backgrounds.
Closesleeworks-agents/gitea-mobile#193
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Enhance the logging middleware with a randomly generated request-id
(X-Request-ID header) for request tracing, duration in milliseconds
for easier metric aggregation, and user-agent for client identification.
Closesleeworks-agents/gitea-mobile#200
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Replace http.ListenAndServe with http.Server and signal handling to
support graceful shutdown. On SIGTERM or SIGINT, the server drains
in-flight requests with a 15-second timeout before exiting cleanly.
This prevents dropped connections during Kubernetes pod termination.
Closesleeworks-agents/gitea-mobile#201
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Add empty go.sum file (no external dependencies yet) and update the
Dockerfile build stage to COPY go.sum alongside go.mod for reproducible
module downloads. This ensures the Docker build does not fail when Go
requires go.sum to be present.
Closesleeworks-agents/gitea-mobile#203Closesleeworks-agents/gitea-mobile#180
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Add ChangedFile type and GetChangedFiles() method that calls the Gitea
API endpoint GET /repos/{owner}/{repo}/pulls/{index}/files to retrieve
the list of files changed in a pull request. This is a prerequisite for
displaying changed files in the PR detail view (#189).
Includes unit tests for success and error cases.
Closesleeworks-agents/gitea-mobile#205
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The CI workflow previously only triggered on push to master, meaning PRs
were not tested before merge. Add pull_request trigger for the test job
while restricting the Docker build+push job to push events only.
Closesleeworks-agents/gitea-mobile#204
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The triage queue is served at / (the dashboard), not a separate /triage
route. Update Step 7 and the expected results summary table to reference
the correct route, consistent with ROADMAP.md and handlers.go.
Closesleeworks-agents/gitea-mobile#157
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Add a `go vet ./...` step that runs before `go test -race ./...` in the
CI pipeline. This catches format string errors, unreachable code, and
other static analysis issues early.
Verified locally: `go vet ./...` exits 0 with no warnings.
Closesleeworks-agents/gitea-mobile#154
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Add accent color overrides for light mode (better contrast on white bg)
- Add light-mode-specific styles for messages, buttons, type badges
- Document why CSS is ~12KB vs the original ~5KB target (all rules active)
- safe-area-inset and tablet breakpoint already verified present
Closesleeworks-agents/gitea-mobile#119
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Configures air to build ./cmd/server, watch .go/.html/.css/.js files
under the project tree, and auto-restart on changes. Excludes test
files and vendor directories.
Closesleeworks-agents/gitea-mobile#109
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Covers tech stack, project structure, local development with nix develop
and air live reload, environment variables, testing, container build, and
deployment pointer to Talos repo manifests.
Closesleeworks-agents/gitea-mobile#148
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Add 4 new integration-style unit tests for GetTriageQueue using mock
HTTP servers: full integration test verifying issue filtering (assigned
vs unassigned), PR inclusion, and priority sorting; empty orgs test;
all-assigned test (expect empty queue); and label extraction test
verifying multi-label items are correctly populated.
Closesleeworks-agents/gitea-mobile#117
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Add comprehensive integration test suite using httptest with a mock
Gitea API server. Tests cover GET and POST handlers for dashboard,
issues, pulls, issue/PR detail, create issue, state changes, comments,
labels, assignees, reviews, and settings. Both regular and HTMX
request paths are tested. Includes TestMain to set working directory
to project root for template loading.
Covers issues: #140#139#138#137#136#135#134#133#124#118#113#111#110
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Add automatic retry logic to doRequest for HTTP 429 responses. Uses
Retry-After header when present, otherwise exponential backoff
(1s, 2s, 4s). Respects context cancellation during waits. Defaults
to 3 max retries with 1s base delay. Includes 7 new tests covering
retry success, exhaustion, Retry-After header, context cancellation,
non-429 errors, and backoff calculation.
Closesleeworks-agents/gitea-mobile#132
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Add ErrorNotFound and ErrorInternal handler methods that render styled
error pages using the error.html template, with proper status codes,
responsive layout, SVG icons, and HTMX fragment support. Replace the
plain-text http.NotFound call in Dashboard with the new styled handler.
Closesleeworks-agents/gitea-mobile#131
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Add four test functions using httptest.NewServer:
- TestApplyLabel: verifies POST request path, auth header, label IDs
in body, and cache invalidation after success
- TestApplyLabel_Error: verifies 404 error propagation
- TestSubmitReview: verifies POST path, event/body fields, and cache
invalidation after success
- TestSubmitReview_Error: verifies 422 error propagation
Closesleeworks-agents/gitea-mobile#127
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Move the large inline HTML template from settings.go into a separate
file at internal/templates/settings.html, matching the project convention
used by all other handlers. The template is now loaded at render time
via template.ParseFiles, consistent with dashboard, issues, etc.
Closesleeworks-agents/gitea-mobile#126
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Update Auth middleware to accept a fallbackToken parameter. When no
per-user cookie token is present and GITEA_TOKEN is set in the
environment, the middleware uses the env token instead of redirecting
to /settings. Cookie tokens still take precedence over the fallback.
Add three new unit tests covering: fallback used when no cookie,
cookie takes precedence over fallback, and redirect when neither is set.
Closesleeworks-agents/gitea-mobile#125
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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 grid layout at >= 640px breakpoint for #issue-list and #pull-list
containers, matching the existing .card-grid tablet behavior. Cards
render in a 2-column grid on tablet while maintaining single-column
on mobile.
Closesleeworks-agents/gitea-mobile#105
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The aggregation layer uses sync.RWMutex and errgroup for concurrent
API fan-out. Enable the Go race detector in CI to catch data races
early.
Closesleeworks-agents/gitea-mobile#103
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>