fix(ui): label explicit empty tool selections

This commit is contained in:
Yuneng Jiang 2026-09-11 19:16:09 -07:00
parent 0587e3b8f8
commit dea10d4fdb
No known key found for this signature in database
2 changed files with 4 additions and 1 deletions

View file

@ -307,5 +307,6 @@ it("should distinguish an unset enum from empty string and retain explicit false
await expect(submit(ref)).resolves.toEqual({ active: false });
await user.click(screen.getByRole("combobox", { name: "mode" }));
await user.click(await screen.findByRole("option", { name: "Empty string" }));
expect(screen.getByRole("combobox", { name: "mode" })).toHaveTextContent("Empty string");
await expect(submit(ref)).resolves.toEqual({ mode: "", active: false });
});

View file

@ -358,7 +358,9 @@ const MCPToolArgumentsForm = forwardRef<MCPToolArgumentsFormRef, MCPToolArgument
aria-invalid={field["aria-invalid"]}
className="w-full"
>
<SelectValue placeholder={`Select ${key}`} />
<SelectValue placeholder={`Select ${key}`}>
{field.value === "" ? "Empty string" : undefined}
</SelectValue>
</SelectTrigger>
<SelectContent>
{!required && <SelectItem value={null}>Select {key}</SelectItem>}