feat(phase 3h gitea writeback): close/reopen/comment/create from projax

- gitea pkg: CloseIssue, ReopenIssue, CreateIssue, AddComment + ErrForbidden
  classification on 401/403. Client.do sets Content-Type on non-empty bodies.
- web handler: POST /i/{path}/issues/{close|reopen|comment|create}
  - authorisation guard: repo form value must match a gitea-repo item_link
    on the target item (rejects form-crafted writes to unrelated repos)
  - HTMX re-renders issues_section partial after each action
  - busts gitea per-repo cache (open + closed-recent) and dashboard 60s TTL
- templates: ✓ close button + reopen + collapsible comment box on every
  issue row; "+ new issue" disclosure per repo
- design.md §6 retitled "Phase 2.d read; 3h writeback" with auth/perm
  semantics + parked list
- 5 unit tests in gitea/, 5 integration tests in web/ covering happy paths
  + 403 → inline banner fallback
This commit is contained in:
mAi
2026-05-15 19:22:11 +02:00
parent b159a7dc01
commit 5a56ad91e5
11 changed files with 788 additions and 5 deletions

View File

@@ -252,3 +252,21 @@ table.bulk .chip-add input { padding: 1px 4px; font-size: 0.85em; width: 7em; }
.dashboard .stale-row:last-child { border-bottom: none; }
.dashboard .stale-row .repo { font-family: ui-monospace, SFMono-Regular, monospace; font-size: 0.85em; }
.dashboard .stale-row .last-active { color: var(--warn); font-size: 0.9em; }
/* --- Issues writeback (3h) --- */
.issues .new-issue { margin: 8px 0; }
.issues .new-issue-form, .issues .comment-form {
display: flex; flex-direction: column; gap: 4px; padding: 6px 0;
}
.issues .new-issue-form input[name=title] { width: 100%; }
.issues .new-issue-form textarea, .issues .comment-form textarea {
width: 100%; resize: vertical; font-family: inherit; padding: 4px;
}
.issues .issue-row form { display: inline-flex; align-items: center; margin-left: 4px; }
.issues .issue-row form button {
background: transparent; border: 1px solid var(--border); border-radius: 3px;
padding: 1px 6px; cursor: pointer; color: var(--muted); font-size: 0.85em;
}
.issues .issue-close button:hover { color: var(--ok); border-color: var(--ok); }
.issues .issue-reopen button:hover { color: var(--warn); border-color: var(--warn); }
.issues .issue-comment summary { font-size: 0.85em; cursor: pointer; }