Skip to content
Source
Sign inSign up
pingdotgg/t3code

feat(web): collapse tool activity into one line #7152

Mergedmaria-rcksmerged 7 commits intomain fromrefs/pull/7152/headmerged by maria-rcks View on GitHub

maria-rckscommented

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

BeforeAfter
Tool activity before Grouped tool activity after

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.

Note

Collapse tool activity into one-line rows in MessagesTimeline

  • Reworks deriveMessagesTimelineRows in MessagesTimeline.logic.ts 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 to display live activity as a single animated line.
  • Updates session-logic.ts 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 summarized 60218ae.

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.

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).
    1. coderabbitai[bot](GitHub profile, opens in a new tab)commented

      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 Plus

      Run ID: c860b58f-a190-4026-a292-558459e13872

      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

      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.
    2. github-actions[bot](GitHub profile, opens in a new tab) added labelsvouch:trusted

    3. macroscopeapp[bot](GitHub profile, opens in a new tab)commented

      🟡 Medium

      https://github.com/pingdotgg/t3code/blob/34a0b6377af011c6d8855226fb3411e50dd32686/apps/web/src/session-logic.ts#L1108

      A legacy tool.completed without toolCallId is merged into the wrong concurrent call, leaving the actual call shown as running and assigning its result to another call. Because tool.started is now eligible as previous, the unkeyed fallback matches whichever keyed start immediately precedes the completion by itemType and label; exclude started entries from this fallback or require a unique open lifecycle match.

      ✅ Resolved in 40c4a792d2ae0a938e74d0809ebebdbfc6b84efa

    4. github-actions[bot](GitHub profile, opens in a new tab)commented

      Thread transfer impact

      ✅ Thread transfer remains within every enforced ceiling.

      ℹ️ The exact PR base did not have a successful artifact. Baseline uses the latest successful main measurement shown below.

      ProviderMetricMain baselineThis PRImpactPR ceiling
      CodexTotal thread wire12.6 KiB13.4 KiB+849 B (+6.6%)15.1 KiB✅
      CodexThread snapshot wire6.3 KiB6.9 KiB+623 B (+9.7%)7.3 KiB✅
      CodexLive turn WebSocket wire6.3 KiB6.5 KiB+226 B (+3.5%)7.8 KiB✅
      CodexLive turn WebSocket decoded51.8 KiB55.0 KiB+3.2 KiB (+6.1%)66.4 KiB✅
      CodexLive turn messages16160 (0.0%)21✅
      ClaudeTotal thread wire12.6 KiB13.5 KiB+877 B (+6.8%)15.1 KiB✅
      ClaudeThread snapshot wire6.3 KiB6.9 KiB+629 B (+9.8%)7.3 KiB✅
      ClaudeLive turn WebSocket wire6.3 KiB6.6 KiB+248 B (+3.8%)7.8 KiB✅
      ClaudeLive turn WebSocket decoded52.7 KiB55.8 KiB+3.2 KiB (+6.0%)66.4 KiB✅
      ClaudeLive turn messages16160 (0.0%)21✅

      Baseline: bcfd485 · PR result: 60218ae · Source CI: success

      Scenario and decoded snapshot size

      10 historical turns, 5 command tools per turn, 878.9 KiB retained MCP result per historical turn, and a 1.05 MiB retained result in the measured turn.

      • Codex decoded thread snapshot: 109.4 KiB
      • Claude decoded thread snapshot: 110.1 KiB

      Updated in place by a trusted workflow. PR artifacts are strictly validated and never executed.

    5. Reviewed the changed chat timeline UI (ChangedFilesTree.tsx, MessagesTimeline.tsx, index.css) for shared-primitive usage, Tailwind/CSS ownership and preserved interaction semantics. The AgentSpawnCtaRow migration to Button and the new mask/animation utilities living in index.css both look right. Three concrete issues below: one order-dependent cascade conflict on the new live-activity overlay, one responsive-mode inconsistency in the rebuilt subagent card, and one lost failure affordance.

      Posted via Macroscope — UI Consistency
    6. macroscopeapp[bot](GitHub profile, opens in a new tab)commented

      Approvability

      Verdict: Not approved

      Macroscope's review found this PR not approvable — This PR introduces a new UI feature for collapsing tool activity into summarized rows with animations. It adds significant new rendering logic, shell command parsing, new component types, and CSS animations—constituting a substantial user-facing behavior change that warrants human review.

      You can add or adjust custom eligibility rules. [Learn more](https://docs.macroscope.com/approvability#example-custom-eligibility-rules).
    7. macroscopeapp[bot](GitHub profile, opens in a new tab)commented

      🟢 Low

      https://github.com/pingdotgg/t3code/blob/40c4a792d2ae0a938e74d0809ebebdbfc6b84efa/apps/web/src/index.css#L141

      The live-activity-focus and live-activity-focus-counter animations have no emitted keyframes, so the live-activity focus sweep remains stationary. Because their keyframes are inside @theme inline without matching --animate-* variables, Tailwind drops them despite the utilities' direct animation declarations. Add matching animation theme variables (or move the keyframes outside @theme).

      No longer relevant as of d2095f27f302cd6d4c8bc795bb6f8e38c509d90e

    8. Reviewed the timeline/changed-files refresh for shared-primitive use, Tailwind ownership, and interaction/accessibility preservation. The three findings from the previous run are addressed (the shimmer overlay no longer sets inset-0 against the CSS utility's own left/width, the subagent card now uses @container/agent-group queries, and the failure icon is exposed via role="img"). Three new issues introduced by this diff are below.

      Posted via Macroscope — UI Consistency
      macroscopeapp[bot](GitHub profile, opens in a new tab)commented

      chat/MessagesTimeline.tsx:2416

      The status text (3 failed / 2 working / Completed) was previously always rendered; gating it on @[32rem]/agent-group means that in a narrow chat column the only remaining failure signal is the aria-hidden colour dot on line 2408, so the state becomes colour-only and invisible to assistive tech. Suggest keeping a text fallback that is only announced when the visible status is hidden.

               <div className="flex min-w-0 flex-1 items-center gap-1.5 px-1 py-1 text-left text-xs leading-4">
      +          <span className="sr-only @[32rem]/agent-group:hidden">{status}</span>
                 <span className="ml-auto hidden shrink-0 items-center gap-2 text-[11px] text-muted-foreground @[32rem]/agent-group:flex">

      No longer relevant as of d2095f27f302cd6d4c8bc795bb6f8e38c509d90e

    9. Reviewed the timeline/changed-files refresh for shared-primitive use, Tailwind ownership, and interaction/accessibility preservation. The three findings from the previous run are addressed (the shimmer overlay no longer sets inset-0 against the CSS utility's own left/width, the subagent card now uses @container/agent-group queries, and the failure icon is exposed via role="img"). Three new issues introduced by this diff are below.

      Posted via Macroscope — UI Consistency
      macroscopeapp[bot](GitHub profile, opens in a new tab)commented

      chat/MessagesTimeline.tsx:2416

      The status text (3 failed / 2 working / Completed) was previously always rendered; gating it on @[32rem]/agent-group means that in a narrow chat column the only remaining failure signal is the aria-hidden colour dot on line 2408, so the state becomes colour-only and invisible to assistive tech. Suggest keeping a text fallback that is only announced when the visible status is hidden.

               <div className="flex min-w-0 flex-1 items-center gap-1.5 px-1 py-1 text-left text-xs leading-4">
      +          <span className="sr-only @[32rem]/agent-group:hidden">{status}</span>
                 <span className="ml-auto hidden shrink-0 items-center gap-2 text-[11px] text-muted-foreground @[32rem]/agent-group:flex">

      No longer relevant as of d2095f27f302cd6d4c8bc795bb6f8e38c509d90e

    10. macroscopeapp[bot](GitHub profile, opens in a new tab)commented

      🟡 Medium src/session-logic.ts:1109

      A tool.started row with toolCallId followed by an ID-less tool.completed row is not collapsed, so the start remains visibly inProgress and the completion is rendered as a separate entry. The fallback guard excludes every tool.started predecessor; allow the unambiguous tool.started → tool.completed pair while continuing to reject tool.started → tool.updated cases that could represent concurrent tools.

      ✅ Resolved in d4e205311888b825f7796b07c672a484cda751b5

    11. One finding on the new live-activity sweep CSS. The earlier findings from previous runs (clipped focus ring on the changed-files preview buttons, colour-only subagent status, dead workingStepLabel, inset-0 vs. live-activity-focus ownership, colour-only tool failure) all look addressed in this revision.

      Posted via Macroscope — UI Consistency
    12. One finding on the new live-activity sweep CSS. The earlier findings from previous runs (clipped focus ring on the changed-files preview buttons, colour-only subagent status, dead workingStepLabel, inset-0 vs. live-activity-focus ownership, colour-only tool failure) all look addressed in this revision.

      Posted via Macroscope — UI Consistency
    13. One finding: the two new --animate-live-activity-focus* theme tokens are dead and duplicate the timing that the @utility blocks hardcode. Everything else in this revision looks consistent — the earlier focus-ring clipping, the container-query status text, and the workingStepLabel regression are all resolved.

      Posted via Macroscope — UI Consistency
    14. One finding: the two new --animate-live-activity-focus* theme tokens are dead and duplicate the timing that the @utility blocks hardcode. Everything else in this revision looks consistent — the earlier focus-ring clipping, the container-query status text, and the workingStepLabel regression are all resolved.

      Posted via Macroscope — UI Consistency
    15. UI consistency review found 3 issues in the timeline row restyle and the changed-files card. Details inline.

      Posted via Macroscope — UI Consistency
      macroscopeapp[bot](GitHub profile, opens in a new tab)commented

      chat/MessagesTimeline.tsx:2567

      Suppressing the icon removes the leading slot entirely (size-6 + gap-1.5 = 1.875rem) rather than reserving it, which has two visible effects inside one expanded tool group: non-failing rows sit flush left while the group header (icon span at line 1514) and any failing sibling keep the 1.875rem offset, giving the group a ragged left edge; and the expanded detail wrapper still uses ms-[1.875rem] (line 2625), which was chosen to align under the label, so for an icon-less row the <pre> hangs 1.875rem to the right of the label it belongs to. Suggest reserving the slot instead of dropping it — e.g. always render the icon wrapper and add invisible when it should not be seen — so the row indent and the detail block stay aligned.

      No longer relevant as of acb04b10f121dbbeceb8a1eec4a10bfb8658bbb8

    16. One finding: removing the per-row success/neutral indicators leaves activeTurnInProgress in the timeline activity context with no reader, so the context still invalidates its remaining consumers on every transition without any visual effect. Details inline.

      Posted via Macroscope — UI Consistency
      macroscopeapp[bot](GitHub profile, opens in a new tab)commented

      chat/MessagesTimeline.tsx:2567

      Dropping turnSettled / showSuccessIndicator / showNeutralIndicator here removed the last reader of activeTurnInProgress from TimelineRowActivityCtx — the remaining consumers (RevertUserMessageButton, AssistantChangedFilesSection) only read isWorking, isRevertingCheckpoint, latestTurnId, workingStepLabel. The field is still in TimelineRowActivityState (line 151) and in the memo deps (line 545), so the activity context object is still rebuilt when the turn settles and re-renders those consumers with no visual change. Suggest dropping activeTurnInProgress from the activity state and its memo dependency (and the now-unused MessagesTimeline prop, updating the ChatView call site and buildProps in the test) so the context only carries state a row actually reads.

      No longer relevant as of 018cad8dc4d522bfe3c4fe947111c46478ae6a27

    17. One finding on the expanded tool-call body; everything else in the tool-activity rework (container-query subagent card, inset focus rings, live/thinking rows, reserved icon slot) looks consistent with the shared system.

      Posted via Macroscope — UI Consistency
    18. UI consistency review: one new finding on the live activity row's leading icon slot. One previously reported issue is still open (see summary).

      Posted via Macroscope — UI Consistency
    19. One consistency finding on the new live-activity row; everything previously flagged on this branch (dead --animate-live-activity-focus tokens, @theme-scoped keyframes, inset-0 vs the CSS utility's own left/width, viewport breakpoints on the subagent card, colour-only failure state, missing hover affordance on expandable work rows, the collapsed icon slot, select-all on the expanded body, and the now-unused summarizeChangedFileScopes) reads as resolved at this head.

      Posted via Macroscope — UI Consistency
    20. Two consistency findings in the new live-activity/subagent rows. The alignment/tone note on LiveActivityContent from the previous run still applies and is not repeated here.

      Posted via Macroscope — UI Consistency
    21. One consistency finding on the new activity row metrics. Details inline.

      Posted via Macroscope — UI Consistency
      macroscopeapp[bot](GitHub profile, opens in a new tab)commented

      This PR moves the activity column to a single scale — the new summary branch here uses a size-6 icon slot with a size-4 glyph and text-sm leading-relaxed, PlainWorkEntryRow moved from size-5/size-3.5/text-[12px] to the same size-6/size-4/text-sm (lines 2557, 2612, 2620), and TurnFoldTimelineRow moved to text-sm leading-relaxed too. The count branch of this same component (lines 1550-1562) keeps the old metrics, so the +N previous log entries toggle now sits 0.25rem left of the rows it reveals and renders at 12px next to their 14px — a ragged left edge inside one group, where the two used to align.

      Suggest bringing the count branch to the same slot and type scale:

           <button
             type="button"
      -      className="flex w-full cursor-pointer items-center gap-1.5 rounded-md px-0.5 py-0.5 text-left text-[12px] leading-5 transition-colors duration-150 hover:bg-accent/20 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-ring/70"
      +      className="flex min-h-6 w-full cursor-pointer items-center gap-1.5 rounded-md px-0.5 py-0.5 text-left text-sm leading-relaxed transition-colors duration-150 hover:bg-accent/20 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-ring/70"
             aria-expanded={row.expanded}
             onClick={() => ctx.onToggleWorkGroup(row.groupId, row.id)}
           >
      -      <span className="flex size-5 shrink-0 items-center justify-center text-icon-muted">
      +      <span className="flex size-6 shrink-0 items-center justify-center text-icon-muted">
               <ChevronDownIcon
                 className={cn(
      -            "size-3.5 shrink-0 opacity-70 transition-transform duration-200",
      +            "size-4 shrink-0 opacity-70 transition-transform duration-200",
                   row.expanded && "rotate-180",
                 )}
               />
             </span>
      Posted via Macroscope — UI Consistency
    22. One new UI-consistency finding on the rewritten working row: it swaps the activity column's secondary-label token for muted-foreground, which diverges under imported/custom app themes.

      Previously reported items that are still open in this revision are not re-posted (live activity icon tone vs. the static rows, and the now-unread activeTurnInProgress field on TimelineRowActivityCtx).

      Posted via Macroscope — UI Consistency
    23. Two consistency findings in the new activity column. Everything else I re-checked from earlier rounds (inset focus rings on the changed-files preview, the reserved icon slot for icon-less activity lines, the tooltip on the agent-card icon button, the sr-only status fallback, select-none on the decorative sweep copy, top-level @keyframes) looks resolved.

      Posted via Macroscope — UI Consistency
      macroscopeapp[bot](GitHub profile, opens in a new tab)commented

      chat/MessagesTimeline.tsx:2373

      The new group classifier (toolGroupAction → toolGroupSummaryIconName) treats a provider-neutral dynamic_tool_call titled Read File as read and renders an eye, but this per-entry mapping still falls through to dynamic_tool_call → hammer. For a single-call group the collapsed summary ("Read 1 file", eye) and the expanded row for that same call (hammer) disagree. Suggest routing the read case through this mapping too, ideally by sharing the classification the way workLogEntryIsLocalCodeSearch is shared.

        if (workEntry.itemType === "dynamic_tool_call" && workEntry.toolTitle === "Read File") {
          return "eye";
        }
        if (workLogEntryIsLocalCodeSearch(workEntry)) return "search";

      No longer relevant as of 3ada3109545edf1854f5929559ce5729c8cab0b8

    24. One new finding on the expanded tool-group rows. The previously reported WorkingTimelineRow token mismatch (text-muted-foreground vs the text-secondary-label used by every activity line it introduces) is unchanged and is not re-reported here.

      Posted via Macroscope — UI Consistency
    25. One new consistency finding in the live activity row's failure state; see the inline comment. Previously reported items on this branch (working-header spacing/token, per-entry section landmarks for expanded groups, Read File icon mismatch) are unchanged and not re-posted.

      Posted via Macroscope — UI Consistency
    26. One finding in the newest revision of the live activity row.

      Posted via Macroscope — UI Consistency
    27. One finding in the new live activity row.

      Posted via Macroscope — UI Consistency

Sign in to join this conversation.