refactor(web): timeline assistant and orchestration event rows live in their own files#22677

merged1
refactor/messages-timeline-user-message-rows
refactor/messages-timeline-assistant-event-rows
opened4d agobyJJulius Marminge
View on GitHubTwo-way sync enabledPR last imported 4d ago

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.

FileBeforeAfter
MessagesTimeline.tsx2,4361,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.

InteractionBefore: commits / renders / timeline renders / nested peakAfter
Scroll an 8.5k-item thread up 40 × 150px43 / 1,656 / 70 / 044 / 1,670 / 70 / 0
Load earlier turns, then scroll up 60 × 300px107 / 5,316 / 356 / 0104 / 5,275 / 356 / 0
Agent streams a 20-line reply (561-item thread)63 / 3,092 / 164 / 155 / 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 run MessagesTimeline logic, active-tools, and browser tests, plus timelineScrollAnchoring
  • reactCompilerCoverage for every touched and new file (0 bailouts)
  • tsc-rs --noEmit for apps/web, vp lint on changed files

🤖 Generated with Claude Code

Checks

All checks passed

Added 1 commit

  • refactor(web): timeline assistant and orchestration event rows live in their own files1637084
Synced from GitHub

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.

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: 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.tsx
  • apps/web/src/components/chat/TimelineAssistantRows.tsx
  • apps/web/src/components/chat/TimelineV2EventRow.logic.ts
  • apps/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. MessagesTimeline imports 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.tsx
Adds 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.tsx
Adds event presentation and subagent timing logic, plus event and expandable subagent-group rendering.
Timeline imports and row delegation
apps/web/src/components/chat/MessagesTimeline.tsx
Imports 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 nameStatusExplanationResolution
Description checkWarningThe 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 nameStatusExplanation
Title checkPassedThe title clearly describes the primary refactor: moving timeline assistant and orchestration event rows into separate files.
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 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

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.