refactor(web): ChatView's revert, rollback, and fork live in useTimelineRewind#23066
Reverting to an earlier turn, rolling back a provider checkpoint, and forking from a run move into chat/useTimelineRewind.ts, with the commands only they use. Verbatim move.
| Before | After | |
|---|---|---|
ChatView.tsx lines | 4,881 | 4,715 |
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
- SkippedRelease SmokeGitHub
- Skipped
- SuccessfulBuild and TypecheckGitHub
- SuccessfulTest WebGitHub
- SuccessfulTestGitHub
- SuccessfulTest Server 4GitHub
- SuccessfulTest Server 6GitHub
- SuccessfulTest Server 2GitHub
- SuccessfulTest Server 7GitHub
- SuccessfulTest Server 3GitHub
- SuccessfulChangesGitHub
- SuccessfulTest Server 8GitHub
- SuccessfulTest Server 5GitHub
- SuccessfulTest Server 1GitHub
- SuccessfulLintGitHub
- SuccessfulCheckGitHub
- Skipped
- SkippedRelease SmokeGitHub
- SkippedRustGitHub
- SuccessfulBuild and TypecheckGitHub
- SuccessfulTest WebGitHub
- SuccessfulTestGitHub
- SuccessfulTest Server 8GitHub
- SuccessfulLintGitHub
- SuccessfulTest Server 2GitHub
- SuccessfulTest Server 5GitHub
- SuccessfulTest Server 1GitHub
- SuccessfulTest Server 4GitHub
- SuccessfulTest Server 6GitHub
- SuccessfulTest Server 3GitHub
- SuccessfulChangesGitHub
- SuccessfulTest Server 7GitHub
- FailedCheckGitHub
- Skipped
- SuccessfulLabel PR sizeGitHub
- SuccessfulLabel PR 23066GitHub
- SuccessfulCollect PR targetsGitHub
- SuccessfulPrepare PR size configGitHub
- SuccessfulNative fingerprint diffGitHub
- SkippedRustGitHub
- Skipped
- SkippedRelease SmokeGitHub
- CancelledTest WebGitHub
- CancelledBuild and TypecheckGitHub
- CancelledTestGitHub
- SuccessfulTest Server 3GitHub
- SuccessfulTest Server 6GitHub
- SuccessfulTest Server 7GitHub
- SuccessfulTest Server 2GitHub
- SuccessfulTest Server 8GitHub
- CancelledLintGitHub
- SuccessfulTest Server 4GitHub
- SuccessfulTest Server 1GitHub
- SuccessfulTest Server 5GitHub
- SuccessfulChangesGitHub
- Skipped
- Skipped
- Skipped
- Skipped
- SuccessfulLabel PR sizeGitHub
- Skipped
- CancelledLabel PR sizeGitHub
- Skipped
- SuccessfulLabel PR 23066GitHub
- CancelledLabel PR 23066GitHub
- SuccessfulNative fingerprint diffGitHub
- CancelledRelease SmokeGitHub
- CancelledBuild and TypecheckGitHub
- CancelledTestGitHub
- CancelledRustGitHub
- CancelledTest WebGitHub
- Cancelled
- FailedCheckGitHub
- SkippedDeploy web previewGitHub
- SkippedEAS PreviewGitHub
- SkippedDeploy web previewGitHub
- CancelledTest Server 8GitHub
- CancelledTest Server 2GitHub
- CancelledTest Server 5GitHub
- CancelledTest Server 7GitHub
- SkippedEAS PreviewGitHub
- CancelledTest Server 1GitHub
- CancelledTest Server 4GitHub
- CancelledTest Server 3GitHub
- CancelledTest Server 6GitHub
- CancelledChangesGitHub
- CancelledNative fingerprint diffGitHub
- CancelledLintGitHub
- SuccessfulCollect PR targetsGitHub
- SuccessfulPrepare PR size configGitHub
- SuccessfulPrepare PR size configGitHub
- SuccessfulCollect PR targetsGitHub
Approvability
Verdict: Approved at 714fe8c
Macroscope's review found this PR approvable — This PR extracts existing timeline rewind, checkpoint rollback, and fork handlers into a dedicated hook while preserving their inputs, guards, commands, errors, and navigation. It is a contained code-organization change with no product-default or static-analysis configuration impact.
No code changes detected at 1ff7eb6. 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:
4a9e1388-bc73-4dd9-8d29-6d5588e675b4
📥 Commits
Reviewing files that changed from the base of the PR and between 714fe8cbfa2e542802962355f8fc8079d4c20168 and 1ff7eb67cc7e5266492ee1700ce5883548ed37ba.
📒 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 timeline rewind, checkpoint rollback, and run forking touseTimelineRewind. The hook validates state, handles confirmations and commands, reports failures, restores prompts, and navigates to forked threads.Changes: Timeline rewind and forking
Layer / File(s) Summary Rewind contract and turn handling
apps/web/src/components/chat/useTimelineRewind.tsThe hook accepts timeline operation inputs. It validates turn rewind conditions, runs rewinds, reports failures, and restores the prompt. Checkpoint rollback
apps/web/src/components/chat/useTimelineRewind.tsThe hook validates rollback availability and busy state, handles confirmation, tracks rewind state, executes rollback commands, and reports applicable failures. Run forking and ChatView integration
apps/web/src/components/chat/useTimelineRewind.ts,apps/web/src/components/ChatView.tsxThe hook creates and navigates to forked threads and exposes stable timeline handlers. ChatViewwires the hook and removes the corresponding inline implementations and unused imports.Priority: ➖ Normal
Estimated code review effort: 3 (Moderate) | ~25 minutes
Change: Refactor
Possibly related issues
- pingdotgg/t3code#23016 — The pull request moves rollback and revert actions into
useTimelineRewind, but does not fix the provider turn lifecycle. - pingdotgg/t3code#23050 — The pull request moves fork-from-run handling into the hook, but does not implement the Pi adapter fix for forking during a later running turn.
Suggested reviewers:
t3dotgg- pingdotgg/t3code#23016 — The pull request moves rollback and revert actions into
Merge Risk: ⚪ Minimal · up to 1ff7e
This is a behavior-preserving refactor of ChatView's revert, rollback, and fork actions. No regression was found in the extracted handlers, and no merge-blocking risk remains.
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, but it omits the required Problem and Scope and approval sections. It also does not describe observed verification results in suffic… Add the required Problem, Change, Scope and approval, and Verification headings. Describe the prior problem or expected behavior, provide the relevant issue or maintainer approval and scope rationale, and record the observed results and any… Passed Passed checks: 3 passed
Check name Status Explanation Title check Passed The title clearly identifies the main change: moving ChatView revert, rollback, and fork logic into useTimelineRewind. 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, but it omits the required Problem and Scope and approval sections. It also does not describe observed verification results in sufficient detail.
Resolution
Add the required Problem, Change, Scope and approval, and Verification headings. Describe the prior problem or expected behavior, provide the relevant issue or maintainer approval and scope rationale, and record the observed results and any checks that could not be 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 revert, rollback, and fork live in useTimelineRewind1ff7eb6
Thread transfer impact
⚠️ The latest CI run did not produce a thread transfer result for 1ff7eb6.
This comment will update automatically after the next completed run.