Skip to content

fix(web): list a session's open pull requests before merged ones - #362

Merged
kalaspuff merged 1 commit into
mainfrom
fctl/604-in-an-agent-session-with-many-many-prs-t
Oct 31, 2026
Merged

kalaspuff merged 1 commit into
mainfrom
fctl/604-in-an-agent-session-with-many-many-prs-t

Conversation

@fctl-sh

@fctl-sh fctl-sh Bot commented Oct 31, 2026 •

Copy link
Copy Markdown
Contributor

Summary

A session with many pull requests listed them in the order its agent found them, so the row in session lists, which cuts off what doesn't fit, could show only merged ones, and the rail's Pull requests section put the open ones at the bottom. Now open, draft and queued pull requests come first, then those whose state nobody has looked up yet, then merged and closed ones. Each group keeps the order the agent found them in. The session header's list of links uses the same order, since all three take it from the same function.

I added a unit test for the order, ran npm run check, and looked at a dev session with ten pull requests in mixed states, staged in its SQLite, against main's web app and this branch's.

Screenshots

At 8051709, dark theme. The row in the project's session list, before and after:

Before: the row shows merged playground#72, #58, #59 and #60

After: the row shows open #74, draft #75, queued #73 and #76, whose state isn't known yet

The session page's Pull requests section:

Before After
Before: six merged and closed pull requests above the open, draft and queued ones After: open, draft and queued at the top, merged and closed at the bottom

Worth confirming

  • Decision: Pull requests whose state fctl doesn't know yet (nobody has looked them up on GitHub) come after open, draft and queued ones and before merged and closed ones, because they are usually new and so likely still open.
  • Decision: Within each group the order stays the one the agent found them in, not most recent first.

fctl session


Note

Low risk. It only changes the order in which the web app lists a session's pull requests, with a unit test; no data or API changes.

What it does. pullRequests now lists a session's open, draft and queued pull requests first, then those not yet looked up, then merged and closed ones, each group in the order the agent found them. Sessions with many pull requests therefore keep the ones still under way visible when a list cuts off its end.

fctl review's first look at 8051709 · 2 files, +32 −3 · Review agent settings

A session with more pull requests than its row or the rail shows at once listed them in the order its agent found them, so its open ones could be cut off behind merged ones. Open, draft and queued ones now come first, then those nobody looked up yet, then merged and closed ones, each in the order found.
@fctl-sh
fctl-sh Bot requested a review from kalaspuff as a code owner October 31, 2026 00:24
@kalaspuff
kalaspuff merged commit 016b007 into main Oct 31, 2026
11 checks passed
@kalaspuff
kalaspuff deleted the fctl/604-in-an-agent-session-with-many-many-prs-t branch October 31, 2026 00:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant