Add auto open disabled environment option to sidebar
This commit is contained in:
@@ -386,7 +386,6 @@ const Sidebar = ({
|
||||
/>
|
||||
) : typeof configItem.value === "boolean" ? (
|
||||
<Select
|
||||
data-testid={`${configKey}-select`}
|
||||
value={configItem.value.toString()}
|
||||
onValueChange={(val) => {
|
||||
const newConfig = { ...config };
|
||||
@@ -397,12 +396,25 @@ const Sidebar = ({
|
||||
setConfig(newConfig);
|
||||
}}
|
||||
>
|
||||
<SelectTrigger id={`${configKey}-input`}>
|
||||
<SelectTrigger
|
||||
id={`${configKey}-input`}
|
||||
data-testid={`${configKey}-input`}
|
||||
>
|
||||
<SelectValue />
|
||||
</SelectTrigger>
|
||||
<SelectContent>
|
||||
<SelectItem value="true">True</SelectItem>
|
||||
<SelectItem value="false">False</SelectItem>
|
||||
<SelectItem
|
||||
data-testid={`${configKey}-input-true`}
|
||||
value="true"
|
||||
>
|
||||
True
|
||||
</SelectItem>
|
||||
<SelectItem
|
||||
data-testid={`${configKey}-input-false`}
|
||||
value="false"
|
||||
>
|
||||
False
|
||||
</SelectItem>
|
||||
</SelectContent>
|
||||
</Select>
|
||||
) : (
|
||||
|
||||
@@ -423,6 +423,33 @@ describe("Sidebar Environment Variables", () => {
|
||||
);
|
||||
});
|
||||
|
||||
it("should update auto browser open disabled", () => {
|
||||
const setConfig = jest.fn();
|
||||
renderSidebar({ config: DEFAULT_INSPECTOR_CONFIG, setConfig });
|
||||
|
||||
openConfigSection();
|
||||
|
||||
const autoOpenDisabledInput = screen.getByTestId(
|
||||
"MCP_AUTO_OPEN_DISABLED-input",
|
||||
);
|
||||
fireEvent.click(autoOpenDisabledInput);
|
||||
const trueOption = screen.getByTestId(
|
||||
"MCP_AUTO_OPEN_DISABLED-input-true",
|
||||
);
|
||||
fireEvent.click(trueOption);
|
||||
|
||||
expect(setConfig).toHaveBeenCalledWith(
|
||||
expect.objectContaining({
|
||||
MCP_AUTO_OPEN_DISABLED: {
|
||||
label: "Auto Browser Open Disabled",
|
||||
description:
|
||||
"Disable automatic browser opening when inspector starts",
|
||||
value: true,
|
||||
},
|
||||
}),
|
||||
);
|
||||
});
|
||||
|
||||
it("should maintain configuration state after multiple updates", () => {
|
||||
const setConfig = jest.fn();
|
||||
const { rerender } = renderSidebar({
|
||||
|
||||
@@ -33,4 +33,9 @@ export type InspectorConfig = {
|
||||
* The full address of the MCP Proxy Server, in case it is running on a non-default address. Example: http://10.1.1.22:5577
|
||||
*/
|
||||
MCP_PROXY_FULL_ADDRESS: ConfigItem;
|
||||
|
||||
/**
|
||||
* Disable automatic browser opening when inspector starts.
|
||||
*/
|
||||
MCP_AUTO_OPEN_DISABLED: ConfigItem;
|
||||
};
|
||||
|
||||
@@ -43,4 +43,9 @@ export const DEFAULT_INSPECTOR_CONFIG: InspectorConfig = {
|
||||
"Set this if you are running the MCP Inspector Proxy on a non-default address. Example: http://10.1.1.22:5577",
|
||||
value: "",
|
||||
},
|
||||
MCP_AUTO_OPEN_DISABLED: {
|
||||
label: "Auto Browser Open Disabled",
|
||||
description: "Disable automatic browser opening when inspector starts",
|
||||
value: false,
|
||||
},
|
||||
} as const;
|
||||
|
||||
Reference in New Issue
Block a user