refactor(web): timeline assistant and orchestration event rows live in their own files#22677
Part of the MessagesTimeline split. This layer moves the assistant, assistant-meta, proposed-plan, HTML-render and MCP-app rows (with the copy and fork buttons and the changed-files section) into TimelineAssistantRows.tsx. The orchestration event row and subagent group go to TimelineV2EventRow.tsx, and their pure presentation helpers go to TimelineV2EventRow.logic.ts.
| File | Before | After |
|---|---|---|
| MessagesTimeline.tsx | 2,436 | 1,644 |
| TimelineAssistantRows.tsx | – | 366 |
| TimelineV2EventRow.tsx | – | 321 |
Measurements
Dev app on a seeded copy of real data, median of 3, React renders counted by the commit-root counter (only fibers React actually rendered). "Before" is main at 6a6c84f990; "after" is the top of this stack. Nested update peak comes from a probe in react-dom's getRootForUpdatedFiber.
| Interaction | Before: commits / renders / timeline renders / nested peak | After |
|---|---|---|
| Scroll an 8.5k-item thread up 40 × 150px | 43 / 1,656 / 70 / 0 | 44 / 1,670 / 70 / 0 |
| Load earlier turns, then scroll up 60 × 300px | 107 / 5,316 / 356 / 0 | 104 / 5,275 / 356 / 0 |
| Agent streams a 20-line reply (561-item thread) | 63 / 3,092 / 164 / 1 | 55 / 2,728 / 139 / 0 |
The extractions keep every component, context, and hook boundary unchanged, so render counts match within run-to-run noise. Streaming numbers vary with reply length. The win is readability: each row family is now a file you can read on its own, and the React Compiler caches each one independently. The legend-list wiring is unchanged. That covers getItemType with its length buckets (#21269), TimelineRowCtx inside renderItem with extraData carrying sharedState (#21123), and scroll restore. No update loops appeared while loading earlier turns.
Tests
vp test runMessagesTimeline logic, active-tools, and browser tests, plustimelineScrollAnchoringreactCompilerCoveragefor every touched and new file (0 bailouts)tsc-rs --noEmitfor apps/web,vp linton changed files
🤖 Generated with Claude Code
Checks
- SuccessfulCodeRabbitGitHub
Review completed
- Successful
Skipped - Not affected
- Skipped
- Skipped
- Skipped
- SuccessfulRemove preview downloadGitHub
- Skipped
- SuccessfulLabel PR sizeGitHub
- SuccessfulLabel PR 22677GitHub
- Successful
- Successful
- Successful
- SuccessfulCollect PR targetsGitHub
- SuccessfulPrepare PR size configGitHub
- Successful
- SuccessfulCheckGitHub
- Skipped
- SkippedRelease SmokeGitHub
- SkippedRustGitHub
- SuccessfulTestGitHub
- SuccessfulTest WebGitHub
- SuccessfulBuild and TypecheckGitHub
- SuccessfulLabel PR 22677GitHub
- Skipped
- SuccessfulLabel PR sizeGitHub
- SkippedEAS PreviewGitHub
- SuccessfulCollect PR targetsGitHub
- SuccessfulPrepare PR size configGitHub
- SuccessfulTest Server 5GitHub
- SuccessfulTest Server 1GitHub
- SuccessfulTest Server 2GitHub
- SuccessfulTest Server 6GitHub
- SuccessfulTest Server 7GitHub
- SuccessfulTest Server 4GitHub
- SuccessfulTest Server 3GitHub
- SuccessfulLintGitHub
- SuccessfulTest Server 8GitHub
- SuccessfulNative fingerprint diffGitHub
- SuccessfulChangesGitHub
Added 1 commit
- refactor(web): timeline assistant and orchestration event rows live in their own files1637084
Approvability
Verdict: Approved at 1637084
Macroscope's review found this PR approvable — This refactor moves existing assistant and orchestration timeline rows, plus pure helpers, into focused files while preserving the existing dispatch, contexts, hooks, and rendering behavior. It adds no user-facing capability, product-default change, or static-analysis suppression.
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:
d3c4260e-1ff4-4ad1-a5bb-06d8edf2fa0c
📥 Commits
Reviewing files that changed from the base of the PR and between 2ff9ebcfd1b473f4b058cfd0499186eb0ead8f35 and 1637084a952a326e21b87ba3a1d6d9a029f633de.
📒 Files selected for processing: 4
apps/web/src/components/chat/MessagesTimeline.tsxapps/web/src/components/chat/TimelineAssistantRows.tsxapps/web/src/components/chat/TimelineV2EventRow.logic.tsapps/web/src/components/chat/TimelineV2EventRow.tsx
Limit details: You’ve used all 10 included reviews currently available.
📝 Walkthrough
Assistant and V2 event row implementations now reside in dedicated modules.
MessagesTimelineimports these components and no longer contains their local rendering implementations.Changes: Chat timeline row extraction
Layer / File(s) Summary Assistant and embedded-content rows
apps/web/src/components/chat/TimelineAssistantRows.tsxAdds components for assistant messages and metadata, proposed plans, HTML renders, MCP apps, and changed-file sections. V2 event and subagent rows
apps/web/src/components/chat/TimelineV2EventRow.logic.ts,apps/web/src/components/chat/TimelineV2EventRow.tsxAdds event presentation and subagent timing logic, plus event and expandable subagent-group rendering. Timeline imports and row delegation
apps/web/src/components/chat/MessagesTimeline.tsxImports the dedicated row components and removes their local implementations and associated dependencies. Priority: ⬇️ Low
Estimated code review effort: 3 (Moderate) | ~25 minutes
Change: Refactor
Merge Risk: ⚪ Minimal · up to 16370
This refactor moves timeline row components into dedicated files without a stated behavior change. No actionable merge-blocking risk was found in the supplied context.
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 provides detailed measurements and verification results. It does not include the required Problem or Scope and approval sections, and it does not provide the … Add the Problem section with expected behavior and context. Add the Scope and approval section with the issue or maintainer approval, or explain why an exemption applies. Add before-and-after screenshots for the UI changes, and include a re… Passed Passed checks: 3 passed
Check name Status Explanation Title check Passed The title clearly describes the primary refactor: moving timeline assistant and orchestration event rows into separate files. 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 provides detailed measurements and verification results. It does not include the required Problem or Scope and approval sections, and it does not provide the required before-and-after UI screenshots.
Resolution
Add the Problem section with expected behavior and context. Add the Scope and approval section with the issue or maintainer approval, or explain why an exemption applies. Add before-and-after screenshots for the UI changes, and include a recording if interaction or timing details require it.
✨ 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: 4
- Charged: $1.00
- 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.