Commit Graph

111 Commits

Author SHA1 Message Date
AI-Manager f464e11b00 Merge pull request 'feat: implement Gitea aggregation layer with concurrent fetching' (#11) from feature/gitea-aggregation into master 2026-03-26 05:04:46 +00:00
AI-Manager 24b44debf0 Merge pull request 'feat: add env-based configuration and token-in-cookie auth' (#10) from feature/config-auth into master 2026-03-26 05:04:23 +00:00
agent-company 81496c775e feat: implement mobile-first HTMX templates and CSS
Build all frontend views using Go html/template with HTMX interactions
and mobile-first CSS with dark mode and iPhone safe areas.

Templates:
- layout.html: base layout with fixed bottom nav (Dashboard, Issues, PRs, Settings)
- dashboard.html: card-based triage view with priority indicators
- issues.html: issue list with filter bar (org, state) and infinite scroll
- pulls.html: PR list with diff stats and merge status
- issue_detail.html: issue detail with comments, label assignment
- pull_detail.html: PR detail with diff stats and review form
- create_issue.html: issue creation form with searchable repo selector

CSS (static/style.css):
- Mobile-first dark mode with CSS variables
- iPhone safe areas via env(safe-area-inset-bottom)
- Responsive: 2-column grid at 640px+ breakpoint
- Light mode support via prefers-color-scheme
- Card, label, badge, form, button component styles
- HTMX loading indicator and spinner animation
- Reduced motion support

HTMX patterns:
- hx-get with hx-target for SPA-like navigation
- hx-trigger="revealed" for infinite scroll
- hx-post with hx-swap for inline form actions
- Filter bar with hx-trigger="change" and hx-include

Closes leeworks-agents/gitea-mobile#5

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-26 04:15:06 +00:00
agent-company 712dc5632c feat: add PWA manifest and service worker
Add Progressive Web App support for installable mobile experience
on iOS Safari and Android Chrome.

- static/manifest.json: app name, standalone display, dark theme,
  icon references for 192px and 512px
- static/sw.js: service worker with cache-first strategy for static
  assets, network-first for HTML/HTMX, offline fallback to cache
- static/icon-192.png, static/icon-512.png: placeholder app icons
- Apple meta tags: apple-mobile-web-app-capable, status bar style,
  apple-touch-icon for iOS Add to Home Screen
- Service worker registration in base layout template

Closes leeworks-agents/gitea-mobile#6

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-26 04:12:20 +00:00
agent-company 86173b61eb feat: add Dockerfile and CI workflow
Add multi-stage Dockerfile producing a minimal distroless image and
Gitea Actions CI workflow for automated testing and image publishing.

- Dockerfile: multi-stage build (golang:1.22-alpine -> distroless/static)
  with stripped binary (~15-20MB image), runs as nonroot user
- .dockerignore: excludes .git, docs, nix files from build context
- .gitea/workflows/build.yaml: CI pipeline that runs tests, builds
  Docker image, and pushes to Gitea registry with timestamp+SHA tags
  for Flux image automation

Closes leeworks-agents/gitea-mobile#7

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-26 04:10:59 +00:00
agent-company 17ca1f6e6c feat: add HTTP handlers and health endpoint
Implement all HTTP handlers using Go 1.22+ stdlib ServeMux with
HTMX fragment vs full-page response detection.

- internal/handlers/handlers.go: all route handlers
  - GET /health returns 200 for K8s probes
  - GET / dashboard with triage queue from aggregation layer
  - GET /issues lists all issues across orgs
  - GET /pulls lists all PRs across orgs
  - POST /issues creates issue via aggregation layer
  - POST /issues/{owner}/{repo}/{index}/labels assigns labels
  - POST /pulls/{owner}/{repo}/{index}/review submits PR review
  - HX-Request header detection for HTMX fragment vs full page
  - Mobile-first dark theme base layout with bottom navigation
- cmd/server/main.go: refactored to use centralized route registration
- internal/handlers/handlers_test.go: unit tests for health, dashboard,
  HTMX detection, input validation

Closes leeworks-agents/gitea-mobile#4

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-26 04:10:03 +00:00
agent-company e1e7aa64ca feat: implement Gitea aggregation layer with concurrent fetching
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

Closes leeworks-agents/gitea-mobile#3

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-26 04:07:43 +00:00
agent-company 703b2fafb0 feat: add env-based configuration and token-in-cookie auth
Implement 12-factor configuration via environment variables and
token-in-cookie authentication for Gitea API access.

- internal/config/config.go: reads GITEA_URL, GITEA_TOKEN, LISTEN_ADDR,
  SESSION_SECRET from environment with validation
- internal/auth/cookie.go: HMAC-signed HTTP-only cookie for storing
  Gitea API tokens (Secure, SameSite=Strict)
- internal/middleware/auth.go: extracts token from cookie, injects into
  request context, redirects unauthenticated users to /settings
- internal/middleware/logging.go: structured JSON request logging
- internal/handlers/settings.go: settings page for entering/removing
  Gitea API token with mobile-first dark UI
- cmd/server/main.go: integrated config, auth middleware, and settings

Includes unit tests for config loading, cookie signing/verification,
and auth middleware bypass/redirect logic.

Closes leeworks-agents/gitea-mobile#2

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-26 04:05:31 +00:00
AI-Manager 69a1ab86c2 Merge pull request 'feat: scaffold Go project with flake.nix and directory structure' (#9) from feature/scaffold-project into master 2026-03-26 02:47:43 +00:00
agent-company c64d61d78e feat: scaffold Go project with flake.nix and directory structure
- 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

Closes leeworks-agents/gitea-mobile#1

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-26 00:06:09 +00:00
0xWheatyz e93bb7e01c docs: add project roadmap for gitea mobile PWA
Covers three phases: Go backend with Gitea SDK aggregation layer,
HTMX mobile-first frontend with PWA support, and Docker/Kubernetes
deployment to Talos via FluxCD.
2026-03-24 22:25:13 -04:00