diff --git a/webview-ui/src/components/settings/ApiConfigManager.tsx b/webview-ui/src/components/settings/ApiConfigManager.tsx index 0a60f60..8bbd588 100644 --- a/webview-ui/src/components/settings/ApiConfigManager.tsx +++ b/webview-ui/src/components/settings/ApiConfigManager.tsx @@ -1,6 +1,8 @@ import { VSCodeButton, VSCodeTextField } from "@vscode/webview-ui-toolkit/react" import { memo, useEffect, useRef, useState } from "react" import { ApiConfigMeta } from "../../../../src/shared/ExtensionMessage" +import { Dropdown } from "vscrui" +import type { DropdownOption } from "vscrui" interface ApiConfigManagerProps { currentApiConfigName?: string @@ -133,28 +135,21 @@ const ApiConfigManager = ({ ) : ( <>
- + minWidth: 130, + }} + role="combobox" + options={listApiConfigMeta.map((config) => ({ + value: config.name, + label: config.name, + }))} + /> void @@ -451,23 +453,21 @@ const SettingsView = ({ onDone }: SettingsViewProps) => {

Browser Settings

- +
+ { + setBrowserViewportSize((value as DropdownOption).value) + }} + style={{ width: "100%" }} + options={[ + { value: "1280x800", label: "Large Desktop (1280x800)" }, + { value: "900x600", label: "Small Desktop (900x600)" }, + { value: "768x1024", label: "Tablet (768x1024)" }, + { value: "360x640", label: "Mobile (360x640)" }, + ]} + /> +

({ ), })) +jest.mock("vscrui", () => ({ + Dropdown: ({ id, value, onChange, options, role }: any) => ( +

+ +
+ ), +})) + describe("ApiConfigManager", () => { const mockOnSelectConfig = jest.fn() const mockOnDeleteConfig = jest.fn()