Skip to content

feat(ui): collapse consecutive same-tool card groups#501

Merged
tmustier merged 1 commit intomainfrom
feat/tool-group-collapse
Mar 15, 2026
Merged

feat(ui): collapse consecutive same-tool card groups#501
tmustier merged 1 commit intomainfrom
feat/tool-group-collapse

Conversation

@tmustier
Copy link
Copy Markdown
Owner

Closes #484.

Problem

Multiple consecutive tool calls of the same type (e.g. 5 fill_formula calls) rendered as separate stacked cards with no visual hierarchy — creating noise and taking excessive vertical space.

Solution

Groups of 3+ consecutive same-tool completed cards now start collapsed behind a summary header:

  • "▸ 5 fill operations" / "▸ 3 edits" / "▸ 4 reads"
  • Click to expand → shows all individual cards (existing grouped layout)
  • Groups of 2 remain expanded (header still shown for grouping)

Implementation

  • tool-grouping.ts: inject a <button class="pi-tool-group__header"> at the top of each group wrapper with a summary label + chevron. Toggle .pi-tool-group--collapsed on click.
  • message-components.css: collapsed state hides tool-message children via display: none. Chevron rotates when expanded.
  • Human-readable labels for common tools via TOOL_GROUP_LABELS map with generic fallback.

Testing

  • npm run build
  • npm run test:context ✅ (640/640)

@vercel
Copy link
Copy Markdown

vercel bot commented Mar 15, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
pi-for-excel Ready Ready Preview, Comment Mar 15, 2026 6:05pm

Groups of 3+ consecutive same-tool completed cards now start collapsed
behind a summary header ('5 fill operations', '3 edits', etc.) with a
click-to-expand toggle. Groups of 2 remain expanded (header still shown
for visual grouping).

The header uses the tool name from data-tool-name and a human-readable
label map, with a generic fallback. The collapse state toggles via a
CSS class (.pi-tool-group--collapsed) that hides the individual cards.

Closes #484
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 8de427265e

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@tmustier tmustier merged commit 87058ac into main Mar 15, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Successive tool calls of the same type should combine visually

1 participant