Skip to content

feat(ui): group tool calls into trow summaries#874

Merged
Astro-Han merged 28 commits into
devfrom
codex/session-trow-revival
May 24, 2026
Merged

feat(ui): group tool calls into trow summaries#874
Astro-Han merged 28 commits into
devfrom
codex/session-trow-revival

Conversation

@Astro-Han
Copy link
Copy Markdown
Owner

@Astro-Han Astro-Han commented May 23, 2026

Summary

Adds the session turn tool-row grouping work for the conversation stream. There is no related issue; this revives the prior worktree implementation after local discussion and testing.

  • Groups consecutive visible tool calls into a compact trow summary.
  • Keeps the latest active tool visible while a turn is still working.
  • Renders single-tool turns in the same trow visual scope without adding an extra outer collapse.
  • Adds focused reducer/grouping coverage and a snap fixture for collapsed, expanded, running, inner-expanded, and single-command states.

Why

Multiple tool calls were taking over the main conversation stream, and long-running tools could leave users staring at a stale block with little sign of progress. This keeps the main view quieter while still making it clear which tool is active.

Related Issue

No related issue. This came from the local session-flow UI follow-up.

Human Review Status

Pending

Review Focus

Please focus on the grouping boundary in groupParts, the single-tool direct rendering path in TrowBlock, and whether the summary copy stays minimal enough for the main conversation stream.

Risk Notes

Skipped checklist items:

  • Platform impact checklist: no Electron shell, packaging, updater, signing, path, or permission surface was touched.
  • Docs/release/dependencies checklist: no docs, release notes, dependencies, permissions, credentials, deletion behavior, or generated committed content were touched.

Behavior risk: a single visible tool now goes through the trow wrapper instead of the old standalone Part branch, so the visual scope changes for one-tool turns.

How To Verify

Focused tests: bun test src/components/message-part/grouping.test.ts src/components/session-turn-trow-block.reducer.test.ts -> 19 passed
UI typecheck: bun run typecheck in packages/ui -> passed
App typecheck: bun run typecheck in packages/app -> passed
Lint: bun run lint -> passed
Visual snap: PLAYWRIGHT_PORT=3002 bun run snap session-trow -> 1 passed, regenerated docs/design/preview/screenshots/session-trow.png locally
Diff check: git diff --check -> passed

Screenshots or Recordings

Generated local snap: docs/design/preview/screenshots/session-trow.png in this worktree. It covers running-current, mixed collapsed/expanded, inner bash expanded, and single-command direct/running states.

Manual Electron verification is the next step after opening this PR.

Checklist

How to use this checklist:

  • Tick a box by replacing [ ] with [x]. Do not edit, add, or remove items.
  • The bot-applied label items can only be honestly ticked AFTER the PR is opened and the labeler / priority-triage bots have run — return to the PR description and tick them then.
  • Most items are required. The few that are conditional are explicitly marked (conditional); for those, leave unticked if they truly do not apply and explain why in Risk Notes. All other items must be ticked before requesting human review.
  • Type label — this PR carries exactly one of bug, enhancement, task, documentation. Type labels are author-added; the labeler bot does NOT assign them. Add the label in the GitHub UI, then tick this.
  • Routing labels — this PR carries at least one of app, ui, platform, harness, ci. The labeler bot assigns these on PR open based on changed paths. Confirm the bot's choice (or override if wrong), then tick this.
  • Priority label — this PR carries exactly one of P0, P1, P2, P3. The priority-triage bot suggests one on PR open. Confirm or override, then tick this.
  • Human Review Status above is set to Pending, Approved by @<reviewer>, or Not required: <reason> (default is Pending; "not required" is restricted to bot-authored low-risk PRs).
  • I linked the related issue, or stated in Summary why there is no issue.
  • I described the review focus and any meaningful risks.
  • I replaced the example block in How To Verify with the real verification steps and the key result for each.
  • I did not introduce unrelated refactors, dependencies, generated files, or file changes beyond the stated scope.
  • (conditional) I manually checked visible UI or copy changes when needed, with screenshots or recordings. Leave unticked only if no visible UI or copy changed.
  • (conditional) I considered macOS and Windows impact for platform, packaging, updater, signing, paths, shell, or permissions changes. Leave unticked only if no platform/packaging surface was touched.
  • (conditional) I called out docs, release notes, dependencies, permissions, credentials, deletion behavior, generated content, or local file changes when relevant. Leave unticked only if none of those surfaces was touched.
  • I reviewed the final diff for unrelated changes and suspicious dependency changes.
  • I am targeting dev, and my PR title and commit messages use Conventional Commits in English.

Summary by CodeRabbit

  • New Features

    • Consolidated "trow" tool grouping with a dedicated UI for single-row and expandable multi-tool views.
  • Improvements

    • Refined trow styling, animations, spacing, and accessibility; improved tool header/trigger behavior and default-open logic.
    • Added English and Chinese summary strings for grouped tool activity.
  • Tests

    • Expanded visual snapshot, grouping, reducer, unit, and perf tests covering trow layouts and tool states.

Review Change Stack

@Astro-Han Astro-Han added enhancement New feature or request P2 Medium priority app Application behavior and product flows ui Design system and user interface labels May 23, 2026 — with ChatGPT Codex Connector
@github-actions github-actions Bot removed enhancement New feature or request P2 Medium priority labels May 23, 2026
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 23, 2026

Warning

Review limit reached

@Astro-Han, we couldn't start this review because you've used your available PR reviews for now.

Your plan currently allows 1 review/hour. Refill in 24 minutes and 49 seconds.

Your organization has run out of usage credits. Purchase more in the billing tab.

⌛ How to resolve this issue?

After more review capacity refills, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than trial, open-source, and free plans. In all cases, review capacity refills continuously over time.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: d9c9c77f-aa05-46b0-904e-5e16e95637a4

📥 Commits

Reviewing files that changed from the base of the PR and between f9e6874 and 27b112f.

📒 Files selected for processing (5)
  • packages/app/e2e/snap/fixtures/trow-snap-fixture-data.ts
  • packages/app/e2e/snap/fixtures/trow-snap-fixture.tsx
  • packages/app/e2e/snap/session-trow.snap.ts
  • packages/ui/src/components/session-turn-trow-block.reducer.test.ts
  • packages/ui/src/components/session-turn-trow-block.tsx
📝 Walkthrough

Walkthrough

Adds a grouped "trow" UI for ToolPart sequences: new TrowBlock component and helpers, replaces "context" grouping with "trow", integrates into message rendering, adds CSS animations, deterministic fixture and Playwright snapshots, perf expand/collapse helpers, unit tests, and i18n entries.

Changes

TrowBlock component and grouping refactor

Layer / File(s) Summary
All TrowBlock + integration changes
packages/ui/src/components/session-turn-trow-block.tsx, packages/ui/src/components/message-part/grouping.ts, packages/ui/src/components/message-part/assistant-message-display.tsx, packages/ui/src/components/message-part/assistant-parts.tsx, packages/app/src/testing/trow-snap-fixture.tsx, packages/app/e2e/snap/session-trow.snap.ts, packages/app/e2e/perf/perf-probe.spec.ts, packages/ui/src/components/session-turn-trow-block.css, packages/ui/src/i18n/en.ts, packages/ui/src/i18n/zh.ts, tests/*`
Implements the "trow" grouping and TrowBlock UI with exported helpers (toolFamilyIcon, reduceTrowBlock, activeTrowTool, trowPartHasExpandableBody, trowBlockAnchor), migrates message rendering to use TrowBlock, adds CSS and animations for collapse/expand, provides a deterministic snapshot fixture and Playwright snapshot that validates layout/spacing/visibility, introduces perf helpers for expand/collapse cycles, updates i18n strings, and adds/updates unit and integration tests.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Possibly related issues

  • #596 — Overlaps trow summary/reducer and i18n helper work; likely related to the same summary/aggregation objectives.

Possibly related PRs

  • Astro-Han/pawwork#620 — Refactors message-part rendering; closely related to the grouping -> trow integration.

"I'm a rabbit with a tiny scroll,
I bundle tools into a roll,
Accordions hop and chevrons gleam,
Screens stitched up in carrot dream,
Hooray — the trow now finds its role!"

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 5.77% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title 'feat(ui): group tool calls into trow summaries' directly summarizes the main change—grouping tool calls into trow summaries—matching the PR objectives and changeset.
Description check ✅ Passed The description covers all required template sections: Summary, Why, Related Issue, Human Review Status, Review Focus, Risk Notes, How To Verify, Screenshots, and a fully completed Checklist with relevant items ticked.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/session-trow-revival

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 the P2 Medium priority label May 23, 2026
Copy link
Copy Markdown

@github-actions github-actions Bot left a comment

Choose a reason for hiding this comment

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

Suggested priority: P2 (includes user-path files (packages/app/src/testing/trow-snap-fixture.tsx)).

P1/P0 are reserved for maintainer confirmation. Please relabel manually if this is a release blocker, security issue, data-loss risk, or updater/runtime failure.

@Astro-Han Astro-Han added the enhancement New feature or request label May 23, 2026
Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request introduces the TrowBlock component, which groups consecutive tool calls into a single, expandable UI element. It includes comprehensive CSS for animations and layout, unit tests for the grouping logic and state reduction, and internationalization support for English and Chinese. Feedback suggests marking the parts prop as readonly for consistency, simplifying the logic for determining if a body is expandable, and ensuring consistent anchor ID prefixes between single and multi-tool states to prevent navigation issues during streaming.

Comment thread packages/ui/src/components/session-turn-trow-block.tsx Outdated
Comment thread packages/ui/src/components/session-turn-trow-block.tsx Outdated
Comment thread packages/ui/src/components/session-turn-trow-block.tsx Outdated
Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@packages/ui/src/components/message-part/assistant-parts.tsx`:
- Around line 67-73: The renderTool helper incorrectly finds refs by only
matching entry.refs.find((item) => item.partID === tool.id), which can select a
ref from a different message when part IDs repeat; update the lookup to resolve
by tool.messageID as well (e.g., match both partID and messageID or directly
find ref by messageID then partID) so you fetch the correct ref and then use
msgs().get(ref.messageID) — change the predicate in renderTool (and any similar
lookup) to include tool.messageID when searching entry.refs to ensure the
message lookup via msgs().get(ref.messageID) returns the intended message.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 9c15c9f2-1469-43d9-bfba-ca21c895ad69

📥 Commits

Reviewing files that changed from the base of the PR and between d9d052e and 39c23db.

📒 Files selected for processing (12)
  • packages/app/e2e/snap/session-trow.snap.ts
  • packages/app/src/testing/trow-snap-fixture.tsx
  • packages/ui/src/components/message-part/assistant-message-display.tsx
  • packages/ui/src/components/message-part/assistant-parts.tsx
  • packages/ui/src/components/message-part/context-tool-helpers.ts
  • packages/ui/src/components/message-part/grouping.test.ts
  • packages/ui/src/components/message-part/grouping.ts
  • packages/ui/src/components/session-turn-trow-block.css
  • packages/ui/src/components/session-turn-trow-block.reducer.test.ts
  • packages/ui/src/components/session-turn-trow-block.tsx
  • packages/ui/src/i18n/en.ts
  • packages/ui/src/i18n/zh.ts

Comment thread packages/ui/src/components/message-part/assistant-parts.tsx
Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@packages/app/e2e/perf/perf-probe.spec.ts`:
- Around line 695-700: The helper revealTrowBodyIfPresent should be made
idempotent by checking the current open state of the row body before clicking:
locate the trow-body (page.locator('[data-slot="trow-body"]').first()) and if it
is already visible return immediately; only if the body is not visible, click
the summary (summary.click()) and then assert visibility. Update
revealTrowBodyIfPresent (and the other expand helper used around lines 755-763)
to perform this body-visible check with a short timeout and only perform the
click when needed so a pre-opened row is not toggled closed.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 1261abff-d3ac-4bbc-851a-e4d6f4f2e92d

📥 Commits

Reviewing files that changed from the base of the PR and between 39c23db and 0a700f5.

📒 Files selected for processing (10)
  • packages/app/e2e/perf/perf-probe.spec.ts
  • packages/app/e2e/snap/session-trow.snap.ts
  • packages/app/src/testing/trow-snap-fixture.tsx
  • packages/ui/src/components/message-part/assistant-parts.tsx
  • packages/ui/src/components/message-part/tools/skill.tsx
  • packages/ui/src/components/session-turn-trow-block.css
  • packages/ui/src/components/session-turn-trow-block.reducer.test.ts
  • packages/ui/src/components/session-turn-trow-block.tsx
  • packages/ui/src/i18n/en.ts
  • packages/ui/src/i18n/zh.ts
✅ Files skipped from review due to trivial changes (1)
  • packages/ui/src/i18n/en.ts

Comment thread packages/app/e2e/perf/perf-probe.spec.ts
@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 23, 2026

Perf delta summary

Comparator: pass

Profile / Scenario interaction median interaction worst long task max tbt frame gap p95 frame gap max jank count cls status
default / homepage-cold 24 -> 24 (0) 40 -> 32 (-8) 86 -> 60 (-26) 36 -> 10 (-26) 16.8 -> 33.4 (+16.6) 166.6 -> 133.3 (-33.3) 4 -> 3 (-1) 0 -> 0 (0) pass
default / long-session-input-lag 48 -> 48 (0) 48 -> 48 (0) 0 -> 0 (0) 0 -> 0 (0) 16.7 -> 16.7 (0) 16.8 -> 16.8 (0) 0 -> 0 (0) 0 -> 0 (0) pass
default / session-streaming-long 40 -> 48 (+8) 64 -> 64 (0) 0 -> 0 (0) 0 -> 0 (0) 16.8 -> 16.8 (0) 33.3 -> 33.3 (0) 0 -> 0 (0) 0 -> 0 (0) pass
default / tool-call-expand 40 -> 24 (-16) 40 -> 24 (-16) 0 -> 0 (0) 0 -> 0 (0) 16.8 -> 16.7 (-0.1) 16.8 -> 16.7 (-0.1) 0 -> 0 (0) 0 -> 0 (0) pass
default / tool-default-open-heavy-bash 24 -> 16 (-8) 24 -> 16 (-8) 86 -> 69 (-17) 48 -> 35 (-13) 50 -> 50 (0) 100.1 -> 100 (-0.1) 3 -> 3 (0) 0 -> 0.004 (+0.004) pass
default / terminal-side-panel-open 48 -> 40 (-8) 48 -> 48 (0) 0 -> 0 (0) 0 -> 0 (0) 33.3 -> 33.2 (-0.1) 33.3 -> 33.3 (0) 0 -> 0 (0) 0 -> 0 (0) pass
default / session-scroll-reading 16 -> 16 (0) 24 -> 56 (+32) 0 -> 0 (0) 0 -> 0 (0) 16.7 -> 16.7 (0) 16.7 -> 16.7 (0) 0 -> 0 (0) 0 -> 0 (0) pass
low-end / session-scroll-reading-long 0 -> 0 (0) 0 -> 0 (0) 0 -> 0 (0) 0 -> 0 (0) 33.3 -> 33.3 (0) 33.5 -> 33.4 (-0.1) 0 -> 0 (0) 0 -> 0 (0) pass
low-end / session-timeline-recompute 24 -> 32 (+8) 32 -> 32 (0) 0 -> 0 (0) 0 -> 0 (0) 33.3 -> 33.3 (0) 33.3 -> 33.4 (+0.1) 0 -> 0 (0) 1.075 -> 1.075 (0) pass
low-end / concurrent-shimmer-extreme 0 -> 0 (0) 0 -> 0 (0) 0 -> 0 (0) 0 -> 0 (0) 16.8 -> 16.8 (0) 16.8 -> 16.8 (0) 0 -> 0 (0) 0 -> 0 (0) pass

@Astro-Han Astro-Han merged commit 939bdf6 into dev May 24, 2026
27 checks passed
@Astro-Han Astro-Han deleted the codex/session-trow-revival branch May 24, 2026 10:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

app Application behavior and product flows enhancement New feature or request P2 Medium priority ui Design system and user interface

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant