refactor(web): proposed-plan follow-ups and implement-in-new-thread live in their own hooks#23091
Second layer of splitting useComposerSend.
The two proposed-plan send paths move to useProposedPlanSend.ts:
usePlanFollowUpSendhandles refining a plan, or implementing it on this thread.useComposerSendcalls it from the plan branch ofonSend.useImplementPlanInNewThreadis called by ChatView directly. It owns the create/delete thread commands andnavigate, souseComposerSenddrops those, plusdefaultRuntimeModeandonImplementPlanInNewThread.
| before | after | |
|---|---|---|
useComposerSend.ts lines | 1,823 | 1,553 |
useComposerSend input fields | 78 | 77 |
Render boundaries are unchanged.
Tested in this worktree's dev server (isolated .t3, throwaway git repo as the project) with the whole stack applied: plain send from a draft (new thread), send with an image, queued follow-up and Ctrl+Enter steer during a running turn, resume of a stopped run, plan refinement and "Implement in a new thread" (legacy plan mode on), and a two-model start (two threads, two worktrees). All replies arrived and nothing errored. Also ran apps/web typecheck, lint on changed files (only the pre-existing prefer-set-has warning in useComposerSend.ts remains) and the React Compiler coverage test for changed files (0 bailouts).
🤖 Generated with Claude Code
Checks
- SuccessfulCodeRabbitGitHub
Review completed
- Successful
Skipped - Not affected
- Skipped
- Skipped
- Skipped
- SuccessfulRemove preview downloadGitHub
- Skipped
- SuccessfulLabel PR sizeGitHub
- SuccessfulLabel PR 23091GitHub
- Successful
- Successful
- Successful
- SuccessfulCollect PR targetsGitHub
- SuccessfulPrepare PR size configGitHub
- Successful
- SuccessfulNative fingerprint diffGitHub
- SuccessfulCheckGitHub
- SkippedRustGitHub
- SkippedRelease SmokeGitHub
- Skipped
- SuccessfulBuild and TypecheckGitHub
- SuccessfulTest WebGitHub
- SuccessfulTestGitHub
- Skipped
- SuccessfulLabel PR sizeGitHub
- SuccessfulLabel PR 23091GitHub
- SuccessfulNative fingerprint diffGitHub
- SuccessfulCollect PR targetsGitHub
- SuccessfulPrepare PR size configGitHub
- SkippedEAS PreviewGitHub
- SuccessfulTest Server 8GitHub
- SuccessfulTest Server 7GitHub
- SuccessfulTest Server 1GitHub
- SuccessfulTest Server 6GitHub
- SuccessfulTest Server 2GitHub
- SuccessfulTest Server 4GitHub
- SuccessfulTest Server 5GitHub
- SuccessfulTest Server 3GitHub
- SuccessfulChangesGitHub
- SuccessfulLintGitHub
Added 1 commit
- refactor(web): proposed-plan follow-ups and implement-in-new-thread live in their own hooks9927f9e
Approvability
Verdict: Approved at 9927f9e
Macroscope's review found this PR approvable — This PR extracts existing proposed-plan send flows into dedicated hooks while preserving their guards, orchestration, navigation, cleanup, and error behavior. The remaining changes are wiring and input cleanup, with no product-default or static-analysis configuration changes.
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:
d1e5d5e0-fd28-4c14-9dda-0ff38e4064ac
📥 Commits
Reviewing files that changed from the base of the PR and between 9c7a742e1f18ec3fb7be07b6099e20ea01c7a8d3 and 9927f9e40537f202f9d8ca68f1f415a5b123bc86.
📒 Files selected for processing: 3
apps/web/src/components/ChatView.tsxapps/web/src/components/chat/useComposerSend.tsapps/web/src/components/chat/useProposedPlanSend.ts
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 6 remain after this review.
📝 Walkthrough
The pull request moves proposed-plan follow-up sending and new-thread implementation into dedicated hooks.
ChatViewnow supplies the new-thread callback, anduseComposerSendreturns onlyonSend.Changes: Proposed-plan sending
Layer / File(s) Summary Plan follow-up submission
apps/web/src/components/chat/useProposedPlanSend.ts,apps/web/src/components/chat/useComposerSend.tsusePlanFollowUpSendvalidates and submits follow-ups, persists thread settings, and handles optimistic messages and failures.useComposerSendwires the hook and delegates plan follow-up submission to it.New-thread plan implementation
apps/web/src/components/chat/useProposedPlanSend.ts,apps/web/src/components/ChatView.tsx,apps/web/src/components/chat/useComposerSend.tsuseImplementPlanInNewThreadcreates and starts an implementation thread, waits for server startup, and navigates to the thread. On failure, it deletes the thread and displays an error toast.ChatViewpasses the callback to the composer.Priority: ⬇️ Low
Estimated code review effort: 3 (Moderate) | ~25 minutes
Change: Refactor
Suggested reviewers:
t3dotgg
Merge Risk: ⚪ Minimal · up to 9927f
This is a behavior-preserving refactor that splits proposed-plan sending into its own hooks. The supplied context shows no concrete regression. The author reports testing the affected send paths and passing the typecheck.
Pre-merge checks: Passed 3 · Failed 1
Failed Failed checks: 1 warning
Check name Status Explanation Resolution Description check Warning The description explains the implementation and provides detailed verification results. It does not include a distinct Problem section or the required issue, discussion, maintainer approval, or exempt… Add a Problem section with the expected behavior and motivation. Add a link to the triaged issue or maintainer approval with the approval comment. If no prior issue or discussion applies, explain why this focused refactor qualifies for an e… Passed Passed checks: 3 passed
Check name Status Explanation Title check Passed The title clearly and concisely describes the main change: moving proposed-plan follow-up and new-thread implementation logic into separate hooks. 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 implementation and provides detailed verification results. It does not include a distinct Problem section or the required issue, discussion, maintainer approval, or exemption rationale under Scope and approval.
Resolution
Add a Problem section with the expected behavior and motivation. Add a link to the triaged issue or maintainer approval with the approval comment. If no prior issue or discussion applies, explain why this focused refactor qualifies for an exemption.
✨ 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
Comment @coderabbitai help to get the list of available commands.