Skip to content

fix(review): list commit scopes newest first and keep the newest on huge prs - #103

Merged
xieziyu merged 1 commit into
mainfrom
fix/scope-menu-newest-first
Sep 7, 2026
Merged

xieziyu merged 1 commit into
mainfrom
fix/scope-menu-newest-first

Conversation

@xieziyu

@xieziyu xieziyu commented Sep 7, 2026

Copy link
Copy Markdown
Owner

What

  • The review-screen scope switcher and the entry-screen scope picker list commits newest to oldest. Alt-Up/Down follow the same row order. The chip's k/N still counts oldest to newest, matching the position the agent is told in the first-round prompt.
  • The commit list now comes from GraphQL, paging backwards from the newest commit. The REST pulls/N/commits endpoint only ever returns the oldest 250, so on PRs with hundreds of commits the ones people look for were exactly the ones cut off. Truncation now drops the oldest, the total is exact, and the pinned commit's ordinal accounts for the cut-off ones.
  • The container's commit list is cached in memory with a 60s TTL and dropped on rerun or delete, so reopening the menu only recomputes local scan states instead of hitting gh again.
  • The scope menu scrolls its keyboard cursor into view on long lists.

Why

Newest-first is what people reach for when switching scope; old-to-new pushed the recent commits to the bottom of the list. Once the list was reversed, the REST cap dropping the newest commits became the worst possible truncation direction.

Verification

  • typecheck, eslint pass.
  • spike:scope extended: fake gh pages the GraphQL connection for real; covers cache hit/miss and a 260-commit PR (250 returned, oldest 10 dropped, pinned ordinal 11/260, pinned-outside-list falls back to compare).
  • Real API: 2026-08-26, Version 26.8.0 (Current) nodejs/node#65551 (344 commits) returns the newest 250, tail matches a direct query.
  • Preview: cursor stays in view stepping through a shrunken list; reopening scrolls to the current commit.

…uge prs

Both the review-screen scope switcher and the entry-screen scope picker
now show commits newest to oldest. Alt-Up/Down follow the same row order.
The chip's k/N still counts oldest to newest, matching the position given
to the agent in the first-round prompt. The IPC contract stays oldest
first; only the presentation is reversed.

The commit list now comes from GraphQL, paging backwards from the newest
commit. The REST endpoint only ever returns the oldest 250, so on PRs
with hundreds of commits the ones people actually look for were the ones
cut off. Truncation now drops the oldest, the total count is exact, and
the pinned commit's ordinal accounts for the cut-off ones.

The container's commit list is cached in memory with a 60s TTL and
dropped on rerun or delete, so reopening the scope menu only recomputes
the local scan states instead of hitting gh again. The menu also scrolls
its keyboard cursor into view on long lists.
@xieziyu
xieziyu merged commit 566b6a8 into main Sep 7, 2026
@xieziyu
xieziyu deleted the fix/scope-menu-newest-first branch September 7, 2026 10:39
@xieziyu xieziyu mentioned this pull request Sep 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant