Thread transfer impact
⚠️ The latest CI run did not produce a thread transfer result for 9fdc654.
This comment will update automatically after the next completed run.
onSend is about 1,200 lines. Its preparation was written inline, and some of it twice:
These are now pure functions:
ChatView.logic.ts: snapshotComposerSend, planComposerTurn, boundAttachmentIds, withMessageContext, optimisticMessageAttachments and sendTitleFallbackLabels. All have tests except the last two.chat/chatViewSend.ts: resolveMultipleModelTargets, which lives there because composerProviderState pulls in picker components. ChatView still validates each target's text with the composer in selection order and stops at the first problem, as before.The two places that put a failed send back into the draft now call one restoreComposerDraft helper.
The dispatch itself stays in ChatView. That covers uploads, the dock transition, the multiple-model start loop, the turn start, and failure recovery. Moving any of it would need a 30-field input object, which wouldn't make it easier to read. This layer adds no useStableCallback calls or layout-effect ref assignments, and doesn't change render boundaries.
| previous layer | this layer | |
|---|---|---|
| ChatView.tsx lines | 7,372 | 7,258 |
Tests: vp test run src/reactCompilerCoverage.test.ts for ChatView and every new file (0 bailouts), vp test run src/components/ChatView.logic.test.ts (5 new cases), tsc-rs --noEmit for apps/web, and oxlint on the changed files.
🤖 Generated with Claude Code
Review completed
Skipped - Not affected
Added 2 commits
⚠️ The latest CI run did not produce a thread transfer result for 9fdc654.
This comment will update automatically after the next completed run.
Verdict: Approved at 9fdc654
Macroscope's review found this PR approvable — This is a component-local refactor that extracts existing ChatView send-preparation logic into pure helpers and consolidates draft recovery, while leaving uploads and dispatch behavior in place. Added unit coverage exercises the key extracted decisions, and no product defaults, schemas, or static-analysis settings change.
You can add or adjust custom eligibility rules. Learn more.
No actionable comments were generated in the recent review. 🎉
fba68e0f-0a1a-4d6b-9cc7-40fd658f2007Reviewing files that changed from the base of the PR and between 7483af891cd7a34bc9f3c661a49d3af59b42574b and 9fdc654554c96a2d9bbb78957cb34a7dd6d129d4.
apps/web/src/components/ChatView.logic.test.tsapps/web/src/components/ChatView.logic.tsapps/web/src/components/ChatView.tsxapps/web/src/components/chat/chatViewSend.tsLimit details: You’ve used all 10 included reviews currently available.
The chat send flow now captures composer state in a shared snapshot, plans dispatch and context handling through shared helpers, resolves multiple-model targets centrally, and uses common attachment, optimistic-message, title-fallback, and draft-restoration logic.
Changes: Composer send flow
| Layer / File(s) | Summary |
|---|---|
Composer snapshot and dispatch helpers apps/web/src/components/ChatView.logic.ts, apps/web/src/components/ChatView.logic.test.ts | Added helpers to snapshot composer content, plan worktree and queue behavior, bind attachment IDs, construct message context, project optimistic attachments, and derive title fallback labels. Tests cover snapshot expiration, dispatch planning, context formats, and attachment ID selection. |
Multi-model target resolution and draft restoration apps/web/src/components/chat/chatViewSend.ts | Added target resolution for selected models, including provider and model checks, prompt formatting, and interaction-mode selection. Added restoration of captured composer content after a failed send. |
Chat send flow integration apps/web/src/components/ChatView.tsx | Updated single-thread and multi-model sends to use shared snapshot, planning, target-resolution, context, attachment, title, and draft-restoration helpers. Removed duplicated inline send logic. |
Priority: ⬇️ Low
Estimated code review effort: 3 (Moderate) | ~20 minutes
Change: Refactor
Suggested reviewers: t3dotgg
9fdc6The reviewed send paths retain the expected terminal-context and attachment behavior. No actionable merge-blocking issue remains after normal checks.
Failed Failed checks: 1 warning
| Check name | Status | Explanation | Resolution |
|---|---|---|---|
| Description check | Warning | The description explains the refactor, its scope within ChatView, the retained dispatch behavior, and the verification performed. It does not provide the required Scope and approval section, and the P… | Add the required Problem and Scope and approval sections. State the expected behavior and reproduction context, then link the triaged issue or maintainer approval with the approval comment, or explain why this focused refactor qualifies for… |
| Check name | Status | Explanation |
|---|---|---|
| Title check | Passed | The title clearly and concisely identifies the main change: moving ChatView send preparation into pure functions in ChatView.logic. |
| 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. |
Explanation
The description explains the refactor, its scope within ChatView, the retained dispatch behavior, and the verification performed. It does not provide the required Scope and approval section, and the Problem content is not labeled with the template heading.
Resolution
Add the required Problem and Scope and approval sections. State the expected behavior and reproduction context, then link the triaged issue or maintainer approval with the approval comment, or explain why this focused refactor qualifies for an exemption.
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.