refactor(web): the pull requests page's scope and grouping hooks live in their own module#22705
usePullRequestScope, usePullRequestQueryFilters, pullRequestGroups and usePullRequestDisplayGroups move verbatim into components/pullRequest/usePullRequestListView.ts, with the PullRequestsSearch type they read.
| File | Before | After |
|---|---|---|
| routes/_chat.pull-requests.tsx | 2,034 | 1,627 |
| usePullRequestListView.ts | - | 434 |
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
Checks
- SuccessfulCodeRabbitGitHub
Review completed
- Successful
Skipped - Not affected
- Skipped
- Skipped
- Skipped
- SuccessfulRemove preview downloadGitHub
- Skipped
- SuccessfulLabel PR sizeGitHub
- SuccessfulLabel PR 22705GitHub
- Successful
- Successful
- Successful
- Successful
- SuccessfulPrepare PR size configGitHub
- SuccessfulCollect PR targetsGitHub
- SuccessfulCheckGitHub
- SkippedRelease SmokeGitHub
- Skipped
- SkippedRustGitHub
- SuccessfulBuild and TypecheckGitHub
- SuccessfulTestGitHub
- SuccessfulTest WebGitHub
- SuccessfulLabel PR 22705GitHub
- Skipped
- SuccessfulLabel PR sizeGitHub
- SuccessfulPrepare PR size configGitHub
- SuccessfulCollect PR targetsGitHub
- SkippedEAS PreviewGitHub
- SuccessfulTest Server 6GitHub
- SuccessfulTest Server 7GitHub
- SuccessfulTest Server 3GitHub
- SuccessfulTest Server 1GitHub
- SuccessfulTest Server 4GitHub
- SuccessfulTest Server 8GitHub
- SuccessfulTest Server 2GitHub
- SuccessfulLintGitHub
- SuccessfulTest Server 5GitHub
- SuccessfulNative fingerprint diffGitHub
- SuccessfulChangesGitHub
Added 1 commit
- refactor(web): the pull requests page's scope and grouping hooks live in their own module3c959da
Approvability
Verdict: Approved at 3c959da
Macroscope's review found this PR approvable — This PR moves the pull-request page’s existing scope, filtering, grouping, and display logic into a dedicated module without adding capability or changing product behavior. The route only switches from local implementations to equivalent imports.
You can add or adjust custom eligibility rules. Learn more.
No actionable comments were generated in the recent review. 🎉
ℹ️ Recent review info
⚙️ Run configuration
- Configuration used: Path: .coderabbit.config.ts
- Review profile: CHILL
- Plan: Team
- Run ID:
f8c68f47-168a-4cd4-a522-14eee2df10e4
📥 Commits
Reviewing files that changed from the base of the PR and between 39c2453342f21a0f56d05bf184a749337a230098 and 3c959daf124dc5f0671a556da32e7d38ef7bd39a.
📒 Files selected for processing: 2
apps/web/src/components/pullRequest/usePullRequestListView.tsapps/web/src/routes/_chat.pull-requests.tsx
Limit details: You’ve used all 10 included reviews currently available.
📝 Walkthrough
The pull-request route now imports scope resolution, query filtering, grouping, entry ID, and display-group logic from a dedicated module. The route’s local implementations of these functions and related helpers have been removed.
Changes: Pull-request list view
Layer / File(s) Summary Scope and query filtering
apps/web/src/components/pullRequest/usePullRequestListView.tsThe module adds the search shape and entry ID helper. It resolves environment and project scope, then combines debounced query filters with menu filters. Grouping and display preparation
apps/web/src/components/pullRequest/usePullRequestListView.tsThe module filters and groups pull requests, creates status and lookup maps, and prepares display groups with host metadata, diff stats, optimistic overrides, sorting, counts, and host actions. Route delegation
apps/web/src/routes/_chat.pull-requests.tsxThe route imports the extracted list-view functions and removes its local search type, helper, and scope, filtering, grouping, and display preparation logic. Priority: ⬇️ Low
Estimated code review effort: 3 (Moderate) | ~25 minutes
Change: Refactor
Suggested reviewers:
maria-rcks
Merge Risk: ⚪ Minimal · up to 3c959
This is a code-organization change with no intended behavior change and no identified merge-blocking risk.
Pre-merge checks: Passed 3 · Failed 1
Failed Failed checks: 1 warning
Check name Status Explanation Resolution Description check Warning The description explains the code movement and includes detailed verification results, but it omits the required Problem and Scope and approval sections. It also does not provide the required UI scree… Add Problem and Scope and approval sections. Include the related issue or explicit maintainer approval, or explain why the change qualifies for an exemption. Add before/after UI screenshots, or explain why they are not applicable. Retain th… Passed Passed checks: 3 passed
Check name Status Explanation Title check Passed The title clearly and concisely describes the main refactor: moving pull-request scope and grouping hooks into a dedicated module. Linked Issues check Passed Check skipped because no linked issues were found for this pull request. Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Description check
Explanation
The description explains the code movement and includes detailed verification results, but it omits the required Problem and Scope and approval sections. It also does not provide the required UI screenshots or state why screenshots are not applicable.
Resolution
Add Problem and Scope and approval sections. Include the related issue or explicit maintainer approval, or explain why the change qualifies for an exemption. Add before/after UI screenshots, or explain why they are not applicable. Retain the existing Change and Verification details.
✨ Finishing Touches
📝 Generate docstrings
- Commit to this branch
- Create a new PR
🧪 Generate unit tests (beta)
- Commit to this branch
- Create a new PR
- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Usage-based review receipt
- Mode: Continue automatically
- Reviewed files: 2
- Charged: $0.50
- View usage details
Note
This review was completed with usage-based billing: files reviewed beyond your plan's included limits are billed at $0.25/file. View usage-based billing.
Comment @coderabbitai help to get the list of available commands.