- {label[language] || label.en_US}
+ {translatedLabel}
{required && (
*
@@ -313,6 +314,7 @@ function Form<
handleFormChange(variable, nextValue)
}}
>
+
{translatedLabel}
{selectedOption?.name ?? placeholder?.[language] ?? placeholder?.en_US}
diff --git a/web/app/components/header/account-setting/model-provider-page/model-modal/__tests__/Form.spec.tsx b/web/app/components/header/account-setting/model-provider-page/model-modal/__tests__/Form.spec.tsx
index 11ff189393..3dc9e0f1d9 100644
--- a/web/app/components/header/account-setting/model-provider-page/model-modal/__tests__/Form.spec.tsx
+++ b/web/app/components/header/account-setting/model-provider-page/model-modal/__tests__/Form.spec.tsx
@@ -1234,7 +1234,7 @@ describe('Form', () => {
expect(screen.getByText('API Key'))!.toBeInTheDocument()
expect(screen.getByText('Region'))!.toBeInTheDocument()
- expect(screen.getByText('Model'))!.toBeInTheDocument()
+ expect(screen.getByRole('combobox', { name: 'Model' }))!.toBeInTheDocument()
expect(screen.getByText('Agree'))!.toBeInTheDocument()
expect(screen.getByLabelText('Enter your API key here'))!.toBeInTheDocument()
expect(screen.getByLabelText('Select region'))!.toBeInTheDocument()
@@ -1546,7 +1546,7 @@ describe('Form', () => {
expect(screen.getByText('API Key Fallback'))!.toBeInTheDocument()
expect(screen.getByText('Region Fallback'))!.toBeInTheDocument()
- expect(screen.getByText('Model Fallback'))!.toBeInTheDocument()
+ expect(screen.getByRole('combobox', { name: 'Model Fallback' }))!.toBeInTheDocument()
expect(screen.getByText('Agree Fallback'))!.toBeInTheDocument()
})
diff --git a/web/app/components/header/account-setting/model-provider-page/model-parameter-modal/__tests__/parameter-item.select.spec.tsx b/web/app/components/header/account-setting/model-provider-page/model-parameter-modal/__tests__/parameter-item.select.spec.tsx
index c221071b82..20f7089f73 100644
--- a/web/app/components/header/account-setting/model-provider-page/model-parameter-modal/__tests__/parameter-item.select.spec.tsx
+++ b/web/app/components/header/account-setting/model-provider-page/model-parameter-modal/__tests__/parameter-item.select.spec.tsx
@@ -20,6 +20,7 @@ vi.mock('@langgenius/dify-ui/select', async (importOriginal) => {
),
SelectContent: ({ children }: { children: ReactNode }) =>
{children}
,
SelectItem: ({ children }: { children: ReactNode }) =>
{children}
,
+ SelectLabel: () => null,
SelectTrigger: ({ children }: { children: ReactNode }) =>
{children}
,
SelectValue: () =>
SelectValue
,
SelectItemText: ({ children }: { children: ReactNode }) =>
{children},
diff --git a/web/app/components/header/account-setting/model-provider-page/model-parameter-modal/parameter-item.tsx b/web/app/components/header/account-setting/model-provider-page/model-parameter-modal/parameter-item.tsx
index 42ecb8f211..61f0192f92 100644
--- a/web/app/components/header/account-setting/model-provider-page/model-parameter-modal/parameter-item.tsx
+++ b/web/app/components/header/account-setting/model-provider-page/model-parameter-modal/parameter-item.tsx
@@ -8,7 +8,7 @@ import { FieldItem, FieldLabel, FieldRoot } from '@langgenius/dify-ui/field'
import { FieldsetLegend, FieldsetRoot } from '@langgenius/dify-ui/fieldset'
import { Radio } from '@langgenius/dify-ui/radio'
import { RadioGroup } from '@langgenius/dify-ui/radio-group'
-import { Select, SelectContent, SelectItem, SelectItemIndicator, SelectItemText, SelectTrigger, SelectValue } from '@langgenius/dify-ui/select'
+import { Select, SelectContent, SelectItem, SelectItemIndicator, SelectItemText, SelectLabel, SelectTrigger, SelectValue } from '@langgenius/dify-ui/select'
import { Slider } from '@langgenius/dify-ui/slider'
import { Switch } from '@langgenius/dify-ui/switch'
import { useEffect, useMemo, useRef, useState } from 'react'
@@ -165,58 +165,90 @@ function ParameterItem({
step = 10
}
- return (
- <>
- {numberInputWithSlide && (
-
- )}
+ if (!numberInputWithSlide) {
+ return (
- >
+ )
+ }
+
+ return (
+
+ {sliderLabel}
+
+
+
)
}
if (parameterRule.type === 'float') {
- return (
- <>
- {numberInputWithSlide && (
-
- )}
+ if (!numberInputWithSlide) {
+ return (
- >
+ )
+ }
+
+ return (
+
+ {sliderLabel}
+
+
+
)
}
@@ -317,6 +349,7 @@ function ParameterItem({
value={renderValue as string}
onValueChange={v => handleInputChange(v ?? undefined)}
>
+
{sliderLabel}
diff --git a/web/app/components/plugins/install-plugin/install-from-github/steps/__tests__/selectPackage.spec.tsx b/web/app/components/plugins/install-plugin/install-from-github/steps/__tests__/selectPackage.spec.tsx
index 102e79aa1a..352dad7136 100644
--- a/web/app/components/plugins/install-plugin/install-from-github/steps/__tests__/selectPackage.spec.tsx
+++ b/web/app/components/plugins/install-plugin/install-from-github/steps/__tests__/selectPackage.spec.tsx
@@ -38,6 +38,7 @@ vi.mock('@langgenius/dify-ui/select', async () => {
{children}
),
+ SelectLabel: ({ children }: { children: React.ReactNode }) =>
{children}
,
SelectTrigger: ({ children }: { children: React.ReactNode }) => {
const context = React.useContext(SelectContext)
return (
@@ -149,7 +150,8 @@ describe('SelectPackage', () => {
const getSection = (label: string): HTMLElement => {
const labelElement = screen.getByText(label)
- const section = labelElement.closest('label')?.nextElementSibling
+ const labelContainer = labelElement.closest('label') ?? labelElement.parentElement
+ const section = labelContainer?.parentElement
if (!(section instanceof HTMLElement))
throw new Error(`Missing section for ${label}`)
return section
diff --git a/web/app/components/plugins/install-plugin/install-from-github/steps/selectPackage.tsx b/web/app/components/plugins/install-plugin/install-from-github/steps/selectPackage.tsx
index 1dbd0f682e..dc7d8f75af 100644
--- a/web/app/components/plugins/install-plugin/install-from-github/steps/selectPackage.tsx
+++ b/web/app/components/plugins/install-plugin/install-from-github/steps/selectPackage.tsx
@@ -2,8 +2,8 @@
import type { PluginDeclaration, UpdateFromGitHubPayload } from '../../../types'
import { Button } from '@langgenius/dify-ui/button'
-import { FieldLabel, FieldRoot } from '@langgenius/dify-ui/field'
-import { Select, SelectContent, SelectItem, SelectItemIndicator, SelectItemText, SelectTrigger } from '@langgenius/dify-ui/select'
+import { FieldRoot } from '@langgenius/dify-ui/field'
+import { Select, SelectContent, SelectItem, SelectItemIndicator, SelectItemText, SelectLabel, SelectTrigger } from '@langgenius/dify-ui/select'
import * as React from 'react'
import { useTranslation } from 'react-i18next'
import Badge from '@/app/components/base/badge'
@@ -79,9 +79,6 @@ const SelectPackage: React.FC
= ({
return (
<>
-
- {t(`${i18nPrefix}.selectVersion`, { ns: 'plugin' })}
-