Revert UI for MCP_AUTO_OPEN_ENABLED option
This commit is contained in:
@@ -405,6 +405,7 @@ const Sidebar = ({
|
|||||||
/>
|
/>
|
||||||
) : typeof configItem.value === "boolean" ? (
|
) : typeof configItem.value === "boolean" ? (
|
||||||
<Select
|
<Select
|
||||||
|
data-testid={`${configKey}-select`}
|
||||||
value={configItem.value.toString()}
|
value={configItem.value.toString()}
|
||||||
onValueChange={(val) => {
|
onValueChange={(val) => {
|
||||||
const newConfig = { ...config };
|
const newConfig = { ...config };
|
||||||
@@ -415,25 +416,12 @@ const Sidebar = ({
|
|||||||
setConfig(newConfig);
|
setConfig(newConfig);
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<SelectTrigger
|
<SelectTrigger id={`${configKey}-input`}>
|
||||||
id={`${configKey}-input`}
|
|
||||||
data-testid={`${configKey}-input`}
|
|
||||||
>
|
|
||||||
<SelectValue />
|
<SelectValue />
|
||||||
</SelectTrigger>
|
</SelectTrigger>
|
||||||
<SelectContent>
|
<SelectContent>
|
||||||
<SelectItem
|
<SelectItem value="true">True</SelectItem>
|
||||||
data-testid={`${configKey}-input-true`}
|
<SelectItem value="false">False</SelectItem>
|
||||||
value="true"
|
|
||||||
>
|
|
||||||
True
|
|
||||||
</SelectItem>
|
|
||||||
<SelectItem
|
|
||||||
data-testid={`${configKey}-input-false`}
|
|
||||||
value="false"
|
|
||||||
>
|
|
||||||
False
|
|
||||||
</SelectItem>
|
|
||||||
</SelectContent>
|
</SelectContent>
|
||||||
</Select>
|
</Select>
|
||||||
) : (
|
) : (
|
||||||
|
|||||||
@@ -576,33 +576,6 @@ 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_ENABLED-input",
|
|
||||||
);
|
|
||||||
fireEvent.click(autoOpenDisabledInput);
|
|
||||||
const falseOption = screen.getByTestId(
|
|
||||||
"MCP_AUTO_OPEN_ENABLED-input-false",
|
|
||||||
);
|
|
||||||
fireEvent.click(falseOption);
|
|
||||||
|
|
||||||
expect(setConfig).toHaveBeenCalledWith(
|
|
||||||
expect.objectContaining({
|
|
||||||
MCP_AUTO_OPEN_ENABLED: {
|
|
||||||
label: "Auto Browser Open Enabled",
|
|
||||||
description:
|
|
||||||
"Enable automatic browser opening when inspector starts",
|
|
||||||
value: false,
|
|
||||||
},
|
|
||||||
}),
|
|
||||||
);
|
|
||||||
});
|
|
||||||
|
|
||||||
it("should maintain configuration state after multiple updates", () => {
|
it("should maintain configuration state after multiple updates", () => {
|
||||||
const setConfig = jest.fn();
|
const setConfig = jest.fn();
|
||||||
const { rerender } = renderSidebar({
|
const { rerender } = renderSidebar({
|
||||||
|
|||||||
@@ -33,9 +33,4 @@ 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
|
* 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;
|
MCP_PROXY_FULL_ADDRESS: ConfigItem;
|
||||||
|
|
||||||
/**
|
|
||||||
* Disable automatic browser opening when inspector starts.
|
|
||||||
*/
|
|
||||||
MCP_AUTO_OPEN_ENABLED: ConfigItem;
|
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -52,9 +52,4 @@ 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",
|
"Set this if you are running the MCP Inspector Proxy on a non-default address. Example: http://10.1.1.22:5577",
|
||||||
value: "",
|
value: "",
|
||||||
},
|
},
|
||||||
MCP_AUTO_OPEN_ENABLED: {
|
|
||||||
label: "Auto Browser Open Enabled",
|
|
||||||
description: "Enable automatic browser opening when inspector starts",
|
|
||||||
value: true,
|
|
||||||
},
|
|
||||||
} as const;
|
} as const;
|
||||||
|
|||||||
Reference in New Issue
Block a user