refactor(web): the pull requests page's scope and grouping hooks live in their own module#22705

merged1
refactor/split-pull-requests-list-groups
refactor/split-pull-requests-list-hooks
opened4d agobyJJulius Marminge
View on GitHubTwo-way sync enabledPR last imported 4d ago

usePullRequestScope, usePullRequestQueryFilters, pullRequestGroups and usePullRequestDisplayGroups move verbatim into components/pullRequest/usePullRequestListView.ts, with the PullRequestsSearch type they read.

FileBeforeAfter
routes/_chat.pull-requests.tsx2,0341,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

All checks passed

Added 1 commit

  • refactor(web): the pull requests page's scope and grouping hooks live in their own module3c959da
Synced from GitHub

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.

Synced from GitHub

Review in Change Stack →

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.ts
  • apps/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.ts
The 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.ts
The 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.tsx
The 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 nameStatusExplanationResolution
Description checkWarningThe 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 nameStatusExplanation
Title checkPassedThe title clearly and concisely describes the main refactor: moving pull-request scope and grouping hooks into a dedicated module.
Linked Issues checkPassedCheck skipped because no linked issues were found for this pull request.
Out of Scope Changes checkPassedCheck 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

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.