refactor(web): ChatView's revert, rollback, and fork live in useTimelineRewind#23066

merged1
refactor/split2-chatview-thread-actions
refactor/split2-chatview-revert
opened2d agobyJJulius Marminge
View on GitHubTwo-way sync enabledPR last imported 2d ago

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.

BeforeAfter
ChatView.tsx lines4,8814,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

All checks passed
Synced from GitHub

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.

Synced from GitHub

Review in Change Stack →

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

ChatView now delegates timeline rewind, checkpoint rollback, and run forking to useTimelineRewind. 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.ts
The 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.ts
The 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.tsx
The hook creates and navigates to forked threads and exposes stable timeline handlers. ChatView wires 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

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 nameStatusExplanationResolution
Description checkWarningThe 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 nameStatusExplanation
Title checkPassedThe title clearly identifies the main change: moving ChatView revert, rollback, and fork logic into useTimelineRewind.
Linked Issues checkPassedCheck skipped because no linked issues were found for this pull request.
Out of Scope Changes checkPassedCheck 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

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
Synced from GitHub

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.