# refactor\(web\): the pull request detail loader lives in its own hook · PR \#22703 · pingdotgg/t3code

[View on GitCafe](https://git.cafe/pingdotgg/t3code/pull/22703)

Repository: [pingdotgg/t3code](https://git.cafe/pingdotgg/t3code)

Visibility: public

State: merged

Source repository: pingdotgg/t3code

Source branch: refactor/split-pull-requests-detail-hook

Target branch: refactor/split-pull-requests-detail-actions

Head commit: a9ac4ea519b445df7faaba75045f0379e587a3cc

[Discussion and reviews](https://git.cafe/pingdotgg/t3code/pull/22703)

[Commits](https://git.cafe/pingdotgg/t3code/pull/22703/commits?format=markdown)

[Files changed](https://git.cafe/pingdotgg/t3code/pull/22703/diffs?format=markdown)

## Description

---

`usePullRequestDetail` (detail + activity queries, the snapshot cache, and merging in the shared summary and list row) moves out of the panel into `usePullRequestDetail.ts`, with `pullRequestRefKey`. Code moved verbatim.

| File | Before | After |
|---|---|---|
| PullRequestDetailPanel.tsx | 1,985 | 1,821 |
| usePullRequestDetail.ts | - | 179 |

Part of the pull request page split stack: #22671 → #22672 → #22702 → #22703 → #22704 → #22705 → #22706.

Measured with the rc-init render counter against a dev server seeded from real data (136 pull requests listed), fresh browser per side, main `6a6c84f990` vs the stack top. Opening a PR detail: 6482 / 947 / 1249 renders on main vs 6331 / 1187 / 956 on the stack (noise, the first open includes data arriving). Switching Summary/Timeline/Code: 2-13 renders per switch on both sides. Holding Shift 3 times on the list: 14952 vs 14937 renders; the page and column no longer re-render (6 + 6 before, 0 after), the rows still do because their speed-mode prop really changes.

Tests run on this layer: `tsc --noEmit` for apps/web, `vp lint` on the changed files, `vp test run src/reactCompilerCoverage.test.ts -t pullRequest` (every new file compiles with 0 bailouts), `vp test run src/components/pullRequest/pullRequestsRouteSearch.test.ts`.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

