Skip to content

Add expandable command and file-change activity boxes#3173

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

Add expandable command and file-change activity boxes#3173
Quicksaver wants to merge 38 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, while excluding collab-agent rows so their nested activity UI remains authoritative.
  • Hardened command-output extraction so blank completed stdout falls back to aggregated output while live incremental whitespace chunks are still preserved exactly.
  • Hardened command-output merging so shorter completed snapshots and shorter line-complete updated snapshots do not corrupt already merged command output, while prefix-like incremental chunks still append exactly.
  • Refined shorter-prefix command-output merging so single-line repeated-prefix snapshots do not duplicate output, while ambiguous multiline prefix chunks still preserve incremental stream data.
  • Addressed follow-up review findings by restoring deterministic same-timestamp ordering outside matching streamed tool updates, preserving merged file-change patches, synthesizing deleted-file patches, keeping MCP JSON expansion, and showing changed files missing from parsed inline diffs.
  • Addressed final activity-detail review findings by preventing basename-only changed files from matching unrelated inline diff suffixes and preserving deterministic ordering for same-timestamp unkeyed tool updates.
  • Addressed latest activity-detail review findings by showing changed-file previews for file-change rows that also carry command metadata, and by preserving nested keyboard controls inside expandable work rows.
  • Refactored command/file activity detail derivation into MessagesTimeline.logic.ts so MessagesTimeline.tsx now consumes derived detail objects while preserving upstream work-toggle row modeling and anchored-list behavior.
  • 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

  • (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.tsx passed 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.tsx passed 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.ts passed 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 --check passed.
  • pnpm exec vp check passed with 20 existing warnings outside this branch's changed files.
  • pnpm exec vp run typecheck passed across all packages.

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 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)WorkLogEntry now carries command streams (stdout/stderr/legacy output), exit code, duration, and unified patch text. Tool activities are parsed from nested provider payloads (including Codex-style file changes normalized to unified diffs). Incremental tool.updated output 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 into MessagesTimeline.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-expanded behavior 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

  • Work log entries now capture command stdout/stderr, exit codes, durations, and unified patch text extracted from tool activity payloads in session-logic.ts.
  • SimpleWorkEntryRow in 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.
  • New logic in MessagesTimeline.logic.ts drives expansion decisions, output tailing (default 40 lines), path deduplication between changed-file chips and inline diffs, and heading/preview derivation.
  • Incremental tool update merging is improved to avoid regressing to shorter output snapshots and to concatenate patch fragments across lifecycle events.
  • Accessibility improvements: aria-expanded and descriptive aria-label are added to work entry rows; keyboard toggle is gated to row-level events via shouldToggleWorkEntryRowFromKeyDown.

Macroscope summarized a52db95.

@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: 0302972a-6351-460b-baa3-744d14e2b32d

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.

@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
Comment thread apps/web/src/session-logic.ts Outdated
@macroscopeapp

macroscopeapp Bot commented Jun 19, 2026

Copy link
Copy Markdown
Contributor

Approvability

Verdict: 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
Comment thread apps/web/src/session-logic.ts Outdated
Comment thread apps/web/src/session-logic.ts Outdated
Comment thread apps/web/src/session-logic.ts
Comment thread apps/web/src/session-logic.ts Outdated

@macroscopeapp macroscopeapp 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.

Effect service conventions: one issue found in the newly added SourceControlPanelService. See inline comment.

Posted via Macroscope — Effect Service Conventions

Comment thread apps/server/src/sourceControl/SourceControlPanelService.ts Outdated
Comment thread apps/web/src/components/chat/MessagesTimeline.tsx Outdated
Comment thread apps/server/src/sourceControl/SourceControlPanelService.ts Outdated
Comment thread apps/server/src/sourceControl/SourceControlPanelService.ts Outdated
Comment thread apps/web/src/components/chat/ChatComposer.tsx Outdated
Comment thread apps/server/src/sourceControl/SourceControlPanelService.ts Outdated
Comment thread apps/server/src/sourceControl/SourceControlPanelService.ts Outdated
Comment thread apps/server/src/sourceControl/SourceControlPanelService.ts Outdated

@macroscopeapp macroscopeapp 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.

Effect service convention review: one issue found in newly added server error modeling. See inline comment.

Posted via Macroscope — Effect Service Conventions

Comment thread apps/server/src/vscodeWorkspaceBootstrap/bootstrap.ts Outdated
@Quicksaver Quicksaver force-pushed the split/file-command-activity-boxes branch from 0b3dd97 to 70b8635 Compare June 26, 2026 06:34
@github-actions github-actions Bot added size:XL 500-999 changed lines (additions + deletions). and removed size:XXL 1,000+ changed lines (additions + deletions). labels Jun 26, 2026
Comment thread apps/web/src/session-logic.ts Outdated
Comment thread apps/web/src/components/chat/MessagesTimeline.tsx
Comment thread apps/web/src/components/chat/MessagesTimeline.tsx Outdated
Comment thread apps/web/src/session-logic.ts
Comment thread apps/web/src/components/chat/MessagesTimeline.tsx Outdated
Comment thread apps/web/src/session-logic.ts Outdated
- 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
Comment thread apps/web/src/components/chat/MessagesTimeline.logic.ts
Comment thread apps/web/src/session-logic.ts Outdated
…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
@github-actions github-actions Bot added size:XXL 1,000+ changed lines (additions + deletions). and removed size:XL 500-999 changed lines (additions + deletions). labels Jun 27, 2026
Comment thread apps/web/src/components/chat/MessagesTimeline.logic.ts
Comment thread apps/web/src/components/chat/MessagesTimeline.tsx Outdated
- Show changed-file previews for file-change rows with commands

- Ignore nested control key events in expandable work rows
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:XXL 1,000+ 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