Fix #34: empty-state callouts + dynamic open-PR page #46

Merged
crueber merged 1 commit from fix/issue-34 into main 2026-09-04 17:51:55 +00:00
Owner

Fixes #34, two parts:

1. Empty states. The bare No … fallback lines on Pulls, Checks, Releases (and Issues, same pattern — scope noted) become a shared centered callout: web/src/components/Empty.jsx (icon/title/hint/action composition, generous padding, dashed panel via new .empty-* classes in ui.css). Actions are router links (keyboard-focusable, global :focus-visible ring); the region is role=status.

2. Open-PR flow. The cramped 'Open a pull request' sidebar box on the pulls list is deleted — opening happens only on the full /pulls/new page (the list's 'New pull request' button links there, carrying ?base=/ ?head= filters as composer prefill). The composer is now dynamic: 300ms after the last picker keystroke it fetches both histories (commits?ref=, n=100, parallel, one AbortController per debounced run with stale-run drop) and intersects them via headless-testable web/src/lib/compare.js (merge-base approximated by history intersection; ahead/behind exact inside the window, + lower bounds only past a more window). Title prefills from the head-tip subject, body from the head-only subjects (both until the user edits); swap-base/head button included. Deliberately no server compare endpoint (decision appended to docs/go/12_web_ui.md).

Verification (real browser, headless Chromium over CDP against this branch's binary): pulls empty (dark+light) with sidebar gone and CTA href; pulls non-empty; composer prefilled via ?head= showing exact '2 ahead · 0 behind' → '2 ahead · 1 behind' after main moved, swap symmetry ('1 ahead · 2 behind'), and a real submit landing on /pull/2; checks/releases/issues empties; zero console errors everywhere. node --test web/test/unit/*.test.js: 201/201 green (11 new compare tests). make web + go build clean.

Notes: releases page logs one 404 for api/releases/latest with zero releases — pre-existing control flow (caught → null), untouched. Issues empty state included as same-pattern scope; say so if you want it split out.

Fixes #34, two parts: **1. Empty states.** The bare `No …` fallback lines on Pulls, Checks, Releases (and Issues, same pattern — scope noted) become a shared centered callout: `web/src/components/Empty.jsx` (icon/title/hint/action composition, generous padding, dashed panel via new `.empty-*` classes in ui.css). Actions are router links (keyboard-focusable, global :focus-visible ring); the region is `role=status`. **2. Open-PR flow.** The cramped 'Open a pull request' sidebar box on the pulls list is deleted — opening happens only on the full `/pulls/new` page (the list's 'New pull request' button links there, carrying `?base=/ ?head=` filters as composer prefill). The composer is now dynamic: 300ms after the last picker keystroke it fetches both histories (`commits?ref=`, n=100, parallel, one AbortController per debounced run with stale-run drop) and intersects them via headless-testable `web/src/lib/compare.js` (merge-base approximated by history intersection; ahead/behind exact inside the window, `+` lower bounds only past a `more` window). Title prefills from the head-tip subject, body from the head-only subjects (both until the user edits); swap-base/head button included. Deliberately no server compare endpoint (decision appended to docs/go/12_web_ui.md). **Verification (real browser, headless Chromium over CDP against this branch's binary):** pulls empty (dark+light) with sidebar gone and CTA href; pulls non-empty; composer prefilled via `?head=` showing exact '2 ahead · 0 behind' → '2 ahead · 1 behind' after main moved, swap symmetry ('1 ahead · 2 behind'), and a real submit landing on /pull/2; checks/releases/issues empties; zero console errors everywhere. `node --test web/test/unit/*.test.js`: 201/201 green (11 new compare tests). `make web` + `go build` clean. **Notes:** releases page logs one 404 for `api/releases/latest` with zero releases — pre-existing control flow (caught → null), untouched. Issues empty state included as same-pattern scope; say so if you want it split out.
Sign in to join this conversation.
No description provided.