refactor(web): ChatView's model, mode, and workspace choices live in useComposerSelection#23069
Provider/model selection, runtime and interaction mode changes, env mode and start-from-origin changes, and the model-disabled reason move into chat/useComposerSelection.ts, which selects its own draft-store setters. Verbatim move.
| Before | After | |
|---|---|---|
ChatView.tsx lines | 4,415 | 4,271 |
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
- SkippedRustGitHub
- Skipped
- SkippedRelease SmokeGitHub
- SuccessfulTestGitHub
- SuccessfulBuild and TypecheckGitHub
- SuccessfulTest WebGitHub
- SuccessfulTest Server 3GitHub
- SuccessfulTest Server 1GitHub
- SuccessfulTest Server 8GitHub
- SuccessfulTest Server 5GitHub
- SuccessfulTest Server 4GitHub
- SuccessfulTest Server 6GitHub
- SuccessfulTest Server 7GitHub
- SuccessfulTest Server 2GitHub
- SuccessfulLintGitHub
- SuccessfulChangesGitHub
- SuccessfulCheckGitHub
- SkippedRustGitHub
- SkippedRelease SmokeGitHub
- Skipped
- SuccessfulTest WebGitHub
- SuccessfulTestGitHub
- SuccessfulBuild and TypecheckGitHub
- SuccessfulTest Server 6GitHub
- SuccessfulTest Server 4GitHub
- SuccessfulTest Server 3GitHub
- SuccessfulTest Server 8GitHub
- SuccessfulChangesGitHub
- SuccessfulTest Server 1GitHub
- SuccessfulTest Server 5GitHub
- SuccessfulTest Server 7GitHub
- SuccessfulTest Server 2GitHub
- SuccessfulLintGitHub
- FailedCheckGitHub
- Skipped
- SuccessfulLabel PR sizeGitHub
- SuccessfulLabel PR 23069GitHub
- SuccessfulPrepare PR size configGitHub
- SuccessfulCollect PR targetsGitHub
- Skipped
- Skipped
- SkippedRelease SmokeGitHub
- SkippedRustGitHub
- Skipped
- CancelledTestGitHub
- CancelledBuild and TypecheckGitHub
- CancelledTest WebGitHub
- SuccessfulTest Server 4GitHub
- SuccessfulTest Server 2GitHub
- SuccessfulTest Server 3GitHub
- SuccessfulTest Server 7GitHub
- SuccessfulChangesGitHub
- SuccessfulTest Server 6GitHub
- SuccessfulTest Server 8GitHub
- SuccessfulTest Server 5GitHub
- SuccessfulTest Server 1GitHub
- CancelledLintGitHub
- FailedCheckGitHub
- SkippedDeploy web previewGitHub
- SkippedEAS PreviewGitHub
- SuccessfulNative fingerprint diffGitHub
- Skipped
- SkippedRustGitHub
- SkippedRelease SmokeGitHub
- CancelledTestGitHub
- CancelledBuild and TypecheckGitHub
- CancelledTest WebGitHub
- SkippedDeploy web previewGitHub
- Skipped
- Skipped
- SuccessfulLabel PR 23069GitHub
- Skipped
- SuccessfulLabel PR sizeGitHub
- CancelledLabel PR 23069GitHub
- Skipped
- CancelledLabel PR sizeGitHub
- SkippedEAS PreviewGitHub
- SuccessfulTest Server 8GitHub
- SuccessfulTest Server 2GitHub
- SuccessfulTest Server 4GitHub
- CancelledLintGitHub
- SuccessfulTest Server 3GitHub
- SuccessfulTest Server 5GitHub
- SuccessfulTest Server 7GitHub
- SuccessfulChangesGitHub
- SuccessfulTest Server 1GitHub
- SuccessfulTest Server 6GitHub
- SuccessfulNative fingerprint diffGitHub
- Successful
- SuccessfulCollect PR targetsGitHub
- Successful
- SuccessfulPrepare PR size configGitHub
- SuccessfulPrepare PR size configGitHub
- SuccessfulCollect PR targetsGitHub
Approvability
Verdict: Approved at d7052be
Macroscope's review found this PR approvable — This refactor moves ChatView’s existing composer-selection logic into a dedicated hook while preserving its handlers, guards, state updates, navigation, and focus behavior. It introduces no new user-facing capability, schema change, product-default change, or static-analysis override.
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:
0476c458-7865-42f8-b30b-7f77bbda69c4
📥 Commits
Reviewing files that changed from the base of the PR and between 9a9e4191fa567f0279d7fa108911d7900a9a04e5 and d7052be1584ef4c21e11eed75ae43ddced5989f3.
📒 Files selected for processing: 1
apps/web/src/components/ChatView.tsx
Limit details: You’ve used all 10 included reviews currently available.
📝 Walkthrough
ChatViewnow delegates composer selection behavior touseComposerSelection. The hook manages runtime and interaction modes, provider and model selection, environment mode, start-from-origin updates, and related focus and navigation behavior.Changes: Composer selection
Layer / File(s) Summary Mode handlers and hook wiring
apps/web/src/components/chat/useComposerSelection.ts,apps/web/src/components/ChatView.tsxThe hook defines its input contract and runtime and interaction handlers. ChatViewsupplies state and dependencies to the hook and uses its returned handlers.Provider and model selection
apps/web/src/components/chat/useComposerSelection.ts,apps/web/src/components/ChatView.tsxThe hook handles provider and model selection, including restrictions and model-disable reasoning. ChatViewremoves the corresponding inline logic and imports.Environment and origin updates
apps/web/src/components/chat/useComposerSelection.ts,apps/web/src/components/ChatView.tsxThe hook handles environment-mode and start-from-origin updates and returns the selection handlers and model-disable resolver. Priority: ⬇️ Low
Estimated code review effort: 3 (Moderate) | ~20 minutes
Change: Refactor
Possibly related issues
- pingdotgg/t3code#22748: The hook includes provider and model selection checks for active sessions, but the supplied context says it does not address MCP or server-side session detachment.
- pingdotgg/t3code#22957: The PR extracts runtime-mode change handling, but it does not change server-side terminalization of approval-pending items.
Suggested reviewers:
t3dotgg
Merge Risk: ⚪ Minimal · up to d7052
This is a behavior-preserving move of composer selection logic into a hook. Review found no regression risk, so it is ready to merge after the 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 focused verification commands, but it does not provide the required Problem section or Scope and approval information. It also does not explicitly st… Add Problem and Scope and approval sections. Describe the underlying problem or refactoring goal, link the relevant issue or maintainer approval, or explain why this focused refactor qualifies for an exemption. State why screenshots are not… Passed Passed checks: 3 passed
Check name Status Explanation Title check Passed The title clearly and concisely identifies the main refactor: moving ChatView model, mode, and workspace selection logic into useComposerSelection. 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 focused verification commands, but it does not provide the required Problem section or Scope and approval information. It also does not explicitly state whether UI evidence is unnecessary because behavior remains unchanged.
Resolution
Add Problem and Scope and approval sections. Describe the underlying problem or refactoring goal, link the relevant issue or maintainer approval, or explain why this focused refactor qualifies for an exemption. State why screenshots are not applicable if the UI behavior is unchanged.
✨ 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.
Added 2 commits
Thread transfer impact
⚠️ The latest CI run did not produce a thread transfer result for d7052be.
This comment will update automatically after the next completed run.