Improve display of agent/tool cards in chat session#1360
Open
dobesv wants to merge 2 commits intokagent-dev:mainfrom
Open
Improve display of agent/tool cards in chat session#1360dobesv wants to merge 2 commits intokagent-dev:mainfrom
dobesv wants to merge 2 commits intokagent-dev:mainfrom
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR improves the display of agent and tool call cards in chat sessions by introducing smart content rendering with JSON parsing, markdown support, and better UI controls.
Changes:
- Added SmartContent component that intelligently renders content as JSON tree view, markdown, or plain text
- Added CollapsibleSection component to provide consistent expand/collapse behavior with preview
- Modified ScrollArea to prevent horizontal overflow with CSS override
- Added copy-to-clipboard functionality to chat messages and improved display of tool/agent call arguments and results
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 9 comments.
Show a summary per file
| File | Description |
|---|---|
| ui/src/components/chat/SmartContent.tsx | New component for intelligent content rendering with JSON parsing, markdown support, type icons, and copy/view source controls |
| ui/src/components/chat/CollapsibleSection.tsx | New reusable component for collapsible content sections with preview and scroll support |
| ui/src/components/ui/scroll-area.tsx | Added CSS override to force block display on direct child divs to prevent horizontal overflow |
| ui/src/components/chat/ChatMessage.tsx | Added copy-to-clipboard button for chat messages and refactored feedback button visibility |
| ui/src/components/chat/AgentCallDisplay.tsx | Integrated SmartContent for rendering args/results, added clickable link for function calls, replaced custom collapse logic with CollapsibleSection |
| ui/src/components/ToolDisplay.tsx | Integrated SmartContent for rendering args/results, removed custom copy button, replaced custom collapse logic with CollapsibleSection |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
93a368a to
ea7f6f6
Compare
Contributor
Author
- Parse JSON payloads and render basic tree view - Render strings as markdown - Copy to clipboard button copies original text - Add view source button in case of render/parse issues - Prevent ScrollArea from overflow horizontally Signed-off-by: Dobes Vandermeer <dobes.vandermeer@newsela.com>
Signed-off-by: Dobes Vandermeer <dobes.vandermeer@newsela.com>
4a6c40e to
13cc185
Compare
Contributor
Author
|
@peterj can you take a look at this one? |
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.
Uh oh!
There was an error while loading. Please reload this page.