Skip to content

Improve display of agent/tool cards in chat session#1360

Open
dobesv wants to merge 2 commits intokagent-dev:mainfrom
dobesv:feat/tool-display-improvements
Open

Improve display of agent/tool cards in chat session#1360
dobesv wants to merge 2 commits intokagent-dev:mainfrom
dobesv:feat/tool-display-improvements

Conversation

@dobesv
Copy link
Contributor

@dobesv dobesv commented Feb 23, 2026

  • 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
  • Prevent Tool Call ID from making cards too wide for the container

@dobesv dobesv requested a review from peterj as a code owner February 23, 2026 01:20
Copilot AI review requested due to automatic review settings February 23, 2026 01:20
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

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.

@dobesv dobesv force-pushed the feat/tool-display-improvements branch from 93a368a to ea7f6f6 Compare March 8, 2026 08:10
@dobesv dobesv marked this pull request as draft March 8, 2026 08:10
@dobesv
Copy link
Contributor Author

dobesv commented Mar 9, 2026

@peterj @EItanya are you guys interested in having this change?

dobesv added 2 commits March 17, 2026 23:55
- 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>
@dobesv dobesv force-pushed the feat/tool-display-improvements branch from 4a6c40e to 13cc185 Compare March 18, 2026 06:55
@dobesv dobesv marked this pull request as ready for review March 18, 2026 07:03
@dobesv
Copy link
Contributor Author

dobesv commented Mar 18, 2026

@peterj can you take a look at this one?

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.

2 participants