diff --git a/webview-ui/src/components/settings/ApiOptions.tsx b/webview-ui/src/components/settings/ApiOptions.tsx index f5aae3d..9674403 100644 --- a/webview-ui/src/components/settings/ApiOptions.tsx +++ b/webview-ui/src/components/settings/ApiOptions.tsx @@ -44,6 +44,7 @@ const ApiOptions = ({ showModelOptions, apiErrorMessage, modelIdErrorMessage }: const [ollamaModels, setOllamaModels] = useState([]) const [anthropicBaseUrlSelected, setAnthropicBaseUrlSelected] = useState(!!apiConfiguration?.anthropicBaseUrl) const [azureApiVersionSelected, setAzureApiVersionSelected] = useState(!!apiConfiguration?.azureApiVersion) + const [isDescriptionExpanded, setIsDescriptionExpanded] = useState(false) const handleInputChange = (field: keyof ApiConfiguration) => (event: any) => { setApiConfiguration({ ...apiConfiguration, [field]: event.target.value }) @@ -542,7 +543,12 @@ const ApiOptions = ({ showModelOptions, apiErrorMessage, modelIdErrorMessage }: {selectedProvider === "openai-native" && createDropdown(openAiNativeModels)} - + )} @@ -573,8 +579,17 @@ export const formatPrice = (price: number) => { }).format(price) } -export const ModelInfoView = ({ selectedModelId, modelInfo }: { selectedModelId: string; modelInfo: ModelInfo }) => { - const [isDescriptionExpanded, setIsDescriptionExpanded] = useState(false) +export const ModelInfoView = ({ + selectedModelId, + modelInfo, + isDescriptionExpanded, + setIsDescriptionExpanded, +}: { + selectedModelId: string + modelInfo: ModelInfo + isDescriptionExpanded: boolean + setIsDescriptionExpanded: (isExpanded: boolean) => void +}) => { const isGemini = Object.keys(geminiModels).includes(selectedModelId) const infoItems = [ diff --git a/webview-ui/src/components/settings/OpenRouterModelPicker.tsx b/webview-ui/src/components/settings/OpenRouterModelPicker.tsx index 8e6c0c4..fa77d57 100644 --- a/webview-ui/src/components/settings/OpenRouterModelPicker.tsx +++ b/webview-ui/src/components/settings/OpenRouterModelPicker.tsx @@ -17,6 +17,7 @@ const OpenRouterModelPicker: React.FC = () => { const [selectedIndex, setSelectedIndex] = useState(-1) const dropdownRef = useRef(null) const itemRefs = useRef<(HTMLDivElement | null)[]>([]) + const [isDescriptionExpanded, setIsDescriptionExpanded] = useState(false) const handleModelChange = (newModelId: string) => { setApiConfiguration({ @@ -187,7 +188,12 @@ const OpenRouterModelPicker: React.FC = () => { {hasInfo ? ( - + ) : (