Skip to content

armgit / dify

Public Imported from GitHub
0

Build Agentic workflows, RAG pipelines, with rich AI model and tool support on one collaborative workspace. Deploy on cloud, VPC, or self-hosted, so teams move from prototype to production without rebuilding the stack.

fix: improve dataset settings accessibility (#42796)

Joel14d8eecea628
diff --git a/web/app/(commonLayout)/datasets/(datasetDetailLayout)/[datasetId]/settings/page.tsx b/web/app/(commonLayout)/datasets/(datasetDetailLayout)/[datasetId]/settings/page.tsx
index cd032df070c..49e9be980b4 100644
--- a/web/app/(commonLayout)/datasets/(datasetDetailLayout)/[datasetId]/settings/page.tsx
+++ b/web/app/(commonLayout)/datasets/(datasetDetailLayout)/[datasetId]/settings/page.tsx
@@ -5,9 +5,9 @@ const Settings = () => {
const { t } = useTranslation(['datasetSettings'])
return (
- <div className="h-full overflow-y-auto">
+ <div className="@container/settings h-full overflow-y-auto">
<div className="flex flex-col gap-y-0.5 px-6 pt-3 pb-2">
- <div className="system-xl-semibold text-text-primary">{t(($) => $.title)}</div>
+ <h1 className="system-xl-semibold text-text-primary">{t(($) => $.title)}</h1>
<div className="system-sm-regular text-text-tertiary">{t(($) => $.desc)}</div>
</div>
<Form />
diff --git a/web/app/components/app-sidebar/dataset-detail-sidebar.tsx b/web/app/components/app-sidebar/dataset-detail-sidebar.tsx
index 1d589c8e174..b7b0dd488b0 100644
--- a/web/app/components/app-sidebar/dataset-detail-sidebar.tsx
+++ b/web/app/components/app-sidebar/dataset-detail-sidebar.tsx
@@ -1,12 +1,18 @@
'use client'
import { DetailSidebarFrame } from '@/app/components/detail-sidebar'
+import useBreakpoints, { MediaType } from '@/hooks/use-breakpoints'
+import { usePathname } from '@/next/navigation'
import DatasetDetailSection from './dataset-detail-section'
import { DatasetDetailTop } from './dataset-detail-top'
export function DatasetDetailSidebar() {
+ const media = useBreakpoints()
+ const pathname = usePathname()
+
return (
<DetailSidebarFrame
+ compact={media === MediaType.mobile && pathname.endsWith('/settings')}
renderTop={({ expand, onToggle }) => <DatasetDetailTop expand={expand} onToggle={onToggle} />}
renderSection={({ expand }) => <DatasetDetailSection expand={expand} />}
/>
diff --git a/web/app/components/app/configuration/dataset-config/params-config/weighted-score.tsx b/web/app/components/app/configuration/dataset-config/params-config/weighted-score.tsx
index 762f9f9d75d..911d3a78144 100644
--- a/web/app/components/app/configuration/dataset-config/params-config/weighted-score.tsx
+++ b/web/app/components/app/configuration/dataset-config/params-config/weighted-score.tsx
@@ -59,7 +59,7 @@ const WeightedScore = ({ value, onChange = noop, readonly = false }: WeightedSco
</SliderControl>
</Slider>
</div>
- <div className="mt-3 flex justify-between">
+ <div className="mt-3 flex flex-wrap justify-between gap-2">
<div className="flex w-22.5 shrink-0 items-center system-xs-semibold-uppercase text-util-colors-blue-light-blue-light-500">
<div className="mr-1 truncate uppercase" title={semanticLabel || ''}>
{semanticLabel}
diff --git a/web/app/components/base/param-item/index.tsx b/web/app/components/base/param-item/index.tsx
index e7a71c8e44a..1bb2cc06e15 100644
--- a/web/app/components/base/param-item/index.tsx
+++ b/web/app/components/base/param-item/index.tsx
@@ -59,7 +59,7 @@ const ParamItem: FC<Props> = ({
<Fieldset className={className}>
<FieldsetLegend className="sr-only">{name}</FieldsetLegend>
<div className="flex items-center justify-between">
- <div className="flex h-6 items-center">
+ <div className="flex min-h-6 flex-wrap items-center gap-y-1">
{hasSwitch && (
<Switch
aria-labelledby={labelId}
@@ -85,8 +85,8 @@ const ParamItem: FC<Props> = ({
)}
</div>
</div>
- <div className="mt-1 flex items-center">
- <div className="mr-3 flex shrink-0 items-center">
+ <div className="mt-1 flex flex-wrap items-center gap-3">
+ <div className="flex shrink-0 items-center">
<NumberField
disabled={disabled || !enable}
min={min}
@@ -104,7 +104,7 @@ const ParamItem: FC<Props> = ({
</NumberFieldGroup>
</NumberField>
</div>
- <div className="flex grow items-center">
+ <div className="flex min-w-25 grow items-center">
<Slider
className="w-full"
disabled={disabled || !enable}
diff --git a/web/app/components/datasets/common/retrieval-method-config/__tests__/index.spec.tsx b/web/app/components/datasets/common/retrieval-method-config/__tests__/index.spec.tsx
index 569d0ebcd2d..ddd3c2a75e4 100644
--- a/web/app/components/datasets/common/retrieval-method-config/__tests__/index.spec.tsx
+++ b/web/app/components/datasets/common/retrieval-method-config/__tests__/index.spec.tsx
@@ -237,11 +237,10 @@ describe('RetrievalMethodConfig', () => {
it('should apply disabled state to option cards', () => {
renderComponent({ disabled: true })
- // When disabled, clicking should not trigger onChange
const semanticOption = screen.getByRole('radio', {
name: 'dataset.retrieval.semantic_search.title',
})
- expect(semanticOption).toHaveAttribute('aria-disabled', 'true')
+ expect(semanticOption).toBeDisabled()
})
it('should default disabled to false', () => {
@@ -334,7 +333,8 @@ describe('RetrievalMethodConfig', () => {
expect(onChange).not.toHaveBeenCalled()
})
- it('should not call onChange when disabled', () => {
+ it('should not call onChange when disabled', async () => {
+ const user = userEvent.setup()
const onChange = vi.fn()
renderComponent({
value: createMockRetrievalConfig({ search_method: RETRIEVE_METHOD.semantic }),
@@ -345,7 +345,7 @@ describe('RetrievalMethodConfig', () => {
const fullTextOption = screen.getByRole('radio', {
name: 'dataset.retrieval.full_text_search.title',
})
- fireEvent.click(fullTextOption!)
+ await user.click(fullTextOption)
expect(onChange).not.toHaveBeenCalled()
})
@@ -857,7 +857,7 @@ describe('RetrievalMethodConfig', () => {
const option = screen.getByRole('radio', {
name: 'dataset.retrieval.semantic_search.title',
})
- expect(option).toHaveAttribute('aria-disabled', 'true')
+ expect(option).toBeDisabled()
})
it('should handle disabled=false', () => {
diff --git a/web/app/components/datasets/settings/__tests__/option-card.spec.tsx b/web/app/components/datasets/settings/__tests__/option-card.spec.tsx
new file mode 100644
index 00000000000..c9995183880
--- /dev/null
+++ b/web/app/components/datasets/settings/__tests__/option-card.spec.tsx
@@ -0,0 +1,56 @@
+import { RadioGroup } from '@langgenius/dify-ui/radio-group'
+import { render, screen } from '@testing-library/react'
+import userEvent from '@testing-library/user-event'
+import OptionCard from '../option-card'
+
+describe('OptionCard disabled focus', () => {
+ it.each(['item', 'group'] as const)(
+ 'skips a selected radio disabled by the %s',
+ async (source) => {
+ const user = userEvent.setup()
+ const onValueChange = vi.fn()
+ render(
+ <>
+ <button type="button">Before</button>
+ <RadioGroup value="general" disabled={source === 'group'} onValueChange={onValueChange}>
+ <OptionCard
+ id="general"
+ title="General"
+ description="Current chunk structure"
+ disabled={source === 'item'}
+ />
+ </RadioGroup>
+ <button type="button">After</button>
+ </>,
+ )
+
+ const radio = screen.getByRole('radio', { name: 'General' })
+ expect(radio).toBeDisabled()
+ expect(radio).toBeChecked()
+ expect(radio).toHaveAccessibleDescription('Current chunk structure')
+ await user.tab()
+ expect(screen.getByRole('button', { name: 'Before' })).toHaveFocus()
+ await user.tab()
+ expect(screen.getByRole('button', { name: 'After' })).toHaveFocus()
+ await user.click(radio)
+ expect(radio).not.toHaveFocus()
+ expect(onValueChange).not.toHaveBeenCalled()
+ },
+ )
+
+ it('skips disabled options when navigating an enabled group with arrows', async () => {
+ const user = userEvent.setup()
+ render(
+ <RadioGroup defaultValue="first">
+ <OptionCard id="first" title="First" />
+ <OptionCard id="disabled" title="Unavailable" disabled />
+ <OptionCard id="last" title="Last" />
+ </RadioGroup>,
+ )
+ await user.tab()
+ expect(screen.getByRole('radio', { name: 'First' })).toHaveFocus()
+ await user.keyboard('{ArrowDown}')
+ expect(screen.getByRole('radio', { name: 'Last' })).toHaveFocus()
+ expect(screen.getByRole('radio', { name: 'Last' })).toBeChecked()
+ })
+})
diff --git a/web/app/components/datasets/settings/__tests__/summary-index-setting-accessibility.spec.tsx b/web/app/components/datasets/settings/__tests__/summary-index-setting-accessibility.spec.tsx
new file mode 100644
index 00000000000..5951b03de86
--- /dev/null
+++ b/web/app/components/datasets/settings/__tests__/summary-index-setting-accessibility.spec.tsx
@@ -0,0 +1,104 @@
+import type { ProviderWithModelsResponse } from '@dify/contracts/api/console/workspaces/types.gen'
+import { screen } from '@testing-library/react'
+import { NuqsTestingAdapter } from 'nuqs/adapters/testing'
+import { describe, expect, it } from 'vite-plus/test'
+import { consoleQuery } from '@/service/console'
+import { createConsoleQueryClient, renderWithConsoleQuery } from '@/test/console/query-data'
+import SummaryIndexSetting from '../summary-index-setting'
+
+const modelProvider = {
+ tenant_id: 'test-workspace',
+ provider: 'openai',
+ icon_small: { en_US: '', zh_Hans: '' },
+ label: { en_US: 'OpenAI', zh_Hans: 'OpenAI' },
+ status: 'active',
+ models: [
+ {
+ model: 'gpt-4',
+ label: { en_US: 'GPT-4', zh_Hans: 'GPT-4' },
+ model_type: 'llm',
+ fetch_from: 'predefined-model',
+ status: 'active',
+ model_properties: {},
+ deprecated: false,
+ has_invalid_load_balancing_configs: false,
+ load_balancing_enabled: false,
+ },
+ ],
+} satisfies ProviderWithModelsResponse
+
+describe.each(['knowledge-base', 'dataset-settings', 'create-document'] as const)(
+ 'SummaryIndexSetting %s accessible model name',
+ (entry) => {
+ it.each([
+ { selected: true, name: 'datasetSettings.form.summaryModel GPT-4' },
+ {
+ selected: false,
+ name: 'datasetSettings.form.summaryModel plugin.detailPanel.configureModel',
+ },
+ ])(
+ 'includes the visible label and current value (selected: $selected)',
+ ({ selected, name }) => {
+ const queryClient = createConsoleQueryClient()
+ queryClient.setQueryData(
+ consoleQuery.workspaces.current.modelProviders.summary.get.queryOptions().queryKey,
+ {
+ data: [
+ {
+ provider: 'openai',
+ plugin_id: 'langgenius/openai',
+ label: { en_US: 'OpenAI', zh_Hans: 'OpenAI' },
+ supported_model_types: ['llm'],
+ configurate_methods: ['predefined-model'],
+ preferred_provider_type: 'custom',
+ is_configured: true,
+ custom_configuration: {
+ status: 'active',
+ has_custom_models: false,
+ available_credentials: [],
+ current_credential_usable: true,
+ },
+ system_configuration: { enabled: false },
+ },
+ ],
+ plugins: {},
+ },
+ )
+ queryClient.setQueryData(
+ consoleQuery.workspaces.current.modelProviders.credits.get.queryOptions().queryKey,
+ {
+ remaining_credits: 0,
+ is_unlimited: false,
+ is_exhausted: true,
+ exhausted_at: null,
+ next_credit_reset_date: null,
+ pool_type: null,
+ quota_limit: 0,
+ quota_used: 0,
+ },
+ )
+ queryClient.setQueryData(
+ consoleQuery.workspaces.current.models.modelTypes.byModelType.get.queryOptions({
+ input: { params: { model_type: 'llm' } },
+ }).queryKey,
+ { data: [modelProvider] },
+ )
+
+ renderWithConsoleQuery(
+ <NuqsTestingAdapter>
+ <SummaryIndexSetting
+ entry={entry}
+ summaryIndexSetting={{
+ enable: true,
+ ...(selected && { model_provider_name: 'openai', model_name: 'gpt-4' }),
+ }}
+ />
+ </NuqsTestingAdapter>,
+ { queryClient },
+ )
+
+ expect(screen.getByRole('button', { name })).toBeInTheDocument()
+ },
+ )
+ },
+)
diff --git a/web/app/components/datasets/settings/form/components/__tests__/basic-info-section.spec.tsx b/web/app/components/datasets/settings/form/components/__tests__/basic-info-section.spec.tsx
index cf8ecbb2928..a705da7e542 100644
--- a/web/app/components/datasets/settings/form/components/__tests__/basic-info-section.spec.tsx
+++ b/web/app/components/datasets/settings/form/components/__tests__/basic-info-section.spec.tsx
@@ -3,6 +3,7 @@ import type { Member } from '@/models/common'
import type { DataSet, IconInfo } from '@/models/datasets'
import type { RetrievalConfig } from '@/types/app'
import { fireEvent, screen, waitFor } from '@testing-library/react'
+import userEvent from '@testing-library/user-event'
import { ChunkingMode, DatasetPermission, DataSourceType } from '@/models/datasets'
import { createConsoleQueryWrapper } from '@/test/console/query-data'
import { render as renderWithConsoleState } from '@/test/console/render'
@@ -215,11 +216,45 @@ describe('BasicInfoSection', () => {
expect(descriptionTextarea)!.toBeInTheDocument()
})
- it('should render app icon with emoji', () => {
- const { container } = render(<BasicInfoSection {...defaultProps} />)
- // The icon section should be rendered (emoji may be in a span or SVG)
- const iconSection = container.querySelector('[class*="cursor-pointer"]')
- expect(iconSection)!.toBeInTheDocument()
+ it('names the icon action and opens it with the keyboard', async () => {
+ const user = userEvent.setup()
+ const handleOpenAppIconPicker = vi.fn()
+ render(
+ <BasicInfoSection {...defaultProps} handleOpenAppIconPicker={handleOpenAppIconPicker} />,
+ )
+
+ const trigger = screen.getByRole('button', { name: 'datasetSettings.form.changeIcon' })
+ await user.tab()
+ expect(trigger).toHaveFocus()
+ await user.keyboard('{Enter}')
+ expect(handleOpenAppIconPicker).toHaveBeenCalledOnce()
+ })
+
+ it('associates the permissions field label without losing the selected value', () => {
+ render(<BasicInfoSection {...defaultProps} />)
+
+ expect(
+ screen.getByRole('button', {
+ name: /datasetSettings.form.permissions .*datasetSettings.form.permissionsOnlyMe/,
+ }),
+ ).toBeInTheDocument()
+ })
+
+ it('does not open the icon picker when settings are read-only', async () => {
+ const user = userEvent.setup()
+ const handleOpenAppIconPicker = vi.fn()
+ render(
+ <BasicInfoSection
+ {...defaultProps}
+ readonly
+ handleOpenAppIconPicker={handleOpenAppIconPicker}
+ />,
+ )
+
+ const trigger = screen.getByRole('button', { name: 'datasetSettings.form.changeIcon' })
+ expect(trigger).toBeDisabled()
+ await user.click(trigger)
+ expect(handleOpenAppIconPicker).not.toHaveBeenCalled()
})
})
@@ -288,18 +323,15 @@ describe('BasicInfoSection', () => {
})
describe('App Icon', () => {
- it('should call handleOpenAppIconPicker when icon is clicked', () => {
+ it('should call handleOpenAppIconPicker when icon is clicked', async () => {
+ const user = userEvent.setup()
const handleOpenAppIconPicker = vi.fn()
- const { container } = render(
+ render(
<BasicInfoSection {...defaultProps} handleOpenAppIconPicker={handleOpenAppIconPicker} />,
)
- // Find the clickable icon element - it's inside a wrapper that handles the click
- const iconWrapper = container.querySelector('[class*="cursor-pointer"]')
- if (iconWrapper) {
- fireEvent.click(iconWrapper)
- expect(handleOpenAppIconPicker).toHaveBeenCalled()
- }
+ await user.click(screen.getByRole('button', { name: 'datasetSettings.form.changeIcon' }))
+ expect(handleOpenAppIconPicker).toHaveBeenCalledOnce()
})
it('should not render AppIconPicker when showAppIconPicker is false', () => {
diff --git a/web/app/components/datasets/settings/form/components/__tests__/external-knowledge-section.spec.tsx b/web/app/components/datasets/settings/form/components/__tests__/external-knowledge-section.spec.tsx
index fe57b4921cb..176829a9d3b 100644
--- a/web/app/components/datasets/settings/form/components/__tests__/external-knowledge-section.spec.tsx
+++ b/web/app/components/datasets/settings/form/components/__tests__/external-knowledge-section.spec.tsx
@@ -229,24 +229,6 @@ describe('ExternalKnowledgeSection', () => {
})
})
- describe('Layout', () => {
- it('should have consistent row layout', () => {
- const { container } = render(<ExternalKnowledgeSection {...defaultProps} />)
-
- // Check for flex gap-x-1 class on rows
- const rows = container.querySelectorAll('.flex.gap-x-1')
- expect(rows.length).toBeGreaterThan(0)
- })
-
- it('should have consistent label width', () => {
- const { container } = render(<ExternalKnowledgeSection {...defaultProps} />)
-
- // Check for w-[180px] label containers
- const labels = container.querySelectorAll('.w-\\[180px\\]')
- expect(labels.length).toBeGreaterThan(0)
- })
- })
-
describe('Styling', () => {
it('should apply correct background to info displays', () => {
const { container } = render(<ExternalKnowledgeSection {...defaultProps} />)
diff --git a/web/app/components/datasets/settings/form/components/__tests__/reflow.browser.spec.tsx b/web/app/components/datasets/settings/form/components/__tests__/reflow.browser.spec.tsx
new file mode 100644
index 00000000000..9bcaca1b553
--- /dev/null
+++ b/web/app/components/datasets/settings/form/components/__tests__/reflow.browser.spec.tsx
@@ -0,0 +1,195 @@
+import type { DataSet } from '@/models/datasets'
+import type { RetrievalConfig } from '@/types/app'
+import { QueryClient, QueryClientProvider } from '@tanstack/react-query'
+import { useState } from 'react'
+import { page } from 'vite-plus/test/browser'
+import { render } from 'vitest-browser-react'
+import datasetSettings from '@/i18n/locales/en-US/dataset-settings.json'
+import { ChunkingMode, DatasetPermission, DataSourceType } from '@/models/datasets'
+import { RETRIEVE_METHOD } from '@/types/app'
+import { IndexingType } from '../../../../create/step-two'
+import ExternalKnowledgeSection from '../external-knowledge-section'
+import IndexingSection from '../indexing-section'
+
+vi.mock('react-i18next', async () => {
+ const { createReactI18nextMock } = await import('@/test/i18n-mock')
+ const { default: settings } = await import('@/i18n/locales/en-US/dataset-settings.json')
+ const { default: creation } = await import('@/i18n/locales/en-US/dataset-creation.json')
+ return createReactI18nextMock({ ...settings, ...creation })
+})
+vi.mock('@/context/i18n', () => ({ useDocLink: () => (path: string) => path }))
+vi.mock('@/features/system-features/client', () => ({
+ systemFeaturesQueryOptions: () => ({
+ queryKey: ['settings-reflow-system-features'],
+ queryFn: async () => ({ deployment_edition: 'CLOUD' }),
+ }),
+}))
+// These independently tested controls do not own the warning or external field layout.
+vi.mock('@/app/components/datasets/settings/chunk-structure', () => ({ default: () => null }))
+vi.mock('@/app/components/datasets/settings/summary-index-setting', () => ({ default: () => null }))
+vi.mock('@/app/components/header/account-setting/model-provider-page/model-selector', () => ({
+ ModelSelector: () => null,
+}))
+vi.mock('@/app/components/datasets/common/multimodal-retrieval-guidance', () => ({
+ MultimodalRetrievalGuidance: () => null,
+ MultimodalRetrievalGuidanceLearnMore: () => null,
+}))
+vi.mock('@/app/components/datasets/common/retrieval-method-config', () => ({ default: () => null }))
+vi.mock('@/app/components/datasets/common/economical-retrieval-method-config', () => ({
+ default: () => null,
+}))
+vi.mock('@/app/components/datasets/external-knowledge-base/create/RetrievalSettings', () => ({
+ default: () => null,
+}))
+
+const mockRetrievalConfig: RetrievalConfig = {
+ search_method: RETRIEVE_METHOD.semantic,
+ reranking_enable: false,
+ reranking_model: {
+ reranking_provider_name: '',
+ reranking_model_name: '',
+ },
+ top_k: 3,
+ score_threshold_enabled: false,
+ score_threshold: 0.5,
+}
+
+const mockDataset: DataSet = {
+ id: 'dataset-1',
+ name: 'Test Dataset',
+ description: 'Test description',
+ permission: DatasetPermission.onlyMe,
+ icon_info: {
+ icon_type: 'emoji',
+ icon: '📚',
+ icon_background: '#FFFFFF',
+ icon_url: '',
+ },
+ indexing_technique: IndexingType.ECONOMICAL,
+ indexing_status: 'completed',
+ data_source_type: DataSourceType.FILE,
+ doc_form: ChunkingMode.text,
+ embedding_model: 'text-embedding-ada-002',
+ embedding_model_provider: 'openai',
+ embedding_available: true,
+ app_count: 0,
+ document_count: 5,
+ total_document_count: 5,
+ word_count: 1000,
+ provider: 'vendor',
+ tags: [],
+ partial_member_list: [],
+ external_knowledge_info: {
+ external_knowledge_id: 'ext-1',
+ external_knowledge_api_id: 'api-1',
+ external_knowledge_api_name: 'External API',
+ external_knowledge_api_endpoint: 'https://api.example.com',
+ },
+ external_retrieval_model: {
+ top_k: 3,
+ score_threshold: 0.7,
+ score_threshold_enabled: true,
+ },
+ retrieval_model_dict: mockRetrievalConfig,
+ retrieval_model: mockRetrievalConfig,
+ built_in_field_enabled: false,
+ keyword_number: 10,
+ created_by: 'user-1',
+ updated_by: 'user-1',
+ updated_at: 0,
+ runtime_mode: 'general',
+ enable_api: true,
+ is_multimodal: false,
+}
+
+const UpgradeSettings = () => {
+ const [indexMethod, setIndexMethod] = useState<IndexingType | undefined>(IndexingType.ECONOMICAL)
+ return (
+ <IndexingSection
+ currentDataset={mockDataset}
+ indexMethod={indexMethod}
+ setIndexMethod={setIndexMethod}
+ keywordNumber={10}
+ setKeywordNumber={vi.fn()}
+ embeddingModel={{ provider: 'openai', model: 'text-embedding-ada-002' }}
+ setEmbeddingModel={vi.fn()}
+ embeddingModelList={[]}
+ retrievalConfig={mockRetrievalConfig}
+ setRetrievalConfig={vi.fn()}
+ summaryIndexSetting={undefined}
+ handleSummaryIndexSettingChange={vi.fn()}
+ showMultiModalTip={false}
+ />
+ )
+}
+
+const expectTextWithin = (element: Element, container: Element) => {
+ const range = document.createRange()
+ range.selectNodeContents(element)
+ const bounds = container.getBoundingClientRect()
+ const lines = [...range.getClientRects()]
+ expect(lines.length).toBeGreaterThan(1)
+ for (const line of lines) {
+ expect(line.left).toBeGreaterThanOrEqual(bounds.left - 1)
+ expect(line.right).toBeLessThanOrEqual(bounds.right + 1)
+ expect(line.top).toBeGreaterThanOrEqual(bounds.top - 1)
+ expect(line.bottom).toBeLessThanOrEqual(bounds.bottom + 1)
+ }
+ expect(bounds.right).toBeLessThanOrEqual(220)
+}
+
+describe('Knowledge settings narrow-screen readability', () => {
+ beforeEach(async () => {
+ await page.viewport(320, 900)
+ })
+ afterEach(async () => {
+ await page.viewport(1280, 720)
+ })
+
+ // DOM presence checks miss text painted outside fixed-height warnings and long URL fields.
+ // Keep the production sections and assert every rendered text line fits its visible field.
+ it('keeps the full upgrade warning inside its panel after selecting High Quality', async () => {
+ const queryClient = new QueryClient({ defaultOptions: { queries: { retry: false } } })
+ const screen = await render(
+ <QueryClientProvider client={queryClient}>
+ <div className="@container/settings" style={{ width: 220 }}>
+ <UpgradeSettings />
+ </div>
+ </QueryClientProvider>,
+ )
+ await screen.getByRole('radio', { name: /High Quality/ }).click()
+ const warning = screen.getByText(datasetSettings['form.upgradeHighQualityTip'])
+ await expect.element(warning).toBeVisible()
+ const text = warning.element()
+ expectTextWithin(text, text.parentElement!)
+ queryClient.clear()
+ })
+
+ it('wraps a long external API endpoint so the entire address can be read', async () => {
+ const endpoint =
+ 'https://knowledge-api.example.com/retrieval/customer-specific-knowledge-collection-with-a-long-identifier'
+ const screen = await render(
+ <div className="@container/settings" style={{ width: 220 }}>
+ <ExternalKnowledgeSection
+ currentDataset={{
+ ...mockDataset,
+ provider: 'external',
+ external_knowledge_info: {
+ ...mockDataset.external_knowledge_info,
+ external_knowledge_api_endpoint: endpoint,
+ },
+ }}
+ topK={3}
+ scoreThreshold={0.5}
+ scoreThresholdEnabled={false}
+ handleSettingsChange={vi.fn()}
+ />
+ </div>,
+ )
+ const address = screen.getByText(endpoint)
+ await expect.element(address).toBeVisible()
+ const text = address.element()
+ expectTextWithin(text, text.parentElement!)
+ expect(document.documentElement.scrollWidth).toBeLessThanOrEqual(320)
+ })
+})
diff --git a/web/app/components/datasets/settings/form/components/basic-info-section.tsx b/web/app/components/datasets/settings/form/components/basic-info-section.tsx
index 2d144f95883..30107d0dae7 100644
--- a/web/app/components/datasets/settings/form/components/basic-info-section.tsx
+++ b/web/app/components/datasets/settings/form/components/basic-info-section.tsx
@@ -3,15 +3,17 @@ import type { AppIconSelection } from '@/app/components/base/app-icon-picker'
import type { Member } from '@/models/common'
import type { DataSet, DatasetPermission, IconInfo } from '@/models/datasets'
import type { AppIconType } from '@/types/app'
+import { IconButton } from '@langgenius/dify-ui/icon-button'
import { Input } from '@langgenius/dify-ui/input'
import { Textarea } from '@langgenius/dify-ui/textarea'
+import { useId } from 'react'
import { useTranslation } from 'react-i18next'
import AppIcon from '@/app/components/base/app-icon'
import AppIconPicker from '@/app/components/base/app-icon-picker'
import PermissionSelector from '../../permission-selector'
-const rowClass = 'flex gap-x-1'
-const labelClass = 'flex items-center shrink-0 w-[180px] h-7 pt-1'
+const rowClass = 'flex min-w-0 flex-col gap-2 @3xl/settings:flex-row @3xl/settings:gap-x-1'
+const labelClass = 'flex shrink-0 flex-col pt-1 @3xl/settings:w-45'
type BasicInfoSectionProps = {
currentDataset: DataSet | undefined
@@ -51,6 +53,7 @@ const BasicInfoSection = ({
readonly = false,
}: BasicInfoSectionProps) => {
const { t } = useTranslation(['datasetSettings'])
+ const permissionLabelId = useId()
return (
<>
@@ -61,17 +64,24 @@ const BasicInfoSection = ({
{t(($) => $['form.nameAndIcon'], { ns: 'datasetSettings' })}
</div>
</div>
- <div className="flex grow items-center gap-x-2">
- <AppIcon
- size="small"
- onClick={readonly ? undefined : handleOpenAppIconPicker}
- className={readonly ? undefined : 'cursor-pointer'}
- iconType={iconInfo.icon_type as AppIconType}
- icon={iconInfo.icon}
- background={iconInfo.icon_background}
- imageUrl={iconInfo.icon_url}
- showEditIcon={!readonly}
- />
+ <div className="flex min-w-0 grow items-center gap-x-2">
+ <IconButton
+ size="lg"
+ aria-label={t(($) => $['form.changeIcon'], { ns: 'datasetSettings' })}
+ disabled={readonly}
+ onClick={handleOpenAppIconPicker}
+ >
+ <span aria-hidden="true">
+ <AppIcon
+ size="small"
+ decorative
+ iconType={iconInfo.icon_type as AppIconType}
+ icon={iconInfo.icon}
+ background={iconInfo.icon_background}
+ imageUrl={iconInfo.icon_url}
+ />
+ </span>
+ </IconButton>
<Input
aria-label={t(($) => $['form.name'], { ns: 'datasetSettings' })}
disabled={!currentDataset?.embedding_available || readonly}
@@ -88,7 +98,7 @@ const BasicInfoSection = ({
{t(($) => $['form.desc'], { ns: 'datasetSettings' })}
</div>
</div>
- <div className="grow">
+ <div className="min-w-0 grow">
<Textarea
aria-label={t(($) => $['form.desc'], { ns: 'datasetSettings' })}
disabled={!currentDataset?.embedding_available || readonly}
@@ -103,12 +113,13 @@ const BasicInfoSection = ({
{/* Permissions */}
<div className={rowClass}>
<div className={labelClass}>
- <div className="system-sm-semibold text-text-secondary">
+ <div id={permissionLabelId} className="system-sm-semibold text-text-secondary">
{t(($) => $['form.permissions'], { ns: 'datasetSettings' })}
</div>
</div>
- <div className="grow">
+ <div className="min-w-0 grow">
<PermissionSelector
+ aria-labelledby={permissionLabelId}
disabled={!currentDataset?.embedding_available || readonly}
permission={permission}
value={selectedMemberIDs}
diff --git a/web/app/components/datasets/settings/form/components/external-knowledge-section.tsx b/web/app/components/datasets/settings/form/components/external-knowledge-section.tsx
index def1851792a..f69a1ad8408 100644
--- a/web/app/components/datasets/settings/form/components/external-knowledge-section.tsx
+++ b/web/app/components/datasets/settings/form/components/external-knowledge-section.tsx
@@ -4,8 +4,8 @@ import { Separator } from '@langgenius/dify-ui/separator'
import { useTranslation } from 'react-i18next'
import RetrievalSettings from '../../../external-knowledge-base/create/RetrievalSettings'
-const rowClass = 'flex gap-x-1'
-const labelClass = 'flex items-center shrink-0 w-[180px] h-7 pt-1'
+const rowClass = 'flex min-w-0 flex-col gap-2 @3xl/settings:flex-row @3xl/settings:gap-x-1'
+const labelClass = 'flex shrink-0 flex-col pt-1 @3xl/settings:w-45'
type ExternalKnowledgeSectionProps = {
currentDataset: DataSet
@@ -60,17 +60,17 @@ const ExternalKnowledgeSection = ({
{t(($) => $['form.externalKnowledgeAPI'], { ns: 'datasetSettings' })}
</div>
</div>
- <div className="w-full">
- <div className="flex h-full items-center gap-1 rounded-lg bg-components-input-bg-normal px-3 py-2">
+ <div className="w-full min-w-0">
+ <div className="flex h-full flex-wrap items-center gap-1 rounded-lg bg-components-input-bg-normal px-3 py-2">
<span
aria-hidden
- className="i-custom-vender-solid-development-api-connection-mod size-4 text-text-secondary"
+ className="i-custom-vender-solid-development-api-connection-mod size-4 shrink-0 text-text-secondary"
/>
- <div className="overflow-hidden system-sm-medium text-ellipsis text-text-secondary">
+ <div className="min-w-0 system-sm-medium wrap-anywhere text-text-secondary">
{currentDataset.external_knowledge_info.external_knowledge_api_name}
</div>
<div className="system-xs-regular text-text-tertiary">·</div>
- <div className="system-xs-regular text-text-tertiary">
+ <div className="min-w-0 system-xs-regular wrap-anywhere text-text-tertiary">
{currentDataset.external_knowledge_info.external_knowledge_api_endpoint}
</div>
</div>
diff --git a/web/app/components/datasets/settings/form/components/indexing-section.tsx b/web/app/components/datasets/settings/form/components/indexing-section.tsx
index ce7e3ed816d..3b864bebef3 100644
--- a/web/app/components/datasets/settings/form/components/indexing-section.tsx
+++ b/web/app/components/datasets/settings/form/components/indexing-section.tsx
@@ -5,6 +5,7 @@ import type { DataSet, SummaryIndexSetting as SummaryIndexSettingType } from '@/
import type { RetrievalConfig } from '@/types/app'
import { Separator } from '@langgenius/dify-ui/separator'
import { useSuspenseQuery } from '@tanstack/react-query'
+import { useId } from 'react'
import { useTranslation } from 'react-i18next'
import EconomicalRetrievalMethodConfig from '@/app/components/datasets/common/economical-retrieval-method-config'
import {
@@ -21,8 +22,8 @@ import ChunkStructure from '../../chunk-structure'
import IndexMethod from '../../index-method'
import SummaryIndexSetting from '../../summary-index-setting'
-const rowClass = 'flex gap-x-1'
-const labelClass = 'flex items-center shrink-0 w-[180px] h-7 pt-1'
+const rowClass = 'flex min-w-0 flex-col gap-2 @3xl/settings:flex-row @3xl/settings:gap-x-1'
+const labelClass = 'flex shrink-0 flex-col pt-1 @3xl/settings:w-45'
type IndexingSectionProps = {
currentDataset: DataSet | undefined
@@ -62,6 +63,7 @@ const IndexingSection = ({
ChunkingMode.parentChild,
]
+ const embeddingModelLabelId = useId()
const { t } = useTranslation(['datasetSettings'])
const { data: deploymentEdition } = useSuspenseQuery({
...systemFeaturesQueryOptions(),
@@ -92,7 +94,7 @@ const IndexingSection = ({
<>
<Separator orientation="horizontal" className="my-1 bg-divider-subtle" />
<div className={rowClass}>
- <div className="flex w-45 shrink-0 flex-col">
+ <div className="flex shrink-0 flex-col @3xl/settings:w-45">
<div className="flex h-8 items-center system-sm-semibold text-text-secondary">
{t(($) => $['form.chunkStructure.title'], { ns: 'datasetSettings' })}
</div>
@@ -108,7 +110,7 @@ const IndexingSection = ({
{t(($) => $['form.chunkStructure.description'], { ns: 'datasetSettings' })}
</div>
</div>
- <div className="grow">
+ <div className="min-w-0 grow">
<ChunkStructure chunkStructure={currentDataset?.doc_form} />
</div>
</div>
@@ -127,7 +129,7 @@ const IndexingSection = ({
{t(($) => $['form.indexMethod'], { ns: 'datasetSettings' })}
</div>
</div>
- <div className="grow">
+ <div className="min-w-0 grow">
<IndexMethod
value={indexMethod!}
disabled={!currentDataset?.embedding_available || readonly}
@@ -137,12 +139,15 @@ const IndexingSection = ({
onKeywordNumberChange={setKeywordNumber}
/>
{showUpgradeWarning && (
- <div className="relative mt-2 flex h-10 items-center gap-x-0.5 overflow-hidden rounded-xl border-[0.5px] border-components-panel-border bg-components-panel-bg-blur px-2 shadow-xs shadow-shadow-shadow-3">
- <div className="absolute top-0 left-0 flex size-full items-center bg-toast-warning-bg opacity-40" />
- <div className="p-1">
- <span className="i-ri-alert-fill size-4 text-text-warning-secondary" />
+ <div className="relative mt-2 flex min-h-10 items-start gap-x-0.5 rounded-xl border-[0.5px] border-components-panel-border bg-components-panel-bg-blur px-2 py-2 shadow-xs shadow-shadow-shadow-3">
+ <div className="pointer-events-none absolute inset-0 rounded-xl bg-toast-warning-bg opacity-40" />
+ <div className="relative shrink-0 p-1">
+ <span
+ aria-hidden
+ className="i-ri-alert-fill size-4 text-text-warning-secondary"
+ />
</div>
- <span className="system-xs-medium text-text-primary">
+ <span className="relative min-w-0 py-1 system-xs-medium wrap-anywhere text-text-primary">
{t(($) => $['form.upgradeHighQualityTip'], { ns: 'datasetSettings' })}
</span>
</div>
@@ -154,13 +159,13 @@ const IndexingSection = ({
{/* Embedding ProviderWithModelsResponse */}
{indexMethod === IndexingType.QUALIFIED && (
<div className={rowClass}>
- <div className="flex w-45 shrink-0 flex-col pt-1">
- <div className="system-sm-semibold text-text-secondary">
+ <div className="flex shrink-0 flex-col pt-1 @3xl/settings:w-45">
+ <div id={embeddingModelLabelId} className="system-sm-semibold text-text-secondary">
{t(($) => $['form.embeddingModel'], { ns: 'datasetSettings' })}
</div>
<MultimodalRetrievalGuidanceLearnMore />
</div>
- <div className="grow">
+ <div className="min-w-0 grow">
<MultimodalRetrievalGuidance
variant="settings"
embeddingModel={embeddingModel}
@@ -168,6 +173,7 @@ const IndexingSection = ({
className="mb-2"
/>
<ModelSelector
+ aria-labelledby={embeddingModelLabelId}
value={embeddingModel}
models={embeddingModelList}
onValueChange={setEmbeddingModel}
@@ -196,7 +202,7 @@ const IndexingSection = ({
<Separator orientation="horizontal" className="my-1 bg-divider-subtle" />
<div className={rowClass}>
<div className={labelClass}>
- <div className="flex w-45 shrink-0 flex-col">
+ <div className="flex shrink-0 flex-col @3xl/settings:w-45">
<div className="flex h-7 items-center pt-1 system-sm-semibold text-text-secondary">
{t(($) => $['form.retrievalSetting.title'], { ns: 'datasetSettings' })}
</div>
@@ -213,7 +219,7 @@ const IndexingSection = ({
</div>
</div>
</div>
- <div className="grow">
+ <div className="min-w-0 grow">
{indexMethod === IndexingType.QUALIFIED ? (
<RetrievalMethodConfig
value={retrievalConfig}
diff --git a/web/app/components/datasets/settings/form/index.tsx b/web/app/components/datasets/settings/form/index.tsx
index f5a969dba90..84c186274cc 100644
--- a/web/app/components/datasets/settings/form/index.tsx
+++ b/web/app/components/datasets/settings/form/index.tsx
@@ -69,7 +69,7 @@ const Form = () => {
const readonly = !canEditSettings
return (
- <div className="flex w-full flex-col gap-y-4 px-20 py-8 sm:w-240">
+ <div className="flex w-full max-w-240 flex-col gap-y-4 px-4 py-8 @3xl/settings:px-20">
<BasicInfoSection
currentDataset={currentDataset}
name={name}
@@ -121,7 +121,7 @@ const Form = () => {
{/* Save Button */}
<div className="flex gap-x-1">
- <div className="flex h-7 w-45 shrink-0 items-center pt-1" />
+ <div className="hidden h-7 w-45 shrink-0 items-center pt-1 @3xl/settings:flex" />
<div className="grow">
<Button
className="min-w-24"
diff --git a/web/app/components/datasets/settings/index-method/__tests__/index.spec.tsx b/web/app/components/datasets/settings/index-method/__tests__/index.spec.tsx
index 0fe7f5a8adf..7c525ada237 100644
--- a/web/app/components/datasets/settings/index-method/__tests__/index.spec.tsx
+++ b/web/app/components/datasets/settings/index-method/__tests__/index.spec.tsx
@@ -107,4 +107,16 @@ describe('IndexMethod', () => {
expect(economy).not.toBeChecked()
expect(screen.queryByRole('textbox')).not.toBeInTheDocument()
})
+
+ it('shows and associates the downgrade explanation without opening a popup', () => {
+ render(<Settings currentValue={IndexingType.QUALIFIED} />)
+ const economy = screen.getByRole('radio', { name: 'datasetSettings.form.indexMethodEconomy' })
+
+ expect(
+ screen.getByText(/datasetSettings.form.indexMethodChangeToEconomyDisabledTip/),
+ ).toBeVisible()
+ expect(economy).toHaveAccessibleDescription(
+ /datasetSettings.form.indexMethodChangeToEconomyDisabledTip/,
+ )
+ })
})
diff --git a/web/app/components/datasets/settings/index-method/index.tsx b/web/app/components/datasets/settings/index-method/index.tsx
index 3bfb58f86cd..9ec90aea778 100644
--- a/web/app/components/datasets/settings/index-method/index.tsx
+++ b/web/app/components/datasets/settings/index-method/index.tsx
@@ -1,5 +1,4 @@
'use client'
-import { Popover, PopoverContent, PopoverTrigger } from '@langgenius/dify-ui/popover'
import { RadioGroup } from '@langgenius/dify-ui/radio-group'
import { useTranslation } from 'react-i18next'
import { IndexingType } from '../../create/step-two'
@@ -50,41 +49,35 @@ const IndexMethod = ({
className="gap-x-2"
/>
{/* Economy */}
- <Popover>
- <PopoverTrigger nativeButton={false} openOnHover={isEconomyDisabled} render={<div />}>
- <OptionCard
- id={IndexingType.ECONOMICAL}
- isActive={value === IndexingType.ECONOMICAL}
- icon={<span aria-hidden className="i-custom-vender-knowledge-economic size-4.5" />}
- iconActiveColor="text-util-colors-indigo-indigo-600"
- title={t(($) => $['form.indexMethodEconomy'], { ns: 'datasetSettings' })}
- description={t(($) => $['form.indexMethodEconomyTip'], {
- ns: 'datasetSettings',
- count: keywordNumber,
- })}
- disabled={disabled || isEconomyDisabled}
- effectColor={EffectColor.indigo}
- showEffectColor
- showChildren={value === IndexingType.ECONOMICAL}
- className="gap-x-2"
- >
- <KeywordNumber
- disabled={disabled || isEconomyDisabled}
- keywordNumber={keywordNumber}
- onKeywordNumberChange={onKeywordNumberChange}
- />
- </OptionCard>
- </PopoverTrigger>
- {isEconomyDisabled && (
- <PopoverContent
- placement="right"
- sideOffset={4}
- className="rounded-lg border-0 bg-components-tooltip-bg p-3 text-xs font-medium text-text-secondary shadow-lg"
- >
- {t(($) => $['form.indexMethodChangeToEconomyDisabledTip'], { ns: 'datasetSettings' })}
- </PopoverContent>
- )}
- </Popover>
+ <OptionCard
+ id={IndexingType.ECONOMICAL}
+ isActive={value === IndexingType.ECONOMICAL}
+ icon={<span aria-hidden className="i-custom-vender-knowledge-economic size-4.5" />}
+ iconActiveColor="text-util-colors-indigo-indigo-600"
+ title={t(($) => $['form.indexMethodEconomy'], { ns: 'datasetSettings' })}
+ description={[
+ t(($) => $['form.indexMethodEconomyTip'], {
+ ns: 'datasetSettings',
+ count: keywordNumber,
+ }),
+ isEconomyDisabled
+ ? t(($) => $['form.indexMethodChangeToEconomyDisabledTip'], { ns: 'datasetSettings' })
+ : '',
+ ]
+ .filter(Boolean)
+ .join(' ')}
+ disabled={disabled || isEconomyDisabled}
+ effectColor={EffectColor.indigo}
+ showEffectColor
+ showChildren={value === IndexingType.ECONOMICAL}
+ className="gap-x-2"
+ >
+ <KeywordNumber
+ disabled={disabled || isEconomyDisabled}
+ keywordNumber={keywordNumber}
+ onKeywordNumberChange={onKeywordNumberChange}
+ />
+ </OptionCard>
</RadioGroup>
)
}
diff --git a/web/app/components/datasets/settings/option-card.tsx b/web/app/components/datasets/settings/option-card.tsx
index 4561503aaed..9befd51b2bb 100644
--- a/web/app/components/datasets/settings/option-card.tsx
+++ b/web/app/components/datasets/settings/option-card.tsx
@@ -3,7 +3,6 @@ import { cn } from '@langgenius/dify-ui/cn'
import { RadioItem } from '@langgenius/dify-ui/radio-group'
import * as React from 'react'
import { useTranslation } from 'react-i18next'
-import Badge from '@/app/components/base/badge'
import { EffectColor } from './chunk-structure/types'
const HEADER_EFFECT_MAP: Record<EffectColor, string> = {
@@ -59,6 +58,8 @@ const OptionCard = <T,>({
)}
>
<RadioItem<T>
+ nativeButton
+ render={<button type="button" />}
value={id}
disabled={disabled}
aria-labelledby={titleId}
@@ -69,7 +70,7 @@ const OptionCard = <T,>({
)}
>
{effectColor && showEffectColor && (
- <div
+ <span
className={cn(
'absolute -top-0.5 -left-0.5 h-14 w-14 rounded-full blur-[80px]',
`${HEADER_EFFECT_MAP[effectColor]}`,
@@ -77,32 +78,32 @@ const OptionCard = <T,>({
/>
)}
{!!icon && (
- <div
+ <span
className={cn(
'flex size-6 shrink-0 items-center justify-center text-text-tertiary',
isActive && iconActiveColor,
)}
>
{icon}
- </div>
+ </span>
)}
- <div className="flex min-w-0 grow flex-col gap-y-0.5 py-px">
- <div className="flex items-center gap-x-1">
+ <span className="flex min-w-0 grow flex-col gap-y-0.5 py-px">
+ <span className="flex items-center gap-x-1">
<span id={titleId} className="system-sm-medium text-text-secondary">
{title}
</span>
{isRecommended && (
- <Badge className="h-4.5 border-text-accent-secondary text-text-accent-secondary">
+ <span className="badge h-4.5 badge-m border-text-accent-secondary px-1.25 py-0.5 system-2xs-medium text-text-accent-secondary">
{t(($) => $['stepTwo.recommend'], { ns: 'datasetCreation' })}
- </Badge>
+ </span>
)}
- </div>
+ </span>
{description && (
- <div id={descriptionId} className="system-xs-regular text-text-tertiary">
+ <span id={descriptionId} className="system-xs-regular text-text-tertiary">
{description}
- </div>
+ </span>
)}
- </div>
+ </span>
</RadioItem>
{!!(children && showChildren) && (
<div
diff --git a/web/app/components/datasets/settings/permission-selector/index.tsx b/web/app/components/datasets/settings/permission-selector/index.tsx
index 04850feb9c1..12de9c4f491 100644
--- a/web/app/components/datasets/settings/permission-selector/index.tsx
+++ b/web/app/components/datasets/settings/permission-selector/index.tsx
@@ -5,7 +5,7 @@ import { Popover, PopoverContent, PopoverTitle, PopoverTrigger } from '@langgeni
import { RadioGroup } from '@langgenius/dify-ui/radio-group'
import { useSuspenseQuery } from '@tanstack/react-query'
import { useDebouncedValue } from 'foxact/use-debounced-value'
-import { useMemo, useState } from 'react'
+import { useId, useMemo, useState } from 'react'
import { useTranslation } from 'react-i18next'
import { SearchInput } from '@/app/components/base/search-input'
import { userProfileQueryOptions } from '@/features/account-profile/client'
@@ -15,6 +15,7 @@ import MemberItem from './member-item'
import PermissionItem from './permission-item'
type PermissionSelectorProps = {
+ 'aria-labelledby'?: string
disabled?: boolean
permission?: DatasetPermission
value: string[]
@@ -24,6 +25,7 @@ type PermissionSelectorProps = {
}
const PermissionSelector = ({
+ 'aria-labelledby': labelledBy,
disabled,
permission,
value,
@@ -31,6 +33,7 @@ const PermissionSelector = ({
onChange,
onMemberSelect,
}: PermissionSelectorProps) => {
+ const triggerId = useId()
const { t } = useTranslation(['common', 'datasetSettings'])
const { data: userProfile } = useSuspenseQuery({
...userProfileQueryOptions(),
@@ -78,6 +81,8 @@ const PermissionSelector = ({
return (
<Popover>
<PopoverTrigger
+ id={triggerId}
+ aria-labelledby={labelledBy ? `${labelledBy} ${triggerId}` : undefined}
disabled={isDisabled}
className={cn(
'group/permission-trigger flex w-full cursor-pointer touch-manipulation items-center gap-x-0.5 rounded-lg bg-components-input-bg-normal px-2 py-1 text-left outline-hidden hover:bg-state-base-hover-alt focus-visible:ring-2 focus-visible:ring-state-accent-solid data-popup-open:bg-state-base-hover-alt',
@@ -161,10 +166,10 @@ const PermissionSelector = ({
<PopoverContent
placement="bottom-start"
sideOffset={4}
- className="border-none bg-transparent shadow-none"
+ className="max-w-(--available-width) border-none bg-transparent shadow-none"
>
<PopoverTitle className="sr-only">{permissionLabel}</PopoverTitle>
- <div className="relative w-120 rounded-xl border-[0.5px] border-components-panel-border bg-components-panel-bg-blur shadow-lg shadow-shadow-shadow-5">
+ <div className="relative w-120 max-w-full rounded-xl border-[0.5px] border-components-panel-border bg-components-panel-bg-blur shadow-lg shadow-shadow-shadow-5">
<RadioGroup<DatasetPermission>
value={permission}
onValueChange={(nextPermission) => {
diff --git a/web/app/components/datasets/settings/summary-index-setting.tsx b/web/app/components/datasets/settings/summary-index-setting.tsx
index 7a6ea64ec27..5462ad45d24 100644
--- a/web/app/components/datasets/settings/summary-index-setting.tsx
+++ b/web/app/components/datasets/settings/summary-index-setting.tsx
@@ -24,6 +24,7 @@ const SummaryIndexSetting = ({
}: SummaryIndexSettingProps) => {
const { t } = useTranslation(['datasetDocuments', 'datasetSettings'])
const summaryLabelId = useId()
+ const summaryModelLabelId = useId()
const { data: textGenerationModelList = [] } = useQuery(
consoleQuery.workspaces.current.models.modelTypes.byModelType.get.queryOptions({
input: { params: { model_type: ModelTypeEnum.textGeneration } },
@@ -93,10 +94,14 @@ const SummaryIndexSetting = ({
</div>
{summaryIndexSetting?.enable && (
<div>
- <div className="mt-2 mb-1.5 flex h-6 items-center system-xs-medium-uppercase text-text-tertiary">
+ <div
+ id={summaryModelLabelId}
+ className="mt-2 mb-1.5 flex h-6 items-center system-xs-medium-uppercase text-text-tertiary"
+ >
{t(($) => $['form.summaryModel'], { ns: 'datasetSettings' })}
</div>
<ModelSelector
+ aria-labelledby={summaryModelLabelId}
value={
summaryIndexModelConfig && {
provider: summaryIndexModelConfig.providerName,
@@ -129,8 +134,8 @@ const SummaryIndexSetting = ({
if (entry === 'dataset-settings') {
return (
<div className="space-y-4">
- <div className="flex gap-x-1">
- <div className="flex h-7 w-45 shrink-0 items-center pt-1">
+ <div className="flex min-w-0 flex-col gap-2 @3xl/settings:flex-row @3xl/settings:gap-x-1">
+ <div className="flex shrink-0 items-center pt-1 @3xl/settings:w-45">
<div id={summaryLabelId} className="system-sm-semibold text-text-secondary">
{t(($) => $['form.summaryAutoGen'], { ns: 'datasetSettings' })}
</div>
@@ -159,14 +164,15 @@ const SummaryIndexSetting = ({
</div>
{summaryIndexSetting?.enable && (
<>
- <div className="flex gap-x-1">
- <div className="flex h-7 w-45 shrink-0 items-center pt-1">
- <div className="system-sm-medium text-text-tertiary">
+ <div className="flex min-w-0 flex-col gap-2 @3xl/settings:flex-row @3xl/settings:gap-x-1">
+ <div className="flex shrink-0 items-center pt-1 @3xl/settings:w-45">
+ <div id={summaryModelLabelId} className="system-sm-medium text-text-tertiary">
{t(($) => $['form.summaryModel'], { ns: 'datasetSettings' })}
</div>
</div>
- <div className="grow">
+ <div className="min-w-0 grow">
<ModelSelector
+ aria-labelledby={summaryModelLabelId}
value={
summaryIndexModelConfig && {
provider: summaryIndexModelConfig.providerName,
@@ -180,13 +186,13 @@ const SummaryIndexSetting = ({
/>
</div>
</div>
- <div className="flex">
- <div className="flex h-7 w-45 shrink-0 items-center pt-1">
+ <div className="flex min-w-0 flex-col gap-2 @3xl/settings:flex-row">
+ <div className="flex shrink-0 items-center pt-1 @3xl/settings:w-45">
<div className="system-sm-medium text-text-tertiary">
{t(($) => $['form.summaryInstructions'], { ns: 'datasetSettings' })}
</div>
</div>
- <div className="grow">
+ <div className="min-w-0 grow">
<Textarea
aria-label={t(($) => $['form.summaryInstructions'], { ns: 'datasetSettings' })}
value={summaryIndexSetting?.summary_prompt ?? ''}
@@ -222,10 +228,14 @@ const SummaryIndexSetting = ({
{summaryIndexSetting?.enable && (
<>
<div>
- <div className="mb-1.5 flex h-6 items-center system-sm-medium text-text-secondary">
+ <div
+ id={summaryModelLabelId}
+ className="mb-1.5 flex h-6 items-center system-sm-medium text-text-secondary"
+ >
{t(($) => $['form.summaryModel'], { ns: 'datasetSettings' })}
</div>
<ModelSelector
+ aria-labelledby={summaryModelLabelId}
value={
summaryIndexModelConfig && {
provider: summaryIndexModelConfig.providerName,
diff --git a/web/app/components/detail-sidebar/__tests__/index.spec.tsx b/web/app/components/detail-sidebar/__tests__/index.spec.tsx
index 34cc33f9bcc..8ed88e2e713 100644
--- a/web/app/components/detail-sidebar/__tests__/index.spec.tsx
+++ b/web/app/components/detail-sidebar/__tests__/index.spec.tsx
@@ -1,5 +1,6 @@
import { HotkeysProvider } from '@tanstack/react-hotkeys'
import { fireEvent, screen } from '@testing-library/react'
+import userEvent from '@testing-library/user-event'
import { renderWithConsoleQuery } from '@/test/console/query-data'
import { DetailSidebarFrame } from '..'
import { DETAIL_SIDEBAR_STORAGE_KEY } from '../storage'
@@ -27,10 +28,12 @@ vi.mock('@/app/components/header/env-nav', () => ({
function renderDetailSidebarFrame(
currentEnv: string | null = null,
platform: 'mac' | 'windows' = 'mac',
+ compact = false,
) {
return renderWithConsoleQuery(
<HotkeysProvider defaultOptions={{ hotkey: { platform } }}>
<DetailSidebarFrame
+ compact={compact}
renderTop={({ expand, onToggle }) => (
<div data-testid="detail-top" data-expand={expand}>
<button type="button" data-testid="detail-toggle" onClick={onToggle}>
@@ -66,6 +69,20 @@ describe('DetailSidebarFrame', () => {
expect(screen.getByTestId('detail-section')).toHaveAttribute('data-expand', 'true')
})
+ it('starts compact navigation collapsed and toggles without changing the desktop preference', async () => {
+ const user = userEvent.setup()
+ renderDetailSidebarFrame(null, 'mac', true)
+
+ expect(screen.getByRole('button', { name: 'account' })).toHaveTextContent('Compact account')
+ await user.click(screen.getByRole('button', { name: 'Toggle' }))
+ expect(screen.getByRole('button', { name: 'account' })).toHaveTextContent('Expanded account')
+ expect(localStorage.getItem(DETAIL_SIDEBAR_STORAGE_KEY)).toBe('expand')
+
+ await user.click(screen.getByRole('button', { name: 'Toggle' }))
+ expect(screen.getByRole('button', { name: 'account' })).toHaveTextContent('Compact account')
+ expect(localStorage.getItem(DETAIL_SIDEBAR_STORAGE_KEY)).toBe('expand')
+ })
+
describe.each(['mac', 'windows'] as const)('%s shortcut', (platform) => {
const modifiers = platform === 'mac' ? { metaKey: true } : { ctrlKey: true }
diff --git a/web/app/components/detail-sidebar/index.tsx b/web/app/components/detail-sidebar/index.tsx
index aed32173b14..194eccef015 100644
--- a/web/app/components/detail-sidebar/index.tsx
+++ b/web/app/components/detail-sidebar/index.tsx
@@ -19,6 +19,7 @@ type DetailSidebarRenderProps = {
type DetailSidebarFrameProps = {
className?: string
+ compact?: boolean
renderTop: (props: DetailSidebarRenderProps) => ReactNode
renderSection: (props: Pick<DetailSidebarRenderProps, 'expand'>) => ReactNode
}
@@ -39,6 +40,7 @@ function SecondarySidebarHelpMenu({ triggerClassName }: { triggerClassName?: str
export function DetailSidebarFrame({
className,
+ compact = false,
renderTop,
renderSection,
}: DetailSidebarFrameProps) {
@@ -47,8 +49,9 @@ export function DetailSidebarFrame({
select: (data) => data.meta.currentEnv,
})
const [storedDetailSidebarExpand, setStoredDetailSidebarExpand] = useDetailSidebarMode()
+ const [compactExpanded, setCompactExpanded] = useState(false)
const detailNavigationMode = storedDetailSidebarExpand === 'collapse' ? 'collapse' : 'expand'
- const detailNavigationExpanded = detailNavigationMode === 'expand'
+ const detailNavigationExpanded = compact ? compactExpanded : detailNavigationMode === 'expand'
const [detailNavigationHoverPreviewOpen, setDetailNavigationHoverPreviewOpen] = useState(false)
const [detailNavigationTransitionDisabled, setDetailNavigationTransitionDisabled] =
useState(false)
@@ -57,13 +60,18 @@ export function DetailSidebarFrame({
)
const detailNavigationTransitionTimerRef = useRef<ReturnType<typeof setTimeout> | null>(null)
const isDetailNavigationHoverPreviewOpen =
- !detailNavigationExpanded && detailNavigationHoverPreviewOpen
+ !compact && !detailNavigationExpanded && detailNavigationHoverPreviewOpen
const detailNavigationVisibleExpanded =
detailNavigationExpanded || isDetailNavigationHoverPreviewOpen
const bottomNavigationExpanded = detailNavigationVisibleExpanded
const showEnvTag = currentEnv === 'TESTING' || currentEnv === 'DEVELOPMENT'
function handleToggleDetailNavigation() {
+ if (compact) {
+ setCompactExpanded((expanded) => !expanded)
+ return
+ }
+
if (isDetailNavigationHoverPreviewOpen) {
if (detailNavigationTransitionTimerRef.current)
clearTimeout(detailNavigationTransitionTimerRef.current)
@@ -83,7 +91,7 @@ export function DetailSidebarFrame({
}
function openDetailNavigationHoverPreview() {
- if (detailNavigationExpanded) return
+ if (compact || detailNavigationExpanded) return
if (closeDetailNavigationHoverPreviewTimerRef.current)
clearTimeout(closeDetailNavigationHoverPreviewTimerRef.current)
diff --git a/web/app/components/header/account-setting/model-provider-page/model-selector/__tests__/index.spec.tsx b/web/app/components/header/account-setting/model-provider-page/model-selector/__tests__/index.spec.tsx
index 067ae6b76b7..03bf0d025ab 100644
--- a/web/app/components/header/account-setting/model-provider-page/model-selector/__tests__/index.spec.tsx
+++ b/web/app/components/header/account-setting/model-provider-page/model-selector/__tests__/index.spec.tsx
@@ -137,6 +137,27 @@ describe('ModelSelector', () => {
mockModelProviders.current = [makeModel()]
})
+ it.each([
+ { value: { provider: 'openai', model: 'gpt-4' }, name: 'Embedding Model GPT-4' },
+ { value: undefined, name: 'Embedding Model plugin.detailPanel.configureModel' },
+ ])(
+ 'should include the visible field label and current value in its name ($name)',
+ ({ value, name }) => {
+ renderWithQueryClient(
+ <>
+ <div id="embedding-model-label">Embedding Model</div>
+ <ModelSelector
+ aria-labelledby="embedding-model-label"
+ value={value}
+ models={[makeModel()]}
+ />
+ </>,
+ )
+
+ expect(screen.getByRole('button', { name })).toBeInTheDocument()
+ },
+ )
+
it('should toggle popup and close it after selecting a model', () => {
renderWithQueryClient(<ModelSelector models={[makeModel()]} />)
diff --git a/web/app/components/header/account-setting/model-provider-page/model-selector/index.tsx b/web/app/components/header/account-setting/model-provider-page/model-selector/index.tsx
index f1706298bd4..db315b3bd73 100644
--- a/web/app/components/header/account-setting/model-provider-page/model-selector/index.tsx
+++ b/web/app/components/header/account-setting/model-provider-page/model-selector/index.tsx
@@ -26,6 +26,7 @@ const getModelProviderPluginId = (provider: string) => {
}
type ModelSelectorBaseProps = {
+ 'aria-labelledby'?: string
value?: ModelSelectorValue
models: ModelSelectorProvider[]
className?: string
@@ -54,6 +55,7 @@ type SplitModelSelectorProps = ModelSelectorBaseProps & {
}
function ModelSelectorRoot({
+ 'aria-labelledby': labelledBy,
value,
models,
className,
@@ -143,6 +145,7 @@ function ModelSelectorRoot({
return (
<Popover open={open} onOpenChange={handleOpenChange}>
<ModelSelectorTrigger
+ aria-labelledby={labelledBy}
currentProvider={currentProvider}
currentModel={currentModel}
defaultModel={value}
diff --git a/web/app/components/header/account-setting/model-provider-page/model-selector/model-selector-trigger.tsx b/web/app/components/header/account-setting/model-provider-page/model-selector/model-selector-trigger.tsx
index e431c3b3193..2ae48b44612 100644
--- a/web/app/components/header/account-setting/model-provider-page/model-selector/model-selector-trigger.tsx
+++ b/web/app/components/header/account-setting/model-provider-page/model-selector/model-selector-trigger.tsx
@@ -4,6 +4,7 @@ import { IconButton } from '@langgenius/dify-ui/icon-button'
import { PopoverTrigger } from '@langgenius/dify-ui/popover'
import { Tooltip, TooltipContent, TooltipTrigger } from '@langgenius/dify-ui/tooltip'
import { useQuery } from '@tanstack/react-query'
+import { useId } from 'react'
import { useTranslation } from 'react-i18next'
import { consoleQuery } from '@/service/console'
import {
@@ -16,6 +17,7 @@ import ModelName from '../model-name'
import { useCredentialPanelState as useCredentialPanelInfo } from '../provider-added-card/use-credential-panel-state'
type ModelSelectorTriggerProps = {
+ 'aria-labelledby'?: string
currentProvider?: ModelSelectorProvider
currentModel?: ModelSelectorModel
defaultModel?: ModelSelectorValue
@@ -33,6 +35,7 @@ type ModelSelectorTriggerProps = {
}
function ModelSelectorTrigger({
+ 'aria-labelledby': labelledBy,
currentProvider,
currentModel,
defaultModel,
@@ -49,6 +52,7 @@ function ModelSelectorTrigger({
isModelCompatible = true,
}: ModelSelectorTriggerProps) {
const { t } = useTranslation(['common', 'plugin'])
+ const valueId = useId()
const showClear = !!defaultModel && !!onClear
const isSelected = !!currentProvider && !!currentModel
@@ -110,6 +114,7 @@ function ModelSelectorTrigger({
render={
<button
type="button"
+ aria-labelledby={labelledBy ? `${labelledBy} ${valueId}` : undefined}
data-deprecated={isDeprecated && !isStatusUnavailable ? '' : undefined}
data-model-status={status}
data-shape={shape}
@@ -162,6 +167,7 @@ function ModelSelectorTrigger({
)}
<span
+ id={valueId}
className={cn(
'flex grow items-center gap-1 truncate',
size === 'small' ? 'px-0.5' : 'px-1 py-0.75',
diff --git a/web/hooks/use-breakpoints.spec.ts b/web/hooks/use-breakpoints.spec.ts
index 2741bb8ff2a..6de09aab290 100644
--- a/web/hooks/use-breakpoints.spec.ts
+++ b/web/hooks/use-breakpoints.spec.ts
@@ -13,6 +13,9 @@
* event listeners on unmount to prevent memory leaks.
*/
import { act, renderHook } from '@testing-library/react'
+import { createElement } from 'react'
+import { hydrateRoot } from 'react-dom/client'
+import { renderToString } from 'react-dom/server'
import useBreakpoints, { MediaType } from './use-breakpoints'
describe('useBreakpoints', () => {
@@ -37,6 +40,36 @@ describe('useBreakpoints', () => {
window.innerWidth = originalInnerWidth
})
+ it('should hydrate server markup on mobile without rebuilding it', async () => {
+ const ResponsiveContent = () => {
+ const media = useBreakpoints()
+ return createElement(media === MediaType.mobile ? 'nav' : 'aside', null, media)
+ }
+ const container = document.createElement('div')
+ const onRecoverableError = vi.fn()
+
+ // The server has no viewport. Its markup must also be the first client render.
+ vi.stubGlobal('innerWidth', undefined)
+ try {
+ container.innerHTML = renderToString(createElement(ResponsiveContent))
+ } finally {
+ vi.unstubAllGlobals()
+ }
+ window.innerWidth = 390
+
+ const root = hydrateRoot(container, createElement(ResponsiveContent), { onRecoverableError })
+ try {
+ await act(async () => {})
+ expect(onRecoverableError).not.toHaveBeenCalled()
+ expect(container).toHaveTextContent(MediaType.mobile)
+
+ fireResize(1024)
+ expect(container).toHaveTextContent(MediaType.pc)
+ } finally {
+ act(() => root.unmount())
+ }
+ })
+
/**
* Test mobile breakpoint detection
* Mobile devices have width <= 640px
diff --git a/web/hooks/use-breakpoints.ts b/web/hooks/use-breakpoints.ts
index c5a03cfe8b3..db4c804e941 100644
--- a/web/hooks/use-breakpoints.ts
+++ b/web/hooks/use-breakpoints.ts
@@ -9,21 +9,21 @@ export const MediaType = {
type MediaTypeValue = (typeof MediaType)[keyof typeof MediaType]
-const useBreakpoints = (): MediaTypeValue => {
- const [width, setWidth] = React.useState(globalThis.innerWidth)
- const media = (() => {
- if (width <= 640) return MediaType.mobile
- if (width <= 768) return MediaType.tablet
- return MediaType.pc
- })()
-
- React.useEffect(() => {
- const handleWindowResize = () => setWidth(window.innerWidth)
- window.addEventListener('resize', handleWindowResize)
- return () => window.removeEventListener('resize', handleWindowResize)
- }, [])
+const subscribe = (onStoreChange: () => void) => {
+ window.addEventListener('resize', onStoreChange)
+ return () => window.removeEventListener('resize', onStoreChange)
+}
- return media
+const getSnapshot = (): MediaTypeValue => {
+ if (window.innerWidth <= 640) return MediaType.mobile
+ if (window.innerWidth <= 768) return MediaType.tablet
+ return MediaType.pc
}
+// Match the server's desktop fallback during hydration before reading the viewport.
+const getServerSnapshot = (): MediaTypeValue => MediaType.pc
+
+const useBreakpoints = (): MediaTypeValue =>
+ React.useSyncExternalStore(subscribe, getSnapshot, getServerSnapshot)
+
export default useBreakpoints
diff --git a/web/i18n/locales/ar-TN/dataset-settings.json b/web/i18n/locales/ar-TN/dataset-settings.json
index 022fad08d22..5c3ab91bb74 100644
--- a/web/i18n/locales/ar-TN/dataset-settings.json
+++ b/web/i18n/locales/ar-TN/dataset-settings.json
@@ -1,5 +1,6 @@
{
"desc": "هنا يمكنك تعديل الخصائص وإعدادات الاسترجاع لهذه المعرفة.",
+ "form.changeIcon": "تغيير أيقونة المعرفة",
"form.chunkStructure.description": " حول هيكل القطعة.",
"form.chunkStructure.learnMore": "تعرف على المزيد",
"form.chunkStructure.title": "هيكل القطعة",
diff --git a/web/i18n/locales/az-AZ/dataset-settings.json b/web/i18n/locales/az-AZ/dataset-settings.json
index a843634f8a0..81fd7fbeeb2 100644
--- a/web/i18n/locales/az-AZ/dataset-settings.json
+++ b/web/i18n/locales/az-AZ/dataset-settings.json
@@ -1,5 +1,6 @@
{
"desc": "Burada bu bilik bazasının xüsusiyyətlərini və məlumat axtarışı parametrlərini dəyişə bilərsiniz.",
+ "form.changeIcon": "Bilik ikonasını dəyişdir",
"form.chunkStructure.description": " (hissə quruluşu haqqında).",
"form.chunkStructure.learnMore": "Ətraflı öyrən",
"form.chunkStructure.title": "Hissə quruluşu",
diff --git a/web/i18n/locales/de-DE/dataset-settings.json b/web/i18n/locales/de-DE/dataset-settings.json
index 4247aa6ea12..ee80b9fa45c 100644
--- a/web/i18n/locales/de-DE/dataset-settings.json
+++ b/web/i18n/locales/de-DE/dataset-settings.json
@@ -1,5 +1,6 @@
{
"desc": "Hier können Sie die Eigenschaften und Arbeitsweisen des Wissens anpassen.",
+ "form.changeIcon": "Wissenssymbol ändern",
"form.chunkStructure.description": "über Chunk Structure.",
"form.chunkStructure.learnMore": "Weitere Informationen",
"form.chunkStructure.title": "Chunk-Struktur",
diff --git a/web/i18n/locales/en-US/dataset-settings.json b/web/i18n/locales/en-US/dataset-settings.json
index 9f80675d2df..65d57d0d29f 100644
--- a/web/i18n/locales/en-US/dataset-settings.json
+++ b/web/i18n/locales/en-US/dataset-settings.json
@@ -1,5 +1,6 @@
{
"desc": "Here you can modify the properties and retrieval settings of this Knowledge.",
+ "form.changeIcon": "Change knowledge icon",
"form.chunkStructure.description": " about Chunk Structure.",
"form.chunkStructure.learnMore": "Learn more",
"form.chunkStructure.title": "Chunk Structure",
diff --git a/web/i18n/locales/es-ES/dataset-settings.json b/web/i18n/locales/es-ES/dataset-settings.json
index 741965453da..ca710d44d6d 100644
--- a/web/i18n/locales/es-ES/dataset-settings.json
+++ b/web/i18n/locales/es-ES/dataset-settings.json
@@ -1,5 +1,6 @@
{
"desc": "Aquí puedes modificar las propiedades y los métodos de trabajo del conjunto de datos.",
+ "form.changeIcon": "Cambiar el icono de conocimiento",
"form.chunkStructure.description": "sobre la estructura de fragmentos.",
"form.chunkStructure.learnMore": "Aprende más",
"form.chunkStructure.title": "Estructura de fragmentos",
diff --git a/web/i18n/locales/fa-IR/dataset-settings.json b/web/i18n/locales/fa-IR/dataset-settings.json
index 3802966c972..42d9e68d020 100644
--- a/web/i18n/locales/fa-IR/dataset-settings.json
+++ b/web/i18n/locales/fa-IR/dataset-settings.json
@@ -1,5 +1,6 @@
{
"desc": "اینجا می‌توانید ویژگی‌ها و روش‌های کاری دانش را تغییر دهید.",
+ "form.changeIcon": "تغییر نماد دانش",
"form.chunkStructure.description": "درباره ساختار تکه تکه است.",
"form.chunkStructure.learnMore": "بیشتر بدانید",
"form.chunkStructure.title": "ساختار تکه",
diff --git a/web/i18n/locales/fr-FR/dataset-settings.json b/web/i18n/locales/fr-FR/dataset-settings.json
index 82b4198f04d..daf88cfe7d8 100644
--- a/web/i18n/locales/fr-FR/dataset-settings.json
+++ b/web/i18n/locales/fr-FR/dataset-settings.json
@@ -1,5 +1,6 @@
{
"desc": "Ici, vous pouvez modifier les propriétés et les méthodes de fonctionnement de la Connaissance.",
+ "form.changeIcon": "Modifier l’icône de la base de connaissances",
"form.chunkStructure.description": "sur la structure des morceaux.",
"form.chunkStructure.learnMore": "Pour en savoir plus",
"form.chunkStructure.title": "Structure de morceaux",
diff --git a/web/i18n/locales/hi-IN/dataset-settings.json b/web/i18n/locales/hi-IN/dataset-settings.json
index 7d7bb33fa60..c0e5863dfa0 100644
--- a/web/i18n/locales/hi-IN/dataset-settings.json
+++ b/web/i18n/locales/hi-IN/dataset-settings.json
@@ -1,5 +1,6 @@
{
"desc": "यहां आप ज्ञान की संपत्ति और कार्य प्रक्रियाओं को modify कर सकते हैं.",
+ "form.changeIcon": "ज्ञान का आइकन बदलें",
"form.chunkStructure.description": "चंक संरचना के बारे में।",
"form.chunkStructure.learnMore": "और अधिक सीखें",
"form.chunkStructure.title": "खंड संरचना",
diff --git a/web/i18n/locales/id-ID/dataset-settings.json b/web/i18n/locales/id-ID/dataset-settings.json
index 4d451eee4f0..14240dcc9dd 100644
--- a/web/i18n/locales/id-ID/dataset-settings.json
+++ b/web/i18n/locales/id-ID/dataset-settings.json
@@ -1,5 +1,6 @@
{
"desc": "Di sini Anda dapat memodifikasi properti dan pengaturan pengambilan Pengetahuan ini.",
+ "form.changeIcon": "Ubah ikon pengetahuan",
"form.chunkStructure.description": "tentang Struktur Potongan.",
"form.chunkStructure.learnMore": "Pelajari lebih lanjut",
"form.chunkStructure.title": "Struktur Potongan",
diff --git a/web/i18n/locales/it-IT/dataset-settings.json b/web/i18n/locales/it-IT/dataset-settings.json
index 465993c53c4..6702d5cc4c3 100644
--- a/web/i18n/locales/it-IT/dataset-settings.json
+++ b/web/i18n/locales/it-IT/dataset-settings.json
@@ -1,5 +1,6 @@
{
"desc": "Qui puoi modificare le proprietà e i metodi di funzionamento della Conoscenza.",
+ "form.changeIcon": "Modifica l’icona della conoscenza",
"form.chunkStructure.description": "sulla struttura a blocchi.",
"form.chunkStructure.learnMore": "Ulteriori informazioni",
"form.chunkStructure.title": "Struttura a blocchi",
diff --git a/web/i18n/locales/ja-JP/dataset-settings.json b/web/i18n/locales/ja-JP/dataset-settings.json
index 165ad0c90bf..a2db89f3de7 100644
--- a/web/i18n/locales/ja-JP/dataset-settings.json
+++ b/web/i18n/locales/ja-JP/dataset-settings.json
@@ -1,5 +1,6 @@
{
"desc": "ここでこのナレッジベースのプロパティと検索設定を変更できます。",
+ "form.changeIcon": "ナレッジのアイコンを変更",
"form.chunkStructure.description": "チャンク構造について。",
"form.chunkStructure.learnMore": "詳細はこちら",
"form.chunkStructure.title": "チャンク構造",
diff --git a/web/i18n/locales/ko-KR/dataset-settings.json b/web/i18n/locales/ko-KR/dataset-settings.json
index a8386a8f053..a1f317816fa 100644
--- a/web/i18n/locales/ko-KR/dataset-settings.json
+++ b/web/i18n/locales/ko-KR/dataset-settings.json
@@ -1,5 +1,6 @@
{
"desc": "여기에서 지식의 속성과 작동 방법을 변경할 수 있습니다.",
+ "form.changeIcon": "지식 아이콘 변경",
"form.chunkStructure.description": "청크 구조에 대해.",
"form.chunkStructure.learnMore": "더 알아보세요",
"form.chunkStructure.title": "청크 구조",
diff --git a/web/i18n/locales/lo-LA/dataset-settings.json b/web/i18n/locales/lo-LA/dataset-settings.json
index 1b91888ed8a..84464dabe65 100644
--- a/web/i18n/locales/lo-LA/dataset-settings.json
+++ b/web/i18n/locales/lo-LA/dataset-settings.json
@@ -1,5 +1,6 @@
{
"desc": "ຢູ່ບ່ອນນີ້ ເຈົ້າສາມາດແກ້ໄຂຄຸນສົມບັດ ແລະ ການຕັ້ງຄ່າການຄົ້ນຄືນຂອງຄວາມຮູ້ນີ້.",
+ "form.changeIcon": "ປ່ຽນໄອຄອນຄວາມຮູ້",
"form.chunkStructure.description": " ກ່ຽວກັບໂຄງສ້າງສ່ວນຂໍ້ມູນ.",
"form.chunkStructure.learnMore": "ຮຽນຮູ້ເພີ່ມເຕີມ",
"form.chunkStructure.title": "ໂຄງສ້າງສ່ວນຂໍ້ມູນ",
diff --git a/web/i18n/locales/nl-NL/dataset-settings.json b/web/i18n/locales/nl-NL/dataset-settings.json
index 66ddcb3dade..31b7ef9c15b 100644
--- a/web/i18n/locales/nl-NL/dataset-settings.json
+++ b/web/i18n/locales/nl-NL/dataset-settings.json
@@ -1,5 +1,6 @@
{
"desc": "Here you can modify the properties and retrieval settings of this Knowledge.",
+ "form.changeIcon": "Kennispictogram wijzigen",
"form.chunkStructure.description": " about Chunk Structure.",
"form.chunkStructure.learnMore": "Learn more",
"form.chunkStructure.title": "Chunk Structure",
diff --git a/web/i18n/locales/pl-PL/dataset-settings.json b/web/i18n/locales/pl-PL/dataset-settings.json
index 2f06e2e509f..8cae42caae2 100644
--- a/web/i18n/locales/pl-PL/dataset-settings.json
+++ b/web/i18n/locales/pl-PL/dataset-settings.json
@@ -1,5 +1,6 @@
{
"desc": "Tutaj możesz modyfikować właściwości i metody działania Wiedzy.",
+ "form.changeIcon": "Zmień ikonę wiedzy",
"form.chunkStructure.description": "o strukturze porcji.",
"form.chunkStructure.learnMore": "Dowiedz się więcej",
"form.chunkStructure.title": "Struktura porcji",
diff --git a/web/i18n/locales/pt-BR/dataset-settings.json b/web/i18n/locales/pt-BR/dataset-settings.json
index b9123a88374..7e31a7a438b 100644
--- a/web/i18n/locales/pt-BR/dataset-settings.json
+++ b/web/i18n/locales/pt-BR/dataset-settings.json
@@ -1,5 +1,6 @@
{
"desc": "Aqui você pode modificar as propriedades e métodos de trabalho do conhecimento.",
+ "form.changeIcon": "Alterar ícone do conhecimento",
"form.chunkStructure.description": "sobre a estrutura do pedaço.",
"form.chunkStructure.learnMore": "Saiba Mais",
"form.chunkStructure.title": "Estrutura de Chunk",
diff --git a/web/i18n/locales/ro-RO/dataset-settings.json b/web/i18n/locales/ro-RO/dataset-settings.json
index 16cc9c3ab4a..82e7e78752b 100644
--- a/web/i18n/locales/ro-RO/dataset-settings.json
+++ b/web/i18n/locales/ro-RO/dataset-settings.json
@@ -1,5 +1,6 @@
{
"desc": "Aici puteți modifica proprietățile și metodele de lucru ale cunoștințelor.",
+ "form.changeIcon": "Schimbă pictograma cunoștințelor",
"form.chunkStructure.description": "despre Chunk Structure.",
"form.chunkStructure.learnMore": "Află mai multe",
"form.chunkStructure.title": "Structura bucății",
diff --git a/web/i18n/locales/ru-RU/dataset-settings.json b/web/i18n/locales/ru-RU/dataset-settings.json
index ae2d8360f4d..5f08b147282 100644
--- a/web/i18n/locales/ru-RU/dataset-settings.json
+++ b/web/i18n/locales/ru-RU/dataset-settings.json
@@ -1,5 +1,6 @@
{
"desc": "Здесь вы можете изменить свойства и методы работы базы знаний.",
+ "form.changeIcon": "Изменить значок базы знаний",
"form.chunkStructure.description": "о структуре чанка.",
"form.chunkStructure.learnMore": "Подробнее",
"form.chunkStructure.title": "Структура чанка",
diff --git a/web/i18n/locales/sl-SI/dataset-settings.json b/web/i18n/locales/sl-SI/dataset-settings.json
index 15679a5dd3d..61186520229 100644
--- a/web/i18n/locales/sl-SI/dataset-settings.json
+++ b/web/i18n/locales/sl-SI/dataset-settings.json
@@ -1,5 +1,6 @@
{
"desc": "Tukaj lahko spremenite lastnosti in nastavitve pridobivanja tega znanja.",
+ "form.changeIcon": "Spremeni ikono znanja",
"form.chunkStructure.description": "o strukturi Chunk.",
"form.chunkStructure.learnMore": "Izvedi več",
"form.chunkStructure.title": "Struktura kosov",
diff --git a/web/i18n/locales/th-TH/dataset-settings.json b/web/i18n/locales/th-TH/dataset-settings.json
index 491e7115d86..043e2a8e3c1 100644
--- a/web/i18n/locales/th-TH/dataset-settings.json
+++ b/web/i18n/locales/th-TH/dataset-settings.json
@@ -1,5 +1,6 @@
{
"desc": "ที่นี่คุณสามารถแก้ไขคุณสมบัติและการตั้งค่าการดึงข้อมูลของความรู้นี้",
+ "form.changeIcon": "เปลี่ยนไอคอนความรู้",
"form.chunkStructure.description": "เกี่ยวกับ Chunk Structure",
"form.chunkStructure.learnMore": "ศึกษาเพิ่มเติม",
"form.chunkStructure.title": "โครงสร้างก้อน",
diff --git a/web/i18n/locales/tr-TR/dataset-settings.json b/web/i18n/locales/tr-TR/dataset-settings.json
index a351a95e2e5..5ab10f115d5 100644
--- a/web/i18n/locales/tr-TR/dataset-settings.json
+++ b/web/i18n/locales/tr-TR/dataset-settings.json
@@ -1,5 +1,6 @@
{
"desc": "Burada Bilginin özelliklerini ve çalışma yöntemlerini değiştirebilirsiniz.",
+ "form.changeIcon": "Bilgi simgesini değiştir",
"form.chunkStructure.description": "Yığın Yapısı hakkında.",
"form.chunkStructure.learnMore": "Daha fazla bilgi edinin",
"form.chunkStructure.title": "Yığın Yapısı",
diff --git a/web/i18n/locales/uk-UA/dataset-settings.json b/web/i18n/locales/uk-UA/dataset-settings.json
index d0a2870886a..ec3c6b34f95 100644
--- a/web/i18n/locales/uk-UA/dataset-settings.json
+++ b/web/i18n/locales/uk-UA/dataset-settings.json
@@ -1,5 +1,6 @@
{
"desc": "Тут ви можете змінити властивості та методи роботи бази знань.",
+ "form.changeIcon": "Змінити значок бази знань",
"form.chunkStructure.description": "про структуру шматків.",
"form.chunkStructure.learnMore": "Дізнатися більше",
"form.chunkStructure.title": "Структура шматків",
diff --git a/web/i18n/locales/vi-VN/dataset-settings.json b/web/i18n/locales/vi-VN/dataset-settings.json
index be04485f28a..bd72e8b0eb9 100644
--- a/web/i18n/locales/vi-VN/dataset-settings.json
+++ b/web/i18n/locales/vi-VN/dataset-settings.json
@@ -1,5 +1,6 @@
{
"desc": "Tại đây, bạn có thể sửa đổi các thuộc tính và phương pháp làm việc của Kiến thức.",
+ "form.changeIcon": "Thay đổi biểu tượng kiến thức",
"form.chunkStructure.description": "về Cấu trúc khối.",
"form.chunkStructure.learnMore": "Tìm hiểu thêm",
"form.chunkStructure.title": "Cấu trúc Chunk",
diff --git a/web/i18n/locales/zh-Hans/dataset-settings.json b/web/i18n/locales/zh-Hans/dataset-settings.json
index b5d383c145a..40fd3a513a9 100644
--- a/web/i18n/locales/zh-Hans/dataset-settings.json
+++ b/web/i18n/locales/zh-Hans/dataset-settings.json
@@ -1,5 +1,6 @@
{
"desc": "在这里,您可以修改此知识库的属性和检索设置",
+ "form.changeIcon": "修改知识库图标",
"form.chunkStructure.description": "关于分段模式。",
"form.chunkStructure.learnMore": "了解更多",
"form.chunkStructure.title": "分段模式",
diff --git a/web/i18n/locales/zh-Hant/dataset-settings.json b/web/i18n/locales/zh-Hant/dataset-settings.json
index 2dbc89075cb..34a5d8cae48 100644
--- a/web/i18n/locales/zh-Hant/dataset-settings.json
+++ b/web/i18n/locales/zh-Hant/dataset-settings.json
@@ -1,5 +1,6 @@
{
"desc": "在這裡您可以修改知識庫的工作方式以及其它設定。",
+ "form.changeIcon": "修改知識庫圖示",
"form.chunkStructure.description": "關於塊結構。",
"form.chunkStructure.learnMore": "瞭解詳情",
"form.chunkStructure.title": "區塊結構",