refactor(web): ChatView's snooze, settle, and checkout actions live in useThreadLifecycle#23065

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

Snooze and settle (clock, wake timer, status line), the local checkout branch mismatch and its switch, stopping background work, child-thread and goal banners, opening related threads, and standalone slash commands move into chat/useThreadLifecycle.tsx. The hook selects its own commands and router. Verbatim move.

BeforeAfter
ChatView.tsx lines5,2494,881

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 5d20716

Macroscope's review found this PR approvable — This PR extracts existing ChatView lifecycle behavior into a dedicated hook without changing the supported actions, data contracts, defaults, or deployment behavior. The sizable new file is primarily relocated code, with the original call sites wired to the hook's equivalent outputs.

No code changes detected at 8d9cba7. 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: 93401616-3036-4b2b-81e7-f5b584345878
📥 Commits

Reviewing files that changed from the base of the PR and between 5d20716730454c7eaf856610e095f3a2677da20b and 8d9cba7c1581557dd11674d6b4bba366543be7aa.

📒 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 lifecycle state and actions to useThreadLifecycle. The hook manages lifecycle operations, related-thread navigation, banners, standalone commands, and status rendering.

Changes: Thread lifecycle

Layer / File(s)Summary
Lifecycle state and actions
apps/web/src/components/chat/useThreadLifecycle.tsx
The new hook manages snoozing, settlement, pinning, branch mismatch recovery, background work, related-thread navigation, standalone commands, banners, and status rendering.
ChatView integration
apps/web/src/components/ChatView.tsx
ChatView invokes the hook, removes its inline lifecycle implementation and unused imports, and continues to use useNavigate and useLocation for navigation data.

Priority: ⬇️ Low

Estimated code review effort: 3 (Moderate) | ~25 minutes

Change: Refactor

Possibly related issues

  • pingdotgg/t3code#4589: The PR moves the Settle action into useThreadLifecycle, but the supplied summary does not establish whether it fixes the reported client-view convergence issue.

Suggested reviewers: t3dotgg, maria-rcks

Merge Risk: ⚪ Minimal · up to 8d9cb

This refactor moves thread lifecycle behavior into a dedicated hook without any intended behavior change. No concrete risk was found, and the reported type-check, lint and test runs support merging.

Pre-merge checks: Passed 3 · Failed 1

Failed Failed checks: 1 warning

Check nameStatusExplanationResolution
Description checkWarningThe description explains the code change and lists focused verification results, but it omits the required Problem section and Scope and approval section.Add a Problem section that states the underlying problem and expected behavior. Add a Scope and approval section with the triaged issue or maintainer approval, or explain why this focused refactor qualifies for an exemption.
Passed Passed checks: 3 passed
Check nameStatusExplanation
Title checkPassedThe title is concise and accurately identifies the main refactor: moving ChatView snooze, settle, and checkout actions into useThreadLifecycle.
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.
✨ Finishing Touches: 💡 1
🛠️ Fix failing CI checks: 💡
  • Commit to this branch
  • Create a new PR
📝 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 snooze, settle, and checkout actions live in useThreadLifecycle8d9cba7
Synced from GitHub

Thread transfer impact

⚠️ The latest CI run did not produce a thread transfer result for 8d9cba7.

This comment will update automatically after the next completed run.