# feat\(web\): collapse tool activity into one line · PR \#7152 · pingdotgg/t3code

[View on GitCafe](https://git.cafe/pingdotgg/t3code/pull/7152)

Repository: [pingdotgg/t3code](https://git.cafe/pingdotgg/t3code)

Visibility: public

State: merged

Source repository: pingdotgg/t3code

Source branch: ui-refresh/tool-activity-web

Target branch: main

Head commit: 60218aec86a15f1a563cb910cab495b8faf1c3d7

[Discussion and reviews](https://git.cafe/pingdotgg/t3code/pull/7152)

[Commits](https://git.cafe/pingdotgg/t3code/pull/7152/commits?format=markdown)

[Files changed](https://git.cafe/pingdotgg/t3code/pull/7152/diffs?format=markdown)

## Description

---

## What changed

Tool calls now collapse into one compact expandable line for both live and completed work. Live activity uses the moving focus animation, and the working row keeps a reliable Worked for timer by falling back to the latest user message timestamp while the turn is being acknowledged.

This PR intentionally leaves turn folding, deeper lifecycle reconciliation, and mobile parity to the follow-up PR.

## Screenshots

<table>
<tr><th>Before</th><th>After</th></tr>
<tr>
<td><img src="https://github.com/user-attachments/assets/f4aa8da8-4288-45c0-9dfc-608010e28daa" alt="Tool activity before" width="500"></td>
<td><img src="https://github.com/user-attachments/assets/482b2044-9bce-40dd-918f-e2219ade9bc3" alt="Grouped tool activity after" width="500"></td>
</tr>
</table>

## Validation

- Timeline logic and render tests
- Session work-log tests
- Web typecheck
- Changed-file lint and formatting checks

Built with GPT-5.6-sol in the Codex harness.

<!-- Macroscope's pull request summary starts here -->
<!-- Macroscope will only edit the content between these invisible markers, and the markers themselves will not be visible in the GitHub rendered markdown. -->
<!-- If you delete either of the start / end markers from your PR's description, Macroscope will append its summary at the bottom of the description. -->
> [!NOTE]
> ### Collapse tool activity into one-line rows in `MessagesTimeline`
> - Reworks `deriveMessagesTimelineRows` in [MessagesTimeline.logic.ts](https://github.com/pingdotgg/t3code/pull/7152/files#diff-6cdfacc6ebbdbc5c4b4058c0a430b87d768ac2b6accf35fb4c9dfc23500914fe) to group active tool runs into a single `work-live` row and summarize prior runs as collapsed `work-toggle` rows.
> - Adds `summarizeToolGroup` and related helpers to generate natural-language summaries (e.g., "Changed 2 files") and icons for collapsed tool groups.
> - Introduces `LiveWorkEntryTimelineRow` and `ThinkingActivityRow` components with CSS shimmer animations in [MessagesTimeline.tsx](https://github.com/pingdotgg/t3code/pull/7152/files#diff-f2a34c4ad8d2b68c45657dbdcbf14afac4ea93e1fbd37007aaa2ccb8b41d2588) to display live activity as a single animated line.
> - Updates [session-logic.ts](https://github.com/pingdotgg/t3code/pull/7152/files#diff-9f1f9f19555f14c3c47d4ce52e1b7dcec7e968e54f400820085376797a7223d6) to collapse interleaved tool lifecycle updates by `(turnId, toolCallId)` and refine `deriveActiveWorkStartedAt` timing.
> - Behavioral Change: `MessagesTimeline` no longer accepts the `activeTurnInProgress` prop; tool lifecycle rows from different turns will no longer collapse together.
>
> <!-- Macroscope's review summary starts here -->
>
> <sup><a href="https://app.macroscope.com">Macroscope</a> summarized 60218ae.</sup>
> <!-- Macroscope's review summary ends here -->
>
<!-- Macroscope's pull request summary ends here -->

<!-- CURSOR_SUMMARY -->
---

> [!NOTE]
> **Medium Risk**
> Large changes to timeline row derivation and rendering affect how every in-flight and completed tool is shown; session collapse key changes could mis-merge or split tool rows if edge cases are wrong.
> 
> **Overview**
> **Tool activity in the chat timeline** is grouped into compact rows instead of many separate lifecycle lines. Active runs use a **`work-live`** row with animated focus and labels like “Running pnpm” (from shell parsing); settled tool-only groups use **`work-toggle`** with summaries (“Ran 2 commands”, “Changed 3 files”), icons, and failure affordances. Row derivation handles adjacent in-progress tools, commentary boundaries, stale tools after a new send, and expanded group layout.
> 
> **Session / work log** now keeps **`toolCallId`** on entries, collapses interleaved **`tool.updated` / `tool.completed`** by **`(turnId, toolCallId)`**, and splits display vs output failure detection via **`workEntryDisplayIndicatesToolFailure`**.
> 
> **Chat chrome:** **`activeTurnInProgress`** is removed from **`MessagesTimeline`**; **`deriveActiveWorkStartedAt`** can use **`latestUserMessageAt`** while a turn is acknowledged. Plain tool rows drop success/neutral badges in favor of one-line copy. CSS adds **`live-activity-focus`** shimmer with reduced-motion support.
> 
> <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit 60218aec86a15f1a563cb910cab495b8faf1c3d7. Bugbot is set up for automated code reviews on this repo. Configure [here](https://www.cursor.com/dashboard/bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
