refactor(web): ChatView's thread derivations are tested functions in ChatView.logic#23071
Four render-time IIFEs were pure derivations of the thread projection. They become named functions in ChatView.logic.ts: the shell built from a directly loaded detail, pending background work, the runs a conversation can revert to, and the workspace mutation key. deriveAvailableRevertTurnCounts and deriveWorkspaceMutationId get focused tests.
| Before | After | |
|---|---|---|
ChatView.tsx lines | 4,190 | 4,072 |
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
- SkippedRelease SmokeGitHub
- SkippedRustGitHub
- Skipped
- SuccessfulTestGitHub
- SuccessfulBuild and TypecheckGitHub
- SuccessfulTest WebGitHub
- SuccessfulTest Server 5GitHub
- SuccessfulTest Server 2GitHub
- SuccessfulTest Server 7GitHub
- SuccessfulTest Server 8GitHub
- SuccessfulTest Server 1GitHub
- SuccessfulTest Server 6GitHub
- SuccessfulChangesGitHub
- SuccessfulTest Server 4GitHub
- SuccessfulTest Server 3GitHub
- SuccessfulLintGitHub
- SuccessfulCheckGitHub
- SkippedRelease SmokeGitHub
- SkippedRustGitHub
- Skipped
- SuccessfulBuild and TypecheckGitHub
- SuccessfulTest WebGitHub
- SuccessfulTestGitHub
- SuccessfulTest Server 8GitHub
- SuccessfulTest Server 4GitHub
- SuccessfulTest Server 5GitHub
- SuccessfulTest Server 1GitHub
- SuccessfulTest Server 7GitHub
- SuccessfulTest Server 3GitHub
- SuccessfulTest Server 6GitHub
- SuccessfulChangesGitHub
- SuccessfulTest Server 2GitHub
- SuccessfulLintGitHub
- FailedCheckGitHub
- SuccessfulLabel PR 23071GitHub
- Skipped
- SuccessfulLabel PR sizeGitHub
- SuccessfulCollect PR targetsGitHub
- SuccessfulPrepare PR size configGitHub
- Skipped
- SkippedRelease SmokeGitHub
- SkippedRustGitHub
- CancelledBuild and TypecheckGitHub
- CancelledTestGitHub
- CancelledTest WebGitHub
- SuccessfulTest Server 3GitHub
- CancelledTest Server 6GitHub
- SuccessfulTest Server 7GitHub
- CancelledTest Server 5GitHub
- CancelledTest Server 4GitHub
- SuccessfulTest Server 2GitHub
- CancelledTest Server 8GitHub
- CancelledLintGitHub
- SuccessfulTest Server 1GitHub
- SuccessfulChangesGitHub
- FailedCheckGitHub
- SkippedEAS PreviewGitHub
- SkippedDeploy web previewGitHub
- SuccessfulNative fingerprint diffGitHub
- Skipped
- SkippedRustGitHub
- SkippedRelease SmokeGitHub
- CancelledBuild and TypecheckGitHub
- CancelledTest WebGitHub
- CancelledTestGitHub
- SkippedDeploy web previewGitHub
- Skipped
- Skipped
- SuccessfulLabel PR 23071GitHub
- Skipped
- SuccessfulLabel PR sizeGitHub
- Skipped
- CancelledLabel PR 23071GitHub
- SuccessfulTest Server 4GitHub
- SuccessfulTest Server 5GitHub
- SuccessfulTest Server 8GitHub
- SuccessfulTest Server 6GitHub
- SuccessfulTest Server 2GitHub
- SuccessfulTest Server 3GitHub
- SuccessfulTest Server 1GitHub
- SkippedEAS PreviewGitHub
- SuccessfulChangesGitHub
- SuccessfulTest Server 7GitHub
- CancelledLintGitHub
- SuccessfulNative fingerprint diffGitHub
- Skipped
- CancelledLabel PR sizeGitHub
- Skipped
- SuccessfulCollect PR targetsGitHub
- SuccessfulPrepare PR size configGitHub
- SuccessfulPrepare PR size configGitHub
- SuccessfulCollect PR targetsGitHub
Approvability
Verdict: Approved at 34ef2a8
Macroscope's review found this PR approvable — This PR extracts existing ChatView derivations into tested pure helpers and rewires the same production paths to use them. The accompanying test changes are harness-only, with no new capability, schema impact, defaults change, or static-analysis suppression.
No code changes detected at 9d1b048. 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:
5e5c4e35-083d-4f32-9633-574eed513d04
📥 Commits
Reviewing files that changed from the base of the PR and between 34ef2a8f39c2910749e97351bf37588dbe5dcf13 and 9d1b04843931bceefe82d0296b3dd27f072b636d.
📒 Files selected for processing: 1
apps/web/src/components/ChatView.tsx
Limit details: You’ve used all 10 included reviews currently available.
📝 Walkthrough
ChatView now delegates thread-shell presentation, pending background-task selection, available revert-turn counts, and workspace mutation ID derivation to shared logic functions. Tests cover the new derivation conditions and results.
Changes: ChatView projection derivations
Layer / File(s) Summary Thread presentation and background tasks
apps/web/src/components/ChatView.logic.ts,apps/web/src/components/ChatView.tsxShared helpers derive thread-shell fields and pending background tasks from projections. ChatView delegates these calculations to the helpers. Revert turns and workspace mutation IDs
apps/web/src/components/ChatView.logic.ts,apps/web/src/components/ChatView.tsx,apps/web/src/components/ChatView.logic.test.tsHelpers derive available revert turns and workspace mutation IDs. ChatView uses the helpers, and tests cover provider-session, provider-thread, completion, and empty-state conditions. Priority: ⬇️ Low
Estimated code review effort: 3 (Moderate) | ~20 minutes
Change: Refactor
Possibly related issues
- pingdotgg/t3code#23041 — Both changes refactor and test
ChatViewtimeline or projection derivations that affect thread loading and conversation-pane state.
Suggested reviewers:
t3dotgg- pingdotgg/t3code#23041 — Both changes refactor and test
Merge Risk: ⚪ Minimal · up to 9d1b0
The extracted thread calculations preserve the previous behavior, and no merge-blocking issue was found.
Pre-merge checks: Passed 3 · Failed 1
Failed Failed checks: 1 warning
Check name Status Explanation Resolution Description check Warning The description explains the refactor and lists focused validation results, but it omits the required Problem section and provides no Scope and approval information. It also does not clearly state exp… Add the required Problem section with the affected behavior and context. Add Scope and approval details with the triaged issue or maintainer approval, or explain why an exemption applies. Keep the existing Change and Verification details, i… Passed Passed checks: 3 passed
Check name Status Explanation Title check Passed The title clearly and concisely describes the main change: moving ChatView thread derivations into tested 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.
Full details: Description check
Explanation
The description explains the refactor and lists focused validation results, but it omits the required Problem section and provides no Scope and approval information. It also does not clearly state expected behavior or reproduction context.
Resolution
Add the required Problem section with the affected behavior and context. Add Scope and approval details with the triaged issue or maintainer approval, or explain why an exemption applies. Keep the existing Change and Verification details, including observed results and any checks not run.
✨ 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 1 commit
- refactor(web): ChatView's thread derivations are tested functions in ChatView.logic9d1b048
Thread transfer impact
⚠️ The latest CI run did not produce a thread transfer result for 9d1b048.
This comment will update automatically after the next completed run.