Skip to content

feat: jsonrpc tool call card#12

Merged
Junyi-99 merged 7 commits intomainfrom
feat-frontend-jsonrpc
Nov 6, 2025
Merged

feat: jsonrpc tool call card#12
Junyi-99 merged 7 commits intomainfrom
feat-frontend-jsonrpc

Conversation

@Junyi-99
Copy link
Member

a18a88bbe365e7951f6848f34c6552a5 b01f8004ea6e30d3d032fc0cd8743871

Copilot AI review requested due to automatic review settings October 28, 2025 13:48
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 adds support for rendering JSON-RPC tool call responses in the UI with a collapsible card interface. It introduces a new component specifically designed to display JSON-RPC formatted results from MCP (Model Context Protocol) tools.

  • Adds JsonRpc component with collapsible UI for JSON-RPC tool responses
  • Implements JSON-RPC result parsing utilities
  • Integrates JSON-RPC rendering into the tools routing system

Reviewed Changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
webapp/_webapp/src/index.css Adds styling for narrow tool cards and JSON-RPC specific title styles
webapp/_webapp/src/components/message-entry-container/tools/utils/common.tsx Defines JSON-RPC types and parsing utilities
webapp/_webapp/src/components/message-entry-container/tools/unknown-jsonrpc.tsx Creates fallback component for unknown JSON-RPC tools
webapp/_webapp/src/components/message-entry-container/tools/tools.tsx Routes JSON-RPC tools to appropriate card component
webapp/_webapp/src/components/message-entry-container/tools/jsonrpc.tsx Implements collapsible card UI for JSON-RPC results

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +25 to +32
export const parseJsonRpcResult = (message: string): JsonRpcResult | undefined => {
try {
const json = JSON.parse(message);
return json as JsonRpcResult;
} catch (error) {
return undefined;
}
} No newline at end of file
Copy link

Copilot AI Oct 28, 2025

Choose a reason for hiding this comment

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

The function uses a type assertion without validating that the parsed JSON actually matches the JsonRpcResult structure. Consider adding runtime validation to ensure the parsed object has the expected properties (jsonrpc, id, and either result or error) before casting.

Copilot uses AI. Check for mistakes.
Junyi-99 and others added 5 commits October 28, 2025 21:50
…onrpc.tsx

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…ols.tsx

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@Junyi-99 Junyi-99 requested a review from Copilot October 28, 2025 14:05
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

Copilot reviewed 5 out of 5 changed files in this pull request and generated 4 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

<div className="flex items-center justify-between cursor-pointer" onClick={toggleCollapse}>
<h3 className="tool-card-title tool-card-jsonrpc">{functionName}</h3>
<button
onClick={toggleCollapse}
Copy link

Copilot AI Oct 28, 2025

Choose a reason for hiding this comment

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

The button's onClick handler is redundant since its parent div already has onClick={toggleCollapse}. This creates duplicate click handling and could cause the toggle function to be called twice.

Suggested change
onClick={toggleCollapse}

Copilot uses AI. Check for mistakes.
@PaperDebugger PaperDebugger deleted a comment from Copilot AI Oct 28, 2025
@PaperDebugger PaperDebugger deleted a comment from Copilot AI Oct 28, 2025
@PaperDebugger PaperDebugger deleted a comment from Copilot AI Oct 28, 2025
@Junyi-99 Junyi-99 merged commit 1173a30 into main Nov 6, 2025
1 check passed
@Junyi-99 Junyi-99 deleted the feat-frontend-jsonrpc branch November 6, 2025 17:05
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