From db0339b228ce0b5b60ad66dcd27befb4d9ae3d95 Mon Sep 17 00:00:00 2001 From: Prathmesh Vhatkar Date: Tue, 28 Jan 2025 20:15:52 +0530 Subject: [PATCH] fix: Use Dropdown instead of select in settings for more ui consistency --- .../components/settings/ApiConfigManager.tsx | 32 +++++++---------- .../src/components/settings/SettingsView.tsx | 34 +++++++++---------- 2 files changed, 30 insertions(+), 36 deletions(-) diff --git a/webview-ui/src/components/settings/ApiConfigManager.tsx b/webview-ui/src/components/settings/ApiConfigManager.tsx index 0a60f60..907043f 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,20 @@ const ApiConfigManager = ({ ) : ( <>
- + minWidth: 130, + }} + options={listApiConfigMeta.map((config) => ({ + value: config.name, + label: config.name, + }))} + /> void @@ -444,23 +446,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)" }, + ]} + /> +