Terminal PRs (merged/closed) show a merged/closed status in the sidebar instead of the Review Summary, and hide the moot Mergeability section #602

Closed
opened 2026-09-15 21:29:00 +00:00 by crueber · 1 comment
Owner

Terminal PRs (merged/closed) show a merged/closed status in the sidebar instead of the Review Summary, and hide the moot Mergeability section

What's requested

On a terminal PR — pr().merged true, or state closed without merge — the right-hand sidebar should stop showing the review-workflow sections, which are meaningless once the PR can no longer change state:

  1. Replace the "Review summary" section with a merged/closed status section. The header badge (pullBadgeView, web/src/lib/pull-state.js:52) already surfaces Merged/Closed at the top of the page, but the sidebar still leads with "Review summary" — a verdict snapshot derived client-side that can only mislead on a terminal PR (e.g. a "stale" marker or REVIEW_REQUIRED chip on a PR that was already merged). In its place show a terminal-state section in the same idiom: uppercase micro-label (e.g. "Status") with the terminal state as the VALUE line — "Merged" via the existing chip-merged class for merged PRs (the merge strategy + merge commit SHA are available from the merged event / pullEventText, see pull-state.js:82-83), "Closed" via the existing chip-closed styling for plain-closed PRs.
  2. Hide the "Mergeability" section on terminal PRs. For a merged PR it renders the muted "Already merged" line (mergeabilityDisplay, pull-state.js:174-175) plus base/head SHAs and commits/files links; for a closed-unmerged PR it shows a mergeable assessment that no longer matters. None of this has action value once the PR is terminal — drop the whole Mergeability section (the <div class="grid gap-1 p-3"> block at web/src/pages/Pull.jsx:1372-1412) when pr().merged || pr().state === "closed".

Keep both sections exactly as-is for open PRs — this change is strictly a terminal-state branch.

Evidence (static read; no local repro)

  • web/src/pages/Pull.jsx:1366-1412 — the sidebar (<aside aria-label="Details">, one divide-y card) renders "Review summary" first, then "Mergeability", unconditionally; there is no terminal-state branch.
  • web/src/pages/Pull.jsx:95-131 — ReviewSummaryBar derives the verdict and "(stale)" markers purely client-side from summary() + head SHA; on a merged PR this displays a stale review snapshot as the sidebar's first section.
  • web/src/lib/pull-state.js:52-53, 99 — pullBadgeView already knows pr?.merged → "Merged" / chip-merged; :174-175 — mergeability already maps merged → "Already merged" muted, i.e. the data for a terminal status section is already in the client payload. No new wire data needed.
  • Sibling tickets #594 (comment locking on terminal PRs) and #599 (reviewer-request blocking on terminal PRs) cover the other terminal-PR interactions; this ticket covers the sidebar display only.

Architecture notes

  • Everything needed lives client-side: pr().merged, pr().state, and the merged event (ThreadTimeline already renders merged as <sha> (<strategy>) via pullEventText). Pure UI branching in Pull.jsx; possibly one small helper in web/src/lib/pull-state.js alongside pullBadgeView/pullCloseVisibility if the terminal status view is shared/tested.
  • Follow the existing sidebar idiom (Forgejo #531): ONE divide-y card, each section a p-3 block with the uppercase micro-label above its value — the new status section replaces the Review summary slot in the same shape, no new card chrome.
  • Tailwind utilities only; reuse chip-merged / chip-closed rather than new styles.

Acceptance criteria

  • Merged PR: sidebar shows a status section ("Merged" chip, with merge commit SHA / strategy as secondary detail), no Review summary section, no Mergeability section.
  • Closed (unmerged) PR: sidebar shows "Closed" status; Review summary and Mergeability hidden.
  • Open PR: sidebar unchanged (Review summary first, Mergeability present).
  • Reviewers and Checks sections continue to render for terminal PRs (not in scope to hide).
  • No new wire fields or API changes; Tailwind-only styling, existing chip classes reused.
# Terminal PRs (merged/closed) show a merged/closed status in the sidebar instead of the Review Summary, and hide the moot Mergeability section ## What's requested On a **terminal** PR — `pr().merged` true, or state `closed` without merge — the right-hand sidebar should stop showing the review-workflow sections, which are meaningless once the PR can no longer change state: 1. **Replace the "Review summary" section with a merged/closed status section.** The header badge (`pullBadgeView`, `web/src/lib/pull-state.js:52`) already surfaces Merged/Closed at the top of the page, but the sidebar still leads with "Review summary" — a verdict snapshot derived client-side that can only mislead on a terminal PR (e.g. a "stale" marker or `REVIEW_REQUIRED` chip on a PR that was already merged). In its place show a terminal-state section in the same idiom: uppercase micro-label (e.g. "Status") with the terminal state as the VALUE line — "Merged" via the existing `chip-merged` class for merged PRs (the merge strategy + merge commit SHA are available from the merged event / `pullEventText`, see `pull-state.js:82-83`), "Closed" via the existing `chip-closed` styling for plain-closed PRs. 2. **Hide the "Mergeability" section on terminal PRs.** For a merged PR it renders the muted "Already merged" line (`mergeabilityDisplay`, `pull-state.js:174-175`) plus base/head SHAs and commits/files links; for a closed-unmerged PR it shows a mergeable assessment that no longer matters. None of this has action value once the PR is terminal — drop the whole `Mergeability` section (the `<div class="grid gap-1 p-3">` block at `web/src/pages/Pull.jsx:1372-1412`) when `pr().merged || pr().state === "closed"`. Keep both sections exactly as-is for **open** PRs — this change is strictly a terminal-state branch. ## Evidence (static read; no local repro) - `web/src/pages/Pull.jsx:1366-1412` — the sidebar (`<aside aria-label="Details">`, one divide-y card) renders "Review summary" first, then "Mergeability", unconditionally; there is no terminal-state branch. - `web/src/pages/Pull.jsx:95-131` — `ReviewSummaryBar` derives the verdict and "(stale)" markers purely client-side from `summary()` + head SHA; on a merged PR this displays a stale review snapshot as the sidebar's first section. - `web/src/lib/pull-state.js:52-53, 99` — `pullBadgeView` already knows `pr?.merged` → "Merged" / `chip-merged`; `:174-175` — mergeability already maps `merged` → "Already merged" muted, i.e. the data for a terminal status section is already in the client payload. No new wire data needed. - Sibling tickets #594 (comment locking on terminal PRs) and #599 (reviewer-request blocking on terminal PRs) cover the other terminal-PR interactions; this ticket covers the sidebar display only. ## Architecture notes - Everything needed lives client-side: `pr().merged`, `pr().state`, and the merged event (`ThreadTimeline` already renders `merged as <sha> (<strategy>)` via `pullEventText`). Pure UI branching in `Pull.jsx`; possibly one small helper in `web/src/lib/pull-state.js` alongside `pullBadgeView`/`pullCloseVisibility` if the terminal status view is shared/tested. - Follow the existing sidebar idiom (Forgejo #531): ONE divide-y card, each section a `p-3` block with the uppercase micro-label above its value — the new status section replaces the Review summary slot in the same shape, no new card chrome. - Tailwind utilities only; reuse `chip-merged` / `chip-closed` rather than new styles. ## Acceptance criteria - [ ] Merged PR: sidebar shows a status section ("Merged" chip, with merge commit SHA / strategy as secondary detail), no Review summary section, no Mergeability section. - [ ] Closed (unmerged) PR: sidebar shows "Closed" status; Review summary and Mergeability hidden. - [ ] Open PR: sidebar unchanged (Review summary first, Mergeability present). - [ ] Reviewers and Checks sections continue to render for terminal PRs (not in scope to hide). - [ ] No new wire fields or API changes; Tailwind-only styling, existing chip classes reused.
crueber added this to the v1 milestone 2026-09-15 21:29:07 +00:00
Author
Owner

Fixed by #609 (merged): terminal PRs show a Status section (Merged chip + SHA/strategy/by with commit link, or Closed chip) replacing Review summary, and the Mergeability section hides; open PRs byte-identical; Reviewers/Checks/Merge untouched. Verified: 1561 unit green (smoke excluded, pre-existing), vite/esbuild green, independent review APPROVE.

Fixed by #609 (merged): terminal PRs show a Status section (Merged chip + SHA/strategy/by with commit link, or Closed chip) replacing Review summary, and the Mergeability section hides; open PRs byte-identical; Reviewers/Checks/Merge untouched. Verified: 1561 unit green (smoke excluded, pre-existing), vite/esbuild green, independent review APPROVE.
Sign in to join this conversation.
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
crueber/walhub#602
No description provided.