feat: tool call UI, inline diffs, collapsible code blocks#229
Merged
akhileshrangani4 merged 3 commits intomainfrom Feb 21, 2026
Merged
feat: tool call UI, inline diffs, collapsible code blocks#229akhileshrangani4 merged 3 commits intomainfrom
akhileshrangani4 merged 3 commits intomainfrom
Conversation
Add file tools (readFile, listFiles, searchFiles) to the AI backend with multi-step support via stopWhen, and render tool invocations as collapsible inline elements in assistant messages. - Add createFileTools() with readFile, listFiles, searchFiles tools - Enable multi-step tool calling with stopWhen: stepCountIs(5) - Preserve UIMessage parts through the Message type and chat provider - Create ToolInvocation component for inline tool call display - Render tool parts interleaved with text in MessageContent
Parse <<<<<<< SEARCH / ======= / >>>>>>> REPLACE markers into color-coded added/removed lines with gutter indicators instead of showing raw diff syntax.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
- Code blocks in chat collapse to ~4 lines with gradient fade and expand toggle, with a shimmer bar while streaming - Fix shouldTreatAsContext being too aggressive — now requires 2+ signals instead of any single match like a bare parenthesis - Modularize code-block into diff.ts, use-syntax-highlighting.ts, and collapsible-code.tsx
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
stopWhen: stepCountIs(5)shouldTreatAsContextwas too aggressive — normal text with parentheses or 3 lines would become a context tab. Now requires 2+ signals to triggerChanges
message.tsx,tool-invocation.tsx,types.ts,chat-provider.tsx,index.tsxtools.ts,ai.tsdiff.ts,body.tsx,context.tsx,globals.csscollapsible-code.tsx,use-syntax-highlighting.ts,code-block/index.tsx,markdown.tsxutils.tsTest plan