refactor(web): timeline work group and live activity rows live in their own file#22675

merged1
refactor/messages-timeline-work-entry-rows
refactor/messages-timeline-work-group-rows
opened3d agobyJJulius Marminge
View on GitHubTwo-way sync enabledPR last imported 3d ago

Part of the MessagesTimeline split. This layer moves the work group section, its toggle and header, the live work-entry, thinking and working rows, and the working timer into TimelineWorkGroupRows.tsx. The timer formatting helpers go to TimelineWorkGroupRows.logic.ts.

FileBeforeAfter
MessagesTimeline.tsx4,2793,653
TimelineWorkGroupRows.tsx–640

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 work group and live activity rows live in their own file46d59b6
Synced from GitHub

Approvability

Verdict: Approved at 46d59b6

Macroscope's review found this PR approvable — This is a mechanical extraction of existing timeline work-group and live-activity row code into dedicated files, with equivalent imports and unchanged runtime logic. It introduces no new capability, configuration change, or production-side effect.

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: 99359e93-e4f3-444a-8d39-df3bfb43b0ab
📥 Commits

Reviewing files that changed from the base of the PR and between 39d56c9f958192fdbf6fcc33cb3f0ec31832497c and 46d59b6f6d681ffa224ea455145fb9e0ee7356f7.

📒 Files selected for processing: 3
  • apps/web/src/components/chat/MessagesTimeline.tsx
  • apps/web/src/components/chat/TimelineWorkGroupRows.logic.ts
  • apps/web/src/components/chat/TimelineWorkGroupRows.tsx

Limit details: You’ve used all 10 included reviews currently available.

📝 Walkthrough

Work-group timeline rendering moved from MessagesTimeline.tsx into dedicated components. The extracted components render work-group entries, working and thinking states, and expanded groups. A utility formats elapsed working time.

Changes: Timeline work-group rendering

Layer / File(s)Summary
Working and activity rows
apps/web/src/components/chat/TimelineWorkGroupRows.logic.ts, apps/web/src/components/chat/TimelineWorkGroupRows.tsx
Added working-time formatting and components for working, thinking, and live activity rows, including worktree setup progress and failure presentation.
Work-group composition and expansion
apps/web/src/components/chat/TimelineWorkGroupRows.tsx
Added work-group rendering, virtualized expanded entries, scroll-anchor handling, and group controls.
MessagesTimeline integration
apps/web/src/components/chat/MessagesTimeline.tsx
Imported the extracted components and removed the local work-log implementations and related imports.

Priority: ⬇️ Low

Estimated code review effort: 4 (Complex) | ~45 minutes

Change: Refactor

Merge Risk: ⚪ Minimal · up to 46d59

This refactor moves the work-group and live activity row components into their own file without intended behavior changes. No actionable merge-blocking risk was identified.

Pre-merge checks: Passed 3 · Failed 1

Failed Failed checks: 1 warning

Check nameStatusExplanationResolution
Description checkWarningThe description explains the refactor and includes detailed verification results, but it omits the required Problem and Scope and approval sections. It also does not provide the required before/after …Add a Problem section with the expected behavior and context. Add the triaged issue or maintainer approval and scope rationale. Add before/after screenshots, or explicitly justify why visual evidence is not applicable for this refactor.
Passed Passed checks: 3 passed
Check nameStatusExplanation
Title checkPassedThe title clearly and concisely describes the main refactor: moving timeline work-group and live activity rows into a separate file.
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 includes detailed verification results, but it omits the required Problem and Scope and approval sections. It also does not provide the required before/after UI evidence or explain why screenshots are not applicable.

Resolution

Add a Problem section with the expected behavior and context. Add the triaged issue or maintainer approval and scope rationale. Add before/after screenshots, or explicitly justify why visual evidence is not applicable for this refactor.

✨ 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.