Quick-add issues from the panel drawer (#31) #38

Merged
pedromcaraujo merged 2 commits from panel-quick-add into main 2026-08-27 08:49:36 +01:00

Step 4 of #31 — create a Forgejo issue without leaving Forge. With this, #31's acceptance criteria are all met (drawer + read + inject + quick-add + secrets server-side + mobile overlay).

Changes

  • web/panel.py
    • POST /panel/<channel>/issues {title, body} → creates the issue via the write-scoped token, returns {number, title, state, html_url}. Title is required; body optional.
    • The issue-list response gains can_create, derived from the repo's push/admin permission — so a read-only channel simply never shows the form (graceful degradation, as #31 asked).
  • web/index.html — a quick-add form atop the drawer (title required; optional description behind a + description toggle), rendered only when can_create. On submit it POSTs, then refreshes the list in place while keeping the form and its focus, so you can add several in a row; errors surface inline. New CSS reuses the existing theme vars (works in dark/e-ink/light).

No launcher.nix change: the existing /panel/ nginx route already proxies POST.

Verification (read-only; no junk issues created)

  • py_compile + JS parse pass.
  • Ran the updated sidecar against the live Forgejo: GET /panel/forge/issues now returns can_create: true alongside the list.
  • The POST path is structurally verified and mirrors the read calls that already work; it gets exercised on deploy/browser (I intentionally didn't fire a real create to avoid noise issues).

Deploy note

nix-dev pins the forge flake input, so rolling this out is the usual merge → nix flake lock --update-input forge → redeploy cycle (can be bundled with the focus fix #36).

Closes #31.

Step 4 of #31 — create a Forgejo issue without leaving Forge. With this, #31's acceptance criteria are all met (drawer + read + inject + quick-add + secrets server-side + mobile overlay). ## Changes - **`web/panel.py`** - `POST /panel/<channel>/issues` `{title, body}` → creates the issue via the write-scoped token, returns `{number, title, state, html_url}`. Title is required; body optional. - The issue-list response gains **`can_create`**, derived from the repo's `push`/`admin` permission — so a read-only channel simply never shows the form (graceful degradation, as #31 asked). - **`web/index.html`** — a quick-add form atop the drawer (title required; optional description behind a `+ description` toggle), rendered **only when `can_create`**. On submit it POSTs, then refreshes the list **in place** while keeping the form and its focus, so you can add several in a row; errors surface inline. New CSS reuses the existing theme vars (works in dark/e-ink/light). No `launcher.nix` change: the existing `/panel/` nginx route already proxies POST. ## Verification (read-only; no junk issues created) - `py_compile` + JS parse pass. - Ran the updated sidecar against the live Forgejo: `GET /panel/forge/issues` now returns `can_create: true` alongside the list. - The POST path is structurally verified and mirrors the read calls that already work; it gets exercised on deploy/browser (I intentionally didn't fire a real create to avoid noise issues). ## Deploy note nix-dev pins the forge flake input, so rolling this out is the usual merge → `nix flake lock --update-input forge` → redeploy cycle (can be bundled with the focus fix #36). Closes #31.
Quick-add issues from the panel drawer (#31)
All checks were successful
CI / check (pull_request) Successful in 7s
756a81a527
Step 4 of the side panel: create a Forgejo issue without leaving Forge.

- panel.py: POST /panel/<channel>/issues { title, body } creates the issue via
  the write-scoped token and returns its number/url. The issue-list response
  gains a can_create flag (derived from the repo's push/admin permission) so a
  read-only channel simply doesn't show the form.
- index.html: a quick-add form atop the drawer (title required, optional
  description behind a toggle) — shown only when can_create. On submit it POSTs,
  then refreshes the list in place while keeping the form and its focus, so you
  can add several in a row; errors surface inline.

Closes #31 (drawer + read + inject + quick-add). Palette # mode (#37) and
docs/mobile polish remain as follow-ups.
Link the drawer title to the repo's issues page (#31)
All checks were successful
CI / check (pull_request) Successful in 7s
110202637c
The "Issues" heading now links out to Forgejo's issues page for the channel's
repo. The module derives a public `url` (baseUrl/repo/issues) into the panel
descriptor in channels.json — no secret involved — and the drawer renders the
title as a link when it's present, plain text otherwise.
Author
Owner

Added a second commit: the drawer "Issues" title now links to the repo's Forgejo issues page. The module derives a public url (baseUrl/repo/issues) into the channels.json panel descriptor — no secret — and the drawer renders the title as a link when present, plain text otherwise. Verified: JS parse + a build showing url: https://git.rdbytes.pt/pedromcaraujo/forge/issues on a paneled channel, none on a plain one.

Added a second commit: the drawer **"Issues" title now links to the repo's Forgejo issues page**. The module derives a public `url` (`baseUrl/repo/issues`) into the `channels.json` panel descriptor — no secret — and the drawer renders the title as a link when present, plain text otherwise. Verified: JS parse + a build showing `url: https://git.rdbytes.pt/pedromcaraujo/forge/issues` on a paneled channel, none on a plain one.
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
pedromcaraujo/forge!38
No description provided.