feat(ui): group tool calls into trow summaries#874
Conversation
|
Warning Review limit reached
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 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 configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (5)
📝 WalkthroughWalkthroughAdds 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. ChangesTrowBlock component and grouping refactor
Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes Possibly related issues
Possibly related PRs
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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
📒 Files selected for processing (12)
packages/app/e2e/snap/session-trow.snap.tspackages/app/src/testing/trow-snap-fixture.tsxpackages/ui/src/components/message-part/assistant-message-display.tsxpackages/ui/src/components/message-part/assistant-parts.tsxpackages/ui/src/components/message-part/context-tool-helpers.tspackages/ui/src/components/message-part/grouping.test.tspackages/ui/src/components/message-part/grouping.tspackages/ui/src/components/session-turn-trow-block.csspackages/ui/src/components/session-turn-trow-block.reducer.test.tspackages/ui/src/components/session-turn-trow-block.tsxpackages/ui/src/i18n/en.tspackages/ui/src/i18n/zh.ts
There was a problem hiding this comment.
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
📒 Files selected for processing (10)
packages/app/e2e/perf/perf-probe.spec.tspackages/app/e2e/snap/session-trow.snap.tspackages/app/src/testing/trow-snap-fixture.tsxpackages/ui/src/components/message-part/assistant-parts.tsxpackages/ui/src/components/message-part/tools/skill.tsxpackages/ui/src/components/session-turn-trow-block.csspackages/ui/src/components/session-turn-trow-block.reducer.test.tspackages/ui/src/components/session-turn-trow-block.tsxpackages/ui/src/i18n/en.tspackages/ui/src/i18n/zh.ts
✅ Files skipped from review due to trivial changes (1)
- packages/ui/src/i18n/en.ts
Perf delta summaryComparator: pass
|
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.
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 inTrowBlock, and whether the summary copy stays minimal enough for the main conversation stream.Risk Notes
Skipped checklist items:
Behavior risk: a single visible tool now goes through the trow wrapper instead of the old standalone
Partbranch, so the visual scope changes for one-tool turns.How To Verify
Screenshots or Recordings
Generated local snap:
docs/design/preview/screenshots/session-trow.pngin 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
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.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.P0,P1,P2,P3. The priority-triage bot suggests one on PR open. Confirm or override, then tick this.Pending,Approved by @<reviewer>, orNot required: <reason>(default isPending; "not required" is restricted to bot-authored low-risk PRs).dev, and my PR title and commit messages use Conventional Commits in English.Summary by CodeRabbit
New Features
Improvements
Tests