Add expandable command and file-change activity boxes#3173
Conversation
…activity-boxes # Conflicts: # apps/web/src/components/chat/MessagesTimeline.browser.tsx
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
ApprovabilityVerdict: Needs human review This PR introduces new user-facing functionality (expandable command and file-change activity boxes) with multiple new React components, new state management, and substantial logic for command output extraction and patch normalization. New features of this scope warrant human review. You can customize Macroscope's approvability policy. Learn more. |
- Treat whitespace-only stdout as absent\n- Fall back to aggregated command output
- Keep blank stream chunks for live command updates - Avoid synthetic separators around whitespace chunks
- Preserve incremental chunks without injecting separators - Keep blank-only raw output content during tool updates - Avoid trim allocation when checking command output
This reverts commit de5480b.
This reverts commit c0fe7fa.
This reverts commit d1583db.
There was a problem hiding this comment.
Effect service conventions: one issue found in the newly added SourceControlPanelService. See inline comment.
Posted via Macroscope — Effect Service Conventions
There was a problem hiding this comment.
Effect service convention review: one issue found in newly added server error modeling. See inline comment.
Posted via Macroscope — Effect Service Conventions
0b3dd97 to
70b8635
Compare
- Move supplemental detail helpers into shared logic - Add coverage for command and file change detail expansion
- Guard collab-agent activity before request-kind checks - Cover command and file-change request-kind regressions
- Normalize command output dedupe comparisons - Cover command and patch activity edge cases
…activity-boxes # Conflicts: # apps/web/src/components/chat/MessagesTimeline.tsx
- Move detail derivation into MessagesTimeline.logic - Reuse shared helpers for command, file, and preview display - Keep command output truncation and file chips consistent
- Add a cheap expandable-details predicate for timeline rows - Derive full command details only after a row is expanded
- Show changed-file previews for file-change rows with commands - Ignore nested control key events in expandable work rows
Summary
This adds richer expandable activity boxes for command and file-change work-log rows in the chat timeline. Command rows can now show the command, raw command, exit code, duration, stdout/stderr or fallback output, and file-change rows can show changed paths plus inline unified diffs when patch data is available.
The implementation keeps this data in the derived work-log model, extracts command result and patch metadata from provider payloads, and renders the richer details without losing the existing compact row behavior.
What Changed
WorkLogEntry, including stdout, stderr, fallback output, exit code, and duration.MessagesTimelinewith command/raw-command sections, status chips, tail-truncated output, and full-output expansion.MessagesTimelinewith changed-file chips and inline diff rendering through the existing diff rendering utilities.MessagesTimeline.logic.tssoMessagesTimeline.tsxnow consumes derived detail objects while preserving upstreamwork-togglerow modeling and anchored-list behavior.Why
Individual command and diff events are mostly opaque currently. We can somewhat see what the agent is doing, but we don't have a clear picture of what each command actually outputs, or what each file change actually produced.
Usually that's fine, most times we inspect the end result and trust the agent. Sometimes it's good to inspect a little deeper. For commands we can help steer by debugging their output, or just compare the results with manual runs. For diffs we can see better follow along the multiple changes an agent makes, or even inspect changes to git-ignored files (which don't appear on the main diff panel).
Validation
(cd apps/web && pnpm exec vp test run --passWithNoTests --project unit src/session-logic.test.ts)passed: 1 file, 79 tests.(cd apps/web && pnpm exec vp test run --passWithNoTests --project unit src/components/chat/MessagesTimeline.test.tsx)passed: 1 file, 13 tests.pnpm exec vp run --filter @t3tools/web test -- src/components/chat/MessagesTimeline.test.tsxpassed on the final branch state: 145 files, 1318 tests.pnpm exec vp run --filter @t3tools/web test -- src/session-logic.test.ts src/components/chat/MessagesTimeline.logic.test.ts src/components/chat/MessagesTimeline.test.tsxpassed after the activity-detail review fixes: 140 files, 1240 tests.pnpm exec vp run --filter @t3tools/web test -- src/session-logic.test.ts src/components/chat/MessagesTimeline.logic.test.tspassed after the final activity-detail review fixes: 140 files, 1242 tests.(cd apps/web && pnpm exec vp test run --passWithNoTests --project unit src/components/chat/MessagesTimeline.test.tsx src/components/chat/MessagesTimeline.logic.test.ts src/session-logic.test.ts)passed after the post-merge derivation refactor: 3 files, 150 tests.(cd apps/web && pnpm exec vp test run --passWithNoTests --project unit src/components/chat/MessagesTimeline.logic.test.ts src/components/chat/MessagesTimeline.test.tsx)passed after the latest activity-detail review fixes: 2 files, 64 tests.git diff --checkpassed.pnpm exec vp checkpassed with 20 existing warnings outside this branch's changed files.pnpm exec vp run typecheckpassed across all packages.Proof
before:

after:

expanded command output with tail truncation:

expanded inline file-change diffs:

Note
Medium Risk
Touches work-log parsing and output-merge heuristics across many provider payload shapes; regressions could mis-order streams or show wrong command/diff content, but scope is UI/session derivation with broad unit coverage.
Overview
Chat timeline work-log rows can expand into structured detail instead of a single generic
<pre>block.Data layer (
session-logic) —WorkLogEntrynow carries command streams (stdout/stderr/legacyoutput), exit code, duration, and unified patch text. Tool activities are parsed from nested provider payloads (including Codex-style file changes normalized to unified diffs). Incrementaltool.updatedoutput is merged with heuristics so cumulative streams grow without shorter snapshots overwriting longer ones; same-timestamp ordering is stabilized for streamed updates vs unrelated events.Presentation (
MessagesTimeline) — Expandable rows use logic moved intoMessagesTimeline.logic: command sections (raw command, status chips, stdout/stderr with 40-line tail truncation and expand), file-change chips plus inline diffs via existing diff components, and a generic fallback (e.g. MCP JSON). Collab-agent rows stay out of command/file expansion; keyboard/aria-expandedbehavior is tightened.Tests — Large additions cover extraction, merging, expansion rules, and static timeline markup for command/file rows.
Reviewed by Cursor Bugbot for commit a52db95. Bugbot is set up for automated code reviews on this repo. Configure here.
Note
Add expandable command and file-change activity boxes to the session work log
SimpleWorkEntryRowin MessagesTimeline.tsx gains an expand/collapse toggle that renders structured details: command metadata with individually expandable outputs, and inline unified diffs with per-file headers and diff stats for file-change entries.aria-expandedand descriptivearia-labelare added to work entry rows; keyboard toggle is gated to row-level events viashouldToggleWorkEntryRowFromKeyDown.Macroscope summarized a52db95.