Skip to content

Add expandable command and file-change activity boxes#3173

Open
Quicksaver wants to merge 9 commits into
pingdotgg:mainfrom
Quicksaver:split/file-command-activity-boxes
Open

Add expandable command and file-change activity boxes#3173
Quicksaver wants to merge 9 commits into
pingdotgg:mainfrom
Quicksaver:split/file-command-activity-boxes

Conversation

@Quicksaver

@Quicksaver Quicksaver commented Jun 19, 2026

Copy link
Copy Markdown

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

  • Preserved command output metadata in WorkLogEntry, including stdout, stderr, fallback output, exit code, and duration.
  • Added bounded file-change patch extraction from provider payloads, including Codex-style nested file-change records and simple content diffs normalized into unified patches.
  • Kept stable arrival order for unsequenced same-timestamp activity events so streamed output chunks are not scrambled by random event ids.
  • Added expandable command details in MessagesTimeline with command/raw-command sections, status chips, tail-truncated output, and full-output expansion.
  • Added expandable file-change details in MessagesTimeline with changed-file chips and inline diff rendering through the existing diff rendering utilities.
  • Kept generic tool expansion behavior for rows that are neither command nor file-change details.
  • Added focused coverage for command output extraction, output merging, file-change patch extraction, renderable command output helpers, and timeline rendering of command/file-change rows.

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

  • pnpm exec vp check passed. It reported 20 existing lint warnings outside this branch's changed files.
  • pnpm exec vp run typecheck passed across all packages.
  • 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.tsx passed, running the @t3tools/web unit test project with 121 files and 1116 tests.

Proof

before:
before

after:
after

expanded command output with tail truncation:
Screenshot 2026-06-09 at 09 32 11

expanded inline file-change diffs:
Screenshot 2026-06-09 at 09 34 06


Note

Medium Risk
Touches activity ordering and broad provider payload parsing in session-logic, which can affect timeline ordering and displayed tool output; UI changes are localized to chat work rows.

Overview
Adds expandable detail panels for command and file-change rows in the chat work log, so users can inspect stdout/stderr, exit codes, durations, and inline diffs without leaving the timeline.

Data layer (session-logic): WorkLogEntry now carries command result fields (stdout, stderr, output, exitCode, durationMs) and patch, populated from provider payloads (including Codex-style nested shapes). Incremental tool.updatedtool.completed streams merge via prefix-aware concatenation. File-change patches are extracted with bounded depth/size limits and Codex content diffs are normalized to unified patches. Same-timestamp activity ordering no longer breaks ties on event id (preserves arrival order for streamed chunks).

UI (MessagesTimeline): Work rows expand into structured sections—command blocks with tail-truncated output (last 40 lines, full expand), file-change blocks with FileDiff or path chips, and generic fallback for other tools. Expansion is gated by item type so non-command tools (e.g. web search) do not treat stdout as command output. Helpers hasRenderableCommandOutput / getRenderableCommandOutputLines trim outer blank lines while keeping intentional blank lines inside output.

Tests: Coverage for extraction, merging, patch normalization, renderable output helpers, and static markup for expandable command/file-change rows.

Reviewed by Cursor Bugbot for commit 19abc64. Bugbot is set up for automated code reviews on this repo. Configure here.

Note

Add expandable command and file-change activity boxes to the chat timeline

  • Work entries in MessagesTimeline now show expand/collapse controls with aria labels; expanded rows render structured command or file-change details instead of raw text.
  • Command details include the command string, exit code/duration badges, and stdout/stderr output blocks truncated to the last 40 lines by default with a toggle for the full view.
  • File-change details show inline unified diffs with per-file headers (path and +/- stats) or a fallback list of changed file badges; raw patch text is shown when no structured diff is available.
  • WorkLogEntry in session-logic.ts gains stdout, stderr, output, exitCode, durationMs, and patch fields, populated by new extraction helpers that normalize heterogeneous provider payload shapes.
  • Streaming command output chunks are merged cumulatively via mergeTextOutput; a tiebreaker fix in compareActivitiesByOrder preserves arrival order for same-timestamp events instead of scrambling by id.

Macroscope summarized 19abc64.

@coderabbitai

coderabbitai Bot commented Jun 19, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: e754c85d-11e1-4c39-bf36-aaaab81529ae

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions github-actions Bot added vouch:unvouched PR author is not yet trusted in the VOUCHED list. size:XL 500-999 changed lines (additions + deletions). labels Jun 19, 2026

@cursor cursor Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes using high effort and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 19abc64. Configure here.

stdout ??
firstRawStringFromRecord(rawOutput, ["content", "output", "text", "result"]) ??
firstRawStringFromRecord(itemResult, ["content", "output", "text", "result"]) ??
firstRawStringFromRecord(item, ["aggregatedOutput", "output", "text", "result"]);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Whitespace stdout hides output

Medium Severity

In extractCommandResult, a whitespace-only stdout string is treated as real output and short-circuits the fallback chain, so values like aggregatedOutput are never read. The work log then stores that blank stdout, skips entry.output, and the expanded command UI hides all streams because they are not renderable.

Additional Locations (1)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 19abc64. Configure here.

@macroscopeapp

macroscopeapp Bot commented Jun 19, 2026

Copy link
Copy Markdown
Contributor

Approvability

Verdict: Needs human review

This PR introduces significant new functionality (expandable command/file-change activity boxes) with ~1145 lines of new components and logic. Additionally, an unresolved review comment identifies a potential bug where whitespace-only stdout could hide command output. Both factors warrant human review.

You can customize Macroscope's approvability policy. Learn more.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:XL 500-999 changed lines (additions + deletions). vouch:unvouched PR author is not yet trusted in the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant