Add a PRs tab to the forgejo panel drawer #44

Merged
pedromcaraujo merged 1 commit from pr-tabs-in-drawer into main 2026-09-17 08:57:57 +01:00

Closes #39.

The per-channel drawer listed a repo's open issues; this adds its open pull requests alongside them as a second tab. Tabs sit at the top of the panel, each with a live open-count, over the same accordion — a PR row is an issue row plus a draft marker and PR-flavoured inject text (look at PR #N: …). Active tab is remembered per channel; the drawer title link follows the active tab.

Changes

  • Sidecar (web/panel.py): new read-only GET /panel/<ch>/pulls and /pulls/<n>, sharing the issue detail's markdown-render + URL-rewrite path via a _detail_payload helper. PR detail also carries base/head/mergeable/draft.
  • Module (modules/forge.nix, modules/launcher.nix): the panel type enum gains "forgejo" (issues + PRs); the former "forgejo-issues" stays an accepted alias, so existing channel configs keep working with nothing to migrate. The title link's url is now the repo root so the frontend appends /issues or /pulls per active tab.
  • Frontend (web/index.html): renderForgejo paints the two tabs; quick-add stays on the Issues tab only. A failed /pulls fetch degrades to an empty list rather than breaking the drawer.

Deferred

  • CI status dots on PR rows (would add one /commits/{sha}/status call per PR). Follow-up if wanted.

Test plan

  • python -m py_compile web/panel.py
  • node --check on the extracted <script>
  • nix-instantiate --parse on both modules
  • Eyeball the tabs after deploy (sidecar route + nginx are deploy-time wiring)
Closes #39. The per-channel drawer listed a repo's open issues; this adds its open **pull requests** alongside them as a second tab. Tabs sit at the top of the panel, each with a live open-count, over the same accordion — a PR row is an issue row plus a `draft` marker and PR-flavoured inject text (`look at PR #N: …`). Active tab is remembered per channel; the drawer title link follows the active tab. ## Changes - **Sidecar (`web/panel.py`):** new read-only `GET /panel/<ch>/pulls` and `/pulls/<n>`, sharing the issue detail's markdown-render + URL-rewrite path via a `_detail_payload` helper. PR detail also carries `base`/`head`/`mergeable`/`draft`. - **Module (`modules/forge.nix`, `modules/launcher.nix`):** the panel `type` enum gains `"forgejo"` (issues + PRs); the former `"forgejo-issues"` stays an accepted **alias**, so existing channel configs keep working with nothing to migrate. The title link's `url` is now the repo root so the frontend appends `/issues` or `/pulls` per active tab. - **Frontend (`web/index.html`):** `renderForgejo` paints the two tabs; quick-add stays on the Issues tab only. A failed `/pulls` fetch degrades to an empty list rather than breaking the drawer. ## Deferred - CI status dots on PR rows (would add one `/commits/{sha}/status` call per PR). Follow-up if wanted. ## Test plan - [x] `python -m py_compile web/panel.py` - [x] `node --check` on the extracted `<script>` - [x] `nix-instantiate --parse` on both modules - [ ] Eyeball the tabs after deploy (sidecar route + nginx are deploy-time wiring)
Add a PRs tab to the forgejo panel drawer (#39)
All checks were successful
CI / check (pull_request) Successful in 7s
8347c10119
The per-channel drawer listed open issues; add open pull requests alongside
them as a second tab. Tabs sit at the top of the panel, each with a live
open-count, over the shared accordion — a PR row is an issue row plus a draft
marker and PR-flavoured inject text ("look at PR #N: …").

- Sidecar: new read-only GET /panel/<ch>/pulls and /pulls/<n>, sharing the
  issue detail's markdown-render + URL-rewrite path via a _detail_payload
  helper. PR detail also carries base/head/mergeable/draft.
- Module: the panel `type` enum gains "forgejo" (issues + PRs); the old
  "forgejo-issues" stays an accepted alias, and the title link's `url` is now
  the repo root so the frontend can append /issues or /pulls per active tab.
- Frontend: renderForgejo paints the two tabs; the active tab is remembered
  per channel. Quick-add stays on the Issues tab only. A failed PR fetch
  degrades to an empty list rather than breaking the drawer.

CI status dots on PR rows are deferred (one extra status call per PR).
pedromcaraujo deleted branch pr-tabs-in-drawer 2026-09-17 08:57:57 +01:00
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!44
No description provided.