Expand single tool calls in chat messages#2369
Open
gary149 wants to merge 1 commit into
Open
Conversation
A run of consecutive thinking/tool blocks containing exactly one tool
call previously collapsed into an uninformative "Called 1 tool" summary,
hiding which tool ran behind an extra click. Keep collapsing only for
multi-tool runs ("Called N tools") and pure-thinking runs ("Thought"),
and render single-tool runs expanded so the tool name is visible inline.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01S8ttPBmjJF1iYMQjYxsVE8
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Modified the chat message rendering logic to expand single tool calls alongside thinking blocks, rather than collapsing them into a summary. This improves visibility of tool execution results without requiring an extra click.
Key Changes
unit.blocks.length > 1 && unit.toolCount !== 1){#each}, allowing multiple blocks (e.g., thinking + tool call) to display expandedtool-${block.uuid}-${blockIndex}for tools,think-${blockIndex}for thinking blocks)Implementation Details
The change preserves the existing
ToolCallsSummarycomponent for complex scenarios (multiple tools or thinking-only blocks) while expanding the simple case of a single tool call, optionally with thinking blocks. This provides better UX by showing tool results immediately without hiding them behind a collapsible summary.https://claude.ai/code/session_01S8ttPBmjJF1iYMQjYxsVE8