Repository navigation
perf(pr): consolidate GitHub access reads and prefetch detail on hover - #445
Merged
Merged
Conversation
Port of pingdotgg#11825 to this codebase: share detail data between hover and click, and combine the permission queries into one GraphQL read. Server: getChangeRequest fired three gh subprocesses (pr view, repo view, viewer-permissions GraphQL). The viewer-permissions query now also selects mergeCommitAllowed/squashMergeAllowed/rebaseMergeAllowed, so one gh api graphql replaces gh repo view plus the second permissions query (3 reads -> 2). Removes getRepositoryAccess, REPOSITORY_ACCESS_JSON_FIELDS, and decodeRepositoryAccessJson. Web: rows prefetch the detail query on intentional hover (350ms delay, so crossing rows costs nothing) and at once on keyboard focus. The click then reads from the react-query cache. Only the detail is warmed: the activity's review-thread walk is paginated and unbounded, while the detail is one consolidated read.
This was referenced Sep 20, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Port of pingdotgg/t3code#11825 to this codebase: consolidate GitHub requests and share detail data between hover and click. Upstream measured 36% faster fresh opens and 56% fewer GraphQL requests for three hovers — their measurements, not yet ours; see testing notes for what was verified here.
Server (3 gh reads → 2 per detail open):
getChangeRequestfiredgh pr view+gh repo view+ a viewer-permissions GraphQL query. The viewer-permissions query now also selectsmergeCommitAllowed/squashMergeAllowed/rebaseMergeAllowed, so onegh api graphqlreplacesgh repo viewplus the second permissions query. RemovesgetRepositoryAccess,REPOSITORY_ACCESS_JSON_FIELDS, anddecodeRepositoryAccessJson.Web (hover warms the click): rows prefetch the detail query on intentional hover (350ms delay, so crossing rows costs nothing) and at once on keyboard focus; selecting the row then reads from the react-query cache. Only the detail is warmed — the activity's review-thread walk is paginated and unbounded, while the detail is one consolidated read.
Scar compliance
getViewerPermissionsintact); the combined read is presentation, same as before.Effect.allfan-out narrowed 3 → 2 with matching concurrency; no SQLite paths touched.Verification
pnpm fmt:check— passpnpm lint— pass (no new warnings on touched lines)pnpm typecheck— pass (exit 0)src/pullRequest/(20 passed, incl. new combined-decode + single-access-read tests), webpullRequestReactQuery.test.ts(7 passed, incl. new prefetch tests), row browser tests (3 passed, incl. new hover/focus test), client-runtime pullRequests (3 passed)gh api graphqlon perf(server): parallelize independent Effect.all I/O fan-outs #439 returned merge settings + viewer standing in one readFeature captures
PR head at upload:
a0bf2327f928d5a2683f3c24073dacf8fafa18eb. See the testing notes for exercised behavior and limitations; uploading media is not a test result.pr-hover-open.webm
pr-hover-open.webm