Skip to content

Pull requests: fixes from the worst-case stress test - #2608

Merged
backnotprop merged 12 commits into
mainfrom
fix/pulls-break-ui
Nov 4, 2026
Merged

backnotprop merged 12 commits into
mainfrom
fix/pulls-break-ui

Conversation

@backnotprop

Copy link
Copy Markdown
Owner

Fixes the 27 problems the worst-case stress test (break-ui) found in the Inbox Pull requests pages from #2590. It follows the owner's choices.

Owner's choices

  • A long title is cut with "…" in the review header. The full title shows on hover and in the diff heading. Back, comments, destination and the verdict stay on screen at 1440, 1024, 800–1100 and on a phone. From 760 to 959 wide, the destination switch drops its names, as it already does on a phone.
  • With several agents on one stack, each agent gets verdicts only for its own layers. The other agents show as chips on the meta line. The stack is named by its own thread.
  • Over 100 PRs: "Showing 100 of 133 from github.com", with "Open on GitHub". The counts come from the searches' issueCount / count.
  • A chain of more than 5 layers shows the first 2, "+N", then the last 2.
  • A forked stack shows "Also on #N". Next layer follows only the layers above it, never a sibling.
  • An ended agent (it sent with a wake and is not polling) stays named and is marked "ended". Reply is replaced by "Hand to another agent".

The rest

  • When a host times out or is rate limited, the list says so: "GitHub didn't answer; its pull requests aren't shown", or "…; showing its last read". It never says "Nothing open". The server adds last_read, clis and unsigned. "gh not installed" is now told apart from "signed out". The footer names only the CLIs that answered.
  • Stack order:
    • Stacks join through merged middle layers.
    • When two PRs share a head branch, the layer above goes on the PR into a long-lived branch.
    • "Lands next" shows only when the base actually lands.
    • A base that no PR has reads "Based on X (no open pull request)".
  • Non-ASCII branches compare. Any name git accepts is percent-encoded per path part. A refused diff shows the forge link and offers no verdict and no post.
  • Conflicts are read (mergeable / conflicts). An approved PR that conflicts is on you, not Ready to land.
  • Smaller fixes:
    • an empty diff says it changes no files;
    • folders that repeat in the file rail are grouped under folder headings cut in the middle;
    • the phone strip scrolls to the current layer;
    • GitLab is called "merge request" everywhere;
    • initials never read "PR" or "MR";
    • a deleted author gets an empty tile;
    • the last words keep code;
    • repositories with the same name show their path;
    • the sidebar count is read at startup and on focus.
  • Phones at 390 and 320: no page scrolls sideways.

Changed differently

  • update errors #14: splitting initials only on "." and space would still give "PR". Initials that would read "PR" or "MR" fall back to the first letter.
  • Not triggering command #20: the heading is "Landing order" whenever the ladder has more than one layer, merged layers included. Counting only open layers would keep the bug.

Agent-facing text is unchanged, and PULL_HANDOFF_AUTHORS_LINE stays null. There are no new keyboard shortcuts and no packages/ui changes. Only Inbox endpoints changed, and those are Bun-only.

Tests (targeted): packages/core/inbox-pulls.test.ts, packages/server/inbox-pulls.test.ts (new "the worst case" block), the new packages/inbox/pulls/model.test.ts and packages/inbox/pulls/pullsLayout.test.ts, and the DOM test packages/inbox/pulls/pullReview.test.tsx. The tests reuse the worst-case values as fixtures. The stress-test harness reshot every finding at desktop, 200% zoom and phone sizes: 30 of 30 passed. tests/e2e/inbox-pull-requests.spec.ts was not run.

The 27 findings of the worst-case stress test, with the owner's choices:
a long title is cut in the review header, each agent on a stack gets
verdicts only for its own layers, a capped read says "Showing 100 of 133",
a long chain draws the first 2, +N, the last 2, a forked stack reads
"Also on #N", an ended agent stays named and offers a new hand-off.

A host that times out or is rate limited says so instead of "Nothing
open"; stacks join through merged middle layers and pick the PR into a
long-lived branch when two share a head; non-ASCII branches compare
(percent-encoded); conflicts put a PR on the person; the sidebar count
reads at start and on focus. Regression tests in core, server, the
model and the DOM.
…e layers above by its number

InboxPullStack.parents is the one source of a stack's shape (inboxPullParent,
inboxPullAncestors). Two PRs from one branch: the one into the trunk (the
forge's default branch, else main or master) takes the layers above, then
another long-lived branch, then the lower number. Review #2608 findings 4, 10.
…s its own CLI states; counts say what is shown

GET /api/inbox/pulls/avatar (Bun only, the pulls guards): only an author of a
PR in the last list, fetched from the forge's own avatarUrl, cached on disk
under the inbox dir with a size cap (inbox-pull-avatars.ts). The window's CSP
is unchanged. The list reads default_branch. Review #2608 findings 5 and 6.
…ents on the meta line; one Open the diff

- The window reads a stack's shape only from core's parents (pulls/topology.ts):
  a verdict on a forked stack's layer goes down its own line, never to a
  sibling's agent; a Whole stack verdict goes to an agent only when every layer
  under it is that agent's (else its option is off, posting still works).
- No claim that a base has no open PR; any trunk keeps Lands next.
- A self-hosted host is never put on one CLI by its name.
- Row top left: the author's picture through the Inbox (initials while it
  loads or when it cannot; a grey person for a deleted account); the agent on
  the third line with its mark ('#48201 · Claude Code has it').
- The stack page's Whole stack button is gone (owner, q-ab14bb63): the review's
  switch reads the whole stack.
- Leaving the page keeps a read in flight for the sidebar count.
- model.ts split: topology, notices, rail, labels.
- Tests: forked multi-agent cases, polling (usePulls.test.tsx), avatars and the
  switch in the DOM, the header widths and the title cut measured in the e2e,
  which also fails on any request to another origin. pullsLayout.test.ts
  (CSS read by regex) removed.
Review #2608 findings 1, 2, 3, 7, 8, 9, 10.
… on shared state; avatar allow-list, port, cache and redirect follow-ups

- The row's agent mark takes the scale's 16 (box, corner, glyph) and sits on the text's bottom, so the meta line
  keeps a plain row's height (agentMarkScale.test.ts passes again).
- The "two lists at once" test now covers github.com (gh missing) and gitlab.com (glab held): the second list must
  not wipe the first's gh state. Fails on 245f585's inbox-pulls.ts.
- isOpen comes from topology.ts; "Layer N of M" counts the layer's own line of the stack (layerPosition).
- Avatars: a host absent from the last list keeps no login (allowOnly); the forge-host exemption matches the port;
  old misses are pruned; the cache size is kept as pictures are written and the folder is read off the request path
  only to learn it or past the cap. Unit tests for redirects (private IP, http, a chain of 4, forge host on another port).
…che count re-stats; tests that guard what they claim

- The forge-host exemption takes the port of the avatar URL the forge itself returned (the list's host carries no
  port), so a self-managed forge on :8443 serves its avatars again; a redirect to another port on its name is still
  refused. The "ported" test now uses a realistic host with avatar URLs on :8443.
- writeDisk re-stats the picture it replaces just before writing (0 when a trim already dropped it).
- The cache test fails if the replaced bytes are added instead of subtracted; a new test fails without the miss
  pruning (missesHeld); a server test fails if the list goes back to the per-host allow loop.
@backnotprop
backnotprop marked this pull request as ready for review November 4, 2026 17:25
@backnotprop backnotprop added the ci:full Run the heavy CI tier on this PR (added by the merge script) label Nov 4, 2026
Main's pull hand-off work (isOpenPull/openLayers, handoffStack for a tree) meets
this branch's topology.ts. stackLink, layerVerdictLink, startLayer and nextLayer
stay in topology.ts; main's tree hand-off helpers stay in model.ts.
layerVerdictLink keeps both rules: a layer takes the thread of a linked layer on
its own line, and in a fork never a thread that has an open layer on another
branch (a thread handed #412 and #414 is not #413's). pullHandoffThreadName
takes the links, as stackTitle now does.
@backnotprop
backnotprop merged commit 9e78717 into main Nov 4, 2026
82 of 86 checks passed
backnotprop added a commit that referenced this pull request Nov 4, 2026
#2608 merged with main's later hand-off work (#2606 approved message, thread
names, tree stacks; #2584 global comments). Kept this branch's review-thread
picker and one-thread model, and carried main's behaviour into it:
- ReviewPicker sends the thread name (pullHandoffThreadName) and retries
  unnamed on 409 thread_name_taken with the same idempotency key; Start a new
  agent passes it to compose.
- The picker works on handoffStack (a tree's chain; after an ended agent, the
  layers that thread had), for keys, ask line and message.
- PullReview keeps main's early fold/sheet block plus this branch's drawn
  measure and rail fold.
- GuideView bare keeps the global comment button, in a non-floating row.
- Main's hand-off tests ported to the picker; docs merged.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci:full Run the heavy CI tier on this PR (added by the merge script)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant