fix(ui): use antd Select for MCP ToolTestPanel bool inputs

This commit is contained in:
Ryan Crabbe 2026-04-15 12:32:38 -07:00
parent 72a461ba4a
commit 35559c4d60
No known key found for this signature in database
2 changed files with 9 additions and 9 deletions

View file

@ -89,7 +89,7 @@ describe("ToolTestPanel defaults", () => {
expect(screen.getByLabelText("message")).toHaveValue("");
expect(screen.getByLabelText("attempts")).toHaveValue(0);
expect(screen.getByLabelText("ratio")).toHaveValue(0.4);
expect(screen.getByDisplayValue("True")).toBeInTheDocument();
expect(screen.getByTitle("True")).toBeInTheDocument();
const keywordsTextarea = screen.getByTestId("textarea-keywords");
expect(JSON.parse(keywordsTextarea.value)).toEqual([""]);

View file

@ -1,7 +1,7 @@
import React from "react";
import { Button, TextInput } from "@tremor/react";
import { MCPTool, InputSchema, InputSchemaProperty } from "./types";
import { Form, Tooltip } from "antd";
import { Form, Select, Tooltip } from "antd";
import { InfoCircleOutlined } from "@ant-design/icons";
import NotificationsManager from "../molecules/notifications_manager";
@ -480,14 +480,14 @@ export function ToolTestPanel({
)}
{prop.type === "boolean" && (
<select
className="w-full px-3 py-2 border border-gray-300 rounded-lg shadow-sm focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-blue-500 text-sm transition-colors"
defaultValue={(initialValue ?? false).toString()}
<Select
placeholder={`Select ${key}`}
allowClear={!actualSchema.required?.includes(key)}
className="w-full"
>
{!actualSchema.required?.includes(key) && <option value="">Select {key}</option>}
<option value="true">True</option>
<option value="false">False</option>
</select>
<Select.Option value={true}>True</Select.Option>
<Select.Option value={false}>False</Select.Option>
</Select>
)}
{(prop.type === "object" || prop.type === "array") && (