refactor(web): ChatView's pull request checkout lives in usePullRequestDraftThread#23070
Opening the pull request dialog and placing the prepared branch or worktree on the project's draft thread move into chat/usePullRequestDraftThread.ts. Verbatim move.
| Before | After | |
|---|---|---|
ChatView.tsx lines | 4,271 | 4,190 |
Tests: tsc-rs --noEmit for apps/web, oxlint on the changed files, vp test run src/components/ChatView.logic.test.ts, and the React Compiler coverage test for every changed file (0 bailouts). ChatView stays in the coverage test's slow set.
Part of the ChatView split (7,258 → 3,975 lines across the stack).
Opus 5.5, Claude Code.
🤖 Generated with Claude Code
Checks
- SuccessfulCodeRabbitGitHub
Review completed
- Skipped
- Skipped
- Skipped
- SuccessfulRemove preview downloadGitHub
- SuccessfulCheckGitHub
- Skipped
- SkippedRustGitHub
- SkippedRelease SmokeGitHub
- SuccessfulTest WebGitHub
- SuccessfulTestGitHub
- SuccessfulBuild and TypecheckGitHub
- SuccessfulTest Server 8GitHub
- SuccessfulTest Server 5GitHub
- SuccessfulTest Server 1GitHub
- SuccessfulLintGitHub
- SuccessfulTest Server 7GitHub
- SuccessfulTest Server 6GitHub
- SuccessfulTest Server 2GitHub
- SuccessfulTest Server 3GitHub
- SuccessfulTest Server 4GitHub
- SuccessfulChangesGitHub
- SuccessfulCheckGitHub
- SkippedRelease SmokeGitHub
- SkippedRustGitHub
- Skipped
- SuccessfulTestGitHub
- SuccessfulBuild and TypecheckGitHub
- SuccessfulTest WebGitHub
- SuccessfulTest Server 5GitHub
- SuccessfulTest Server 7GitHub
- SuccessfulTest Server 3GitHub
- SuccessfulTest Server 2GitHub
- SuccessfulTest Server 4GitHub
- SuccessfulTest Server 6GitHub
- SuccessfulTest Server 8GitHub
- SuccessfulTest Server 1GitHub
- SuccessfulChangesGitHub
- SuccessfulLintGitHub
- FailedCheckGitHub
- Skipped
- SuccessfulLabel PR sizeGitHub
- SuccessfulLabel PR 23070GitHub
- SuccessfulPrepare PR size configGitHub
- SuccessfulCollect PR targetsGitHub
- SuccessfulNative fingerprint diffGitHub
- SkippedRelease SmokeGitHub
- Skipped
- SkippedRustGitHub
- CancelledTest WebGitHub
- CancelledTestGitHub
- CancelledBuild and TypecheckGitHub
- SuccessfulTest Server 2GitHub
- SuccessfulTest Server 6GitHub
- CancelledLintGitHub
- SuccessfulTest Server 1GitHub
- SuccessfulTest Server 4GitHub
- SuccessfulTest Server 3GitHub
- SuccessfulChangesGitHub
- SuccessfulTest Server 7GitHub
- SuccessfulTest Server 8GitHub
- SuccessfulTest Server 5GitHub
- FailedCheckGitHub
- SuccessfulNative fingerprint diffGitHub
- SkippedDeploy web previewGitHub
- SkippedEAS PreviewGitHub
- Skipped
- SkippedRustGitHub
- SkippedRelease SmokeGitHub
- CancelledTest WebGitHub
- CancelledTestGitHub
- CancelledBuild and TypecheckGitHub
- SkippedDeploy web previewGitHub
- SkippedEAS PreviewGitHub
- CancelledTest Server 7GitHub
- CancelledTest Server 2GitHub
- CancelledTest Server 1GitHub
- CancelledTest Server 4GitHub
- CancelledTest Server 8GitHub
- SuccessfulChangesGitHub
- SuccessfulTest Server 3GitHub
- CancelledTest Server 5GitHub
- CancelledTest Server 6GitHub
- CancelledNative fingerprint diffGitHub
- CancelledLintGitHub
- Skipped
- Skipped
- SuccessfulLabel PR sizeGitHub
- Skipped
- SuccessfulLabel PR 23070GitHub
- CancelledLabel PR 23070GitHub
- Skipped
- CancelledLabel PR sizeGitHub
- Skipped
- Skipped
- SuccessfulPrepare PR size configGitHub
- SuccessfulCollect PR targetsGitHub
- SuccessfulCollect PR targetsGitHub
- SuccessfulPrepare PR size configGitHub
Approvability
Verdict: Approved at 6b61b05
Macroscope's review found this PR approvable — This PR extracts the existing pull-request checkout and draft-thread handling from ChatView into a dedicated hook while preserving the same call sites and workflow. It introduces no new capability, schema change, product-default change, or static-analysis override.
No code changes detected at c8c87af. Prior analysis still applies.
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:
755ea676-2d11-4367-9e6d-4b61db49614f
📥 Commits
Reviewing files that changed from the base of the PR and between 6b61b052f75856af7162bc1ad38b16fb62445833 and c8c87afdbfeacdcaaeec94927259a84dd7ba0f48.
📒 Files selected for processing: 1
apps/web/src/components/ChatView.tsx
Limit details: You’ve used all 10 included reviews currently available.
📝 Walkthrough
Pull-request draft-thread preparation and dialog handling moved from
ChatViewinto the newusePullRequestDraftThreadhook.ChatViewpasses the relevant state to the hook and uses its returned callbacks.Changes: Pull-request draft-thread workflow
Layer / File(s) Summary Draft-thread preparation and dialog handling
apps/web/src/components/chat/usePullRequestDraftThread.tsThe new hook gates dialog opening, reuses or updates draft sessions when applicable, and otherwise creates and navigates to a draft thread with pull-request context. ChatView hook integration
apps/web/src/components/ChatView.tsxChatViewcalls the hook and uses its callbacks. The inline workflow and its unused imports and selectors were removed.Priority: ⬇️ Low
Estimated code review effort: 3 (Moderate) | ~20 minutes
Change: Refactor
Suggested reviewers:
t3dotgg
Merge Risk: ⚪ Minimal · up to c8c87
The pull-request draft-thread workflow appears unchanged by the extraction and is ready to merge after normal checks.
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 change and lists verification commands, but it omits the required Problem and Scope and approval sections. Verification also does not state observed results or any ch… Add Problem and Scope and approval sections. Describe the expected behavior and motivation. Provide the issue or maintainer approval, or explain why an exemption applies. Expand Verification with observed results and any unavailable checks.… Passed Passed checks: 3 passed
Check name Status Explanation Title check Passed The title clearly and concisely describes the main refactor: moving ChatView pull request checkout logic into usePullRequestDraftThread. 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 change and lists verification commands, but it omits the required Problem and Scope and approval sections. Verification also does not state observed results or any checks that could not be completed.
Resolution
Add Problem and Scope and approval sections. Describe the expected behavior and motivation. Provide the issue or maintainer approval, or explain why an exemption applies. Expand Verification with observed results and any unavailable checks. Include UI evidence if the refactor changes user-visible behavior.
✨ 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: 1
- Charged: $0.25
- 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.
Thread transfer impact
⚠️ The latest CI run did not produce a thread transfer result for c8c87af.
This comment will update automatically after the next completed run.
Added 1 commit
- refactor(web): ChatView's pull request checkout lives in usePullRequestDraftThreadc8c87af