Skip to content

Pull requests overview: where the org's pull requests wait, for whom, and whether that's usual - #546

Merged
coderhelm[bot] merged 15 commits into
mainfrom
prs-overview
Dec 5, 2026
Merged

coderhelm[bot] merged 15 commits into
mainfrom
prs-overview

Conversation

@nambok

@nambok nambok commented Dec 5, 2026

Copy link
Copy Markdown
Collaborator

Summary

Pull requests now opens on an Overview tab, with the per-PR List beside it. One page shows where the org's pull requests wait, for whom, whether that is usual for the org, and what stalled, broke, went unreviewed or is past a deadline. Every number covers every pull request in the installed repos (people's, CoderHelm's, Dependabot's and other bots'). CoderHelm's pull requests are one slice, in their own panel.

The page reads GET /api/prs/overview from CoderHelm/coderhelm-platform#988 and builds on the List from #544.

Screenshots, all invented data (the acme bookstore):

The overview at 1440, first screen

A slipping week: verdict, three tiles, ranked items with owners

A quiet week says what was checked

One repo, with its flow by stage and cycle-time scatter

Panels and phone

Stale

Failures and incidents

Review health

Security and policy

This week's events

Phone, 375

Changes

  • Tabs: Overview (/prs/overview, the default) and List (/prs), using the existing section tabs.

  • Summary:

    • A verdict word (Healthy, At risk, Slipping or Quiet). The sentence starts with the reason and the rule is under View source.
    • Three fixed tiles: Stale, Failures and Reviewed. The Stale tile is the same number as the Stale panel's top line.
    • Up to five ranked "Needs attention" lines, each with an owner and an age. A line with no owner says why.
    • What changed, plus a stability line and a CoderHelm line that always appear.
    • A quiet state that says what was checked.
    • Window and computed time in the readable weekday format. Every number links to what produced it.
  • Strip: six stages with week-over-week change, an 8-week line and past-p85 counts, the whose-turn line, and a condition row (stale, abandoned, zombie, drift, blocked by main). A cell opens the List filtered to it: the List now reads stage= and past= and shows them as clearable chips.

  • Aging chart: plain SVG with no new library. One mark per PR: a hexagon for CoderHelm, a circle for people, a square for other bots. Idle PRs are hollow and PRs blocked by a red main are ringed. It draws the p50, p85 and p95 lines with labeled external bands, has drag-to-select with a sentence about what the selection has more of, and a mark click opens the PR's detail.

  • Repo table: obligations first, with these columns:

    • past usual;
    • stale and abandoned;
    • first human review p50/p85;
    • human-reviewed %;
    • CI first try;
    • flags;
    • health, with the roll-up rule printed.

    A row opens the same overview for that repo, which adds the flow by stage over 12 weeks and a cycle-time scatter.

  • Panels: Stale, Failures and incidents, Review health, Security and policy, and This week's events.

  • CoderHelm panel: author, fixer and reviewer outcomes, runs in exactly one end state, and exceptions. No line counts.

  • Phone: summary first, the strip as a grid, the PRs past usual as a list, one sentence per panel that opens it, then the repos.

  • States: loading outline, empty, error with retry, the 404 fallback for older backends, "not enough history yet" or "not recorded yet" wherever data isn't there, and backfill progress ("12 of 40 repos read").

  • Theme: colours are the design system's dark tokens, and every colour is paired with a label or a shape.

  • Docs: getting-started/pull-requests-overview. It covers each section, every metric's definition and threshold rule (own-history percentiles, the 30-merge minimum, the 10-event floor), the stale states, the five coverage states, the security deadline defaults, and that digests and nudges are opt-in and not sent yet. It uses screenshots of invented acme data.

Verification

  • npm run lint (UI lint, no hosted links, fixture words), npm run typecheck and npm run check:openapi all pass.
  • Full Playwright on the static build (E2E_STATIC=1, the CI setup), after merging main (A Pull requests page: every open pull request, grouped by whose turn it is #544 and On a phone, the dashboard opens on an Inbox of decisions: Inbox, Runs, PRs, Chat and Menu #545): 2,263 passed, 29 skipped. Three tests failed only while a screenshot run shared the test-results folder, and all 39 tests in those specs pass when rerun alone. An earlier full run found five failures, all fixed here:
    • the new page's link-preview description was too long;
    • the sideways-scroll suite needs wide data for the new route;
    • the alert page's "Pull request" link, which now has to be matched exactly because the menu has a "Pull requests" entry.
  • e2e/prs-overview.spec.ts, 20 tests:
    • every summary section, the five example weeks and a quiet week;
    • the strip, past-p85 and repo drill-down links into the List, and an aging mark opening the PR;
    • the five panels, including the Stale tile equalling the Stale panel's headline;
    • an org with no CoderHelm PRs;
    • "not enough history yet" and backfill progress;
    • no person's name outside an item's owner;
    • the 404 fallback, error with retry, loading and empty states;
    • no sideways scroll at 320 and 375.
  • Docs prose tests (node --test scripts/prose.test.mjs) pass.

nambok and others added 15 commits December 5, 2026 11:52
…it is

The new top-level page (/prs) lists every open pull request in the team's
installed repos, people's and CoderHelm's, grouped by who has the next move
(you, CoderHelm, a person, machines, done). Each row says the one state the
server decided and the sentence of what it needs and from whom, with the
rule it comes from. CoderHelm shows with its own hexagon face, an AI label
and the person it works for.

The detail opens beside the list on a wide screen and over it otherwise
(full screen on a phone): the path to merge, the wait ledger and the
timeline with CoderHelm's runs folded. Saved views, the scope trail
(org, then repo) and the filters live in the address. j and k move, Enter
opens, Esc closes, / searches. Long lists draw only the rows near the
screen, the list is read again only while the tab is visible, and a
backend without the endpoint gets a plain note instead of an error.

The shared list grows what the page needed: shapes for statuses (never
colour alone), row attributes and an eyebrow line on ListRow, a windowed
list hook, and a generic AvatarGroup that AvatarStack now uses.
…pe switcher

- The needs sentence sits right under the title, above the metadata, and
  is never cut: on a phone it wraps and the title gives way instead.
- The turn strip wraps its buttons, so every label is whole from 1024 to
  1440 wide.
- On a phone the saved views are one scrolling row with a fade and a
  chevron at the edge while more is off screen.
- Each step of the org and repo trail is a bordered button that opens the
  choices at its level; the repo filter in the toolbar it duplicated is
  gone.
- Stacked faces show one initial each, two at most, then "+n".
The phone navigation keeps "pull-requests" as the second place in its
bottom bar; the section now uses that key, so the page takes it there
when both are in.
- GET /api/prs's backfill shows quietly under the sync time while an
  organization's closed and merged pull requests are still being read:
  "Reading history: 9 of 14 months", with the pause and its reason when
  there is one, and each repo's count behind a disclosure. Nothing shows
  when it is done or absent. The wide data answers it, and the spec checks
  both.
- docs: getting-started/pull-requests describes the list (coverage, turn
  groups, every state with its sentence and the rule behind it, CoderHelm on
  a row, saved views, the detail, the keyboard, history reading, the phone)
  with screenshots made from invented data.
…one bar's tests with Pull requests in it

The phone bar's tests assumed no Pull requests destination; with it, Pull
requests takes the second place and Security moves into the Menu sheet.
An alert's Pull request link is matched exactly, so the menu's Pull
requests entry isn't taken for it.

@coderhelm coderhelm Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Approved with notes 1c0b2d6 (merged)

<Page testId="prs-overview" className="!max-w-[90rem]">
{header}
<Controls data={data} params={params} onPick={(p) => setParams(p)} />
{error && !data ? (

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💬 FYI: A failed or slow scope change shows the previous scope's numbers under the new scope's name (bug, not verified)

The page renders {error && !data ? <ListError/> : loading && !data ? <skeleton/> : data ? <OverviewBody/>}. data is never cleared when the org, repo or window changes. After the user picks another repo, load() sets loading and keeps the old data, so the old payload stays on screen. If that request fails, setError is set but error && !data is false, so the error panel never shows. The page then shows the previous scope's payload with the new repo's title, since header and scope come from params.repo. Every link in the page is also built from the new scope. The same mismatch appears while the request is in flight, because there is no skeleton either. Retry is unreachable in that state. Fix: drop data when the scope params change, or store the scope the payload was fetched for and treat a mismatch as no data. Add an e2e case where a repo switch returns 500 and asserts the error and retry appear and the old numbers don't.

FYI, not a block: on the whole picture this is not a named correctness, security or data-loss problem to hold the merge on.

onChange={(v) => onPick({ repo: v === "__all" ? "" : v, org })}
options={[
{ value: "__all", label: `Repos: all ${data?.scope.repos ?? ""}`.trim() },
...(params.repo && !repos.includes(params.repo) ? [params.repo] : repos).map((r) => ({ value: r, label: r })),

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💬 FYI: Repo picker drops every other repo when the selected repo isn't in the loaded list (bug, not verified)

...(params.repo && !repos.includes(params.repo) ? [params.repo] : repos) replaces the whole option list with just the selected repo. That happens on a deep link to a repo the payload doesn't list, or while the previous scope's data is still showing. The user can then only choose that repo or 'all'. The likely intent is to prepend the missing repo and keep the rest.

FYI, not a block: on the whole picture this is not a named correctness, security or data-loss problem to hold the merge on.

Suggested change
...(params.repo && !repos.includes(params.repo) ? [params.repo] : repos).map((r) => ({ value: r, label: r })),
...(params.repo && !repos.includes(params.repo) ? [params.repo, ...repos] : repos).map((r) => ({ value: r, label: r })),

/** On a phone, one line per repo. */
function RepoRows({ o, scope }: { o: PrsOverview; scope: Scope }) {
return (
<Card id="repos" testId="overview-repos" title="Repos">

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💬 Suggestion: Desktop and phone trees are both mounted, so ids repeat (hardening)

OverviewBody renders the desktop block (hidden sm:block) and the phone block (sm:hidden) together and hides one with CSS. RepoTable uses Card id="repos" (line 598) and RepoRows uses Card id="repos" (line 705). Strip renders twice with the same id="strip-heading" and testId="overview-strip". Duplicate ids are invalid HTML. An in-page #repos anchor lands on the first, hidden, copy on a phone. Test locators on these testids also match two elements. Consider giving the phone copies distinct ids, or rendering only one tree based on a media query.

This blocks: Duplicate ids on the main rendered page are invalid HTML and break in-page anchors and test locators, shown at specific lines on the change's main path


/** Notable events this week, each kind behind its floor; at most eight, filterable by kind. */
export function EventsPanel({ o, scope }: { o: PrsOverview; scope: Scope }) {
const [kind, setKind] = useState("");

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💬 Suggestion: A chosen event kind can outlive the data, leaving an empty list with no way to reset (bug, not verified)

kind is local state. The Select is only rendered when kinds.length > 1. If a later read (the poll, or a scope change that doesn't remount the panel) leaves one kind or none, the old kind stays set. shown is then empty and the panel says 'Nothing notable' while events may exist, and the Select that could clear it is gone. Resetting kind when it is no longer in kinds would fix it, for example by treating an unknown kind as ''. I did not confirm whether the page remounts the panel on a scope change.

Suggested change
const [kind, setKind] = useState("");
const [picked, setKind] = useState("");

approved: "Approved, not merged",
};

function isStage(v: string): v is PrStage {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💬 FYI: isStage accepts inherited object keys (bug, not verified)

isStage is v in STAGE_WORDS, and in also matches inherited keys. A URL like /prs?stage=toString or stage=constructor passes the check. It is then sent to the backend as stage, and it makes the chip render STAGE_WORDS[stage], which is a function. The client-side row filter also hides every row that has a stage. Only a hand-edited URL triggers it, so impact is small.

FYI, not a block: on the whole picture this is not a named correctness, security or data-loss problem to hold the merge on.

Source: ECMAScript in operator checks the prototype chain: https://tc39.es/ecma262/#sec-relational-operators

return v in STAGE_WORDS;
}

/** The filters the overview opens the list with, each one clearable. */

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💬 Suggestion: The past filter has no client-side fallback (hardening, not verified)

The stage filter is also applied in the browser, so it still works on a backend that ignores it. The past filter is not. On an older backend the chip 'Open past the p85' would show while the list stays unfiltered. Consider showing the chip only when the page response says it was applied, or accept this as a known limit.

}

/** "Sun Jan 4": a day with its weekday. */
export function dayWords(iso: string | null | undefined): string {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💬 FYI: Near-identical helpers added together (scope, not verified)

dashboard/src/app/prs/overview/model.ts adds dayWords next to when, added in the same change. Keep one helper with the shared logic (a parameter for what differs) and call it from both places. If the ticket truly needs it, say why on a line Wider than the ticket: dashboard/src/app/prs/overview/model.ts: <why>.

FYI, not a block: on the whole picture this is not a named correctness, security or data-loss problem to hold the merge on.

@coderhelm

coderhelm Bot commented Dec 5, 2026 •

Copy link
Copy Markdown
Contributor

💚 Post-merge health check passed: the deploy of e65ef06 completed and stayed green for the full 15-minute watch window (no new failures vs. the pre-merge baseline).
Auto-merge

  • ✅ CoderHelm approved
  • ✅ CI green
    The rest is in the pull request description.

@coderhelm
coderhelm Bot merged commit e65ef06 into main Dec 5, 2026
18 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ch-review CoderHelm reviews this pull request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant