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.
Python agentagentic-aiagentic-frameworkagentic-workflowaiautomationclaudedeepseekgenaigptllmlow-codemcpnextjsno-codeopenaipythonskillsworkflow
refactor(web): make Switch controlled-only and migrate call sites (#32399)
yyhea0e1b52a8c1
diff --git a/web/app/(commonLayout)/app/(appDetailLayout)/[appId]/overview/tracing/config-popup.tsx b/web/app/(commonLayout)/app/(appDetailLayout)/[appId]/overview/tracing/config-popup.tsxindex 4469459b52a..138d238b478 100644--- a/web/app/(commonLayout)/app/(appDetailLayout)/[appId]/overview/tracing/config-popup.tsx+++ b/web/app/(commonLayout)/app/(appDetailLayout)/[appId]/overview/tracing/config-popup.tsx@@ -94,7 +94,7 @@ const ConfigPopup: FC<PopupProps> = ({const switchContent = (<SwitchclassName="ml-3"- defaultValue={enabled}+ value={enabled}onChange={onStatusChange}disabled={providerAllNotConfigured}/>diff --git a/web/app/components/app/annotation/index.tsx b/web/app/components/app/annotation/index.tsxindex 553836d73cc..ee276603cc6 100644--- a/web/app/components/app/annotation/index.tsx+++ b/web/app/components/app/annotation/index.tsx@@ -144,7 +144,7 @@ const Annotation: FC<Props> = (props) => {return (<div className="flex h-full flex-col">- <p className="system-sm-regular text-text-tertiary">{t('description', { ns: 'appLog' })}</p>+ <p className="text-text-tertiary system-sm-regular">{t('description', { ns: 'appLog' })}</p><div className="relative flex h-full flex-1 flex-col py-4"><Filter appId={appDetail.id} queryParams={queryParams} setQueryParams={setQueryParams}><div className="flex items-center space-x-2">@@ -152,10 +152,10 @@ const Annotation: FC<Props> = (props) => {<><div className={cn(!annotationConfig?.enabled && 'pr-2', 'flex h-7 items-center space-x-1 rounded-lg border border-components-panel-border bg-components-panel-bg-blur pl-2')}><MessageFast className="h-4 w-4 text-util-colors-indigo-indigo-600" />- <div className="system-sm-medium text-text-primary">{t('name', { ns: 'appAnnotation' })}</div>+ <div className="text-text-primary system-sm-medium">{t('name', { ns: 'appAnnotation' })}</div><Switchkey={controlRefreshSwitch}- defaultValue={annotationConfig?.enabled}+ value={annotationConfig?.enabled ?? false}size="md"onChange={async (value) => {if (value) {diff --git a/web/app/components/app/configuration/config-vision/index.tsx b/web/app/components/app/configuration/config-vision/index.tsxindex 481e6b5ab61..383f6bdf063 100644--- a/web/app/components/app/configuration/config-vision/index.tsx+++ b/web/app/components/app/configuration/config-vision/index.tsx@@ -121,7 +121,7 @@ const ConfigVision: FC = () => {<ParamConfig /><div className="ml-1 mr-3 h-3.5 w-[1px] bg-divider-regular"></div><Switch- defaultValue={isImageEnabled}+ value={isImageEnabled}onChange={handleChange}size="md"/>diff --git a/web/app/components/app/configuration/config/agent/agent-tools/index.tsx b/web/app/components/app/configuration/config/agent/agent-tools/index.tsxindex b97aa6e775e..752426cc2dd 100644--- a/web/app/components/app/configuration/config/agent/agent-tools/index.tsx+++ b/web/app/components/app/configuration/config/agent/agent-tools/index.tsx@@ -298,7 +298,7 @@ const AgentTools: FC = () => {<div className={cn(item.isDeleted && 'opacity-50')}>{!item.notAuthor && (<Switch- defaultValue={item.isDeleted ? false : item.enabled}+ value={item.isDeleted ? false : item.enabled}disabled={item.isDeleted || readonly}size="md"onChange={(enabled) => {diff --git a/web/app/components/app/configuration/config/config-audio.tsx b/web/app/components/app/configuration/config/config-audio.tsxindex b8764b15e96..e2c7776aa15 100644--- a/web/app/components/app/configuration/config/config-audio.tsx+++ b/web/app/components/app/configuration/config/config-audio.tsx@@ -69,7 +69,7 @@ const ConfigAudio: FC = () => {<div className="flex shrink-0 items-center"><div className="ml-1 mr-3 h-3.5 w-[1px] bg-divider-subtle"></div><Switch- defaultValue={isAudioEnabled}+ value={isAudioEnabled}onChange={handleChange}size="md"/>diff --git a/web/app/components/app/configuration/config/config-document.tsx b/web/app/components/app/configuration/config/config-document.tsxindex 7d48c1582a4..1b274127110 100644--- a/web/app/components/app/configuration/config/config-document.tsx+++ b/web/app/components/app/configuration/config/config-document.tsx@@ -69,7 +69,7 @@ const ConfigDocument: FC = () => {<div className="flex shrink-0 items-center"><div className="ml-1 mr-3 h-3.5 w-[1px] bg-divider-subtle"></div><Switch- defaultValue={isDocumentEnabled}+ value={isDocumentEnabled}onChange={handleChange}size="md"/>diff --git a/web/app/components/app/configuration/dataset-config/params-config/config-content.tsx b/web/app/components/app/configuration/dataset-config/params-config/config-content.tsxindex 69032b47431..d2e4913e54b 100644--- a/web/app/components/app/configuration/dataset-config/params-config/config-content.tsx+++ b/web/app/components/app/configuration/dataset-config/params-config/config-content.tsx@@ -188,14 +188,14 @@ const ConfigContent: FC<Props> = ({return (<div>- <div className="system-xl-semibold text-text-primary">{t('retrievalSettings', { ns: 'dataset' })}</div>- <div className="system-xs-regular text-text-tertiary">+ <div className="text-text-primary system-xl-semibold">{t('retrievalSettings', { ns: 'dataset' })}</div>+ <div className="text-text-tertiary system-xs-regular">{t('defaultRetrievalTip', { ns: 'dataset' })}</div>{type === RETRIEVE_TYPE.multiWay && (<><div className="my-2 flex flex-col items-center py-1">- <div className="system-xs-semibold-uppercase mb-2 mr-2 shrink-0 text-text-secondary">+ <div className="mb-2 mr-2 shrink-0 text-text-secondary system-xs-semibold-uppercase">{t('rerankSettings', { ns: 'dataset' })}</div><Divider bgStyle="gradient" className="m-0 !h-px" />@@ -203,21 +203,21 @@ const ConfigContent: FC<Props> = ({{selectedDatasetsMode.inconsistentEmbeddingModel&& (- <div className="system-xs-medium mt-4 text-text-warning">+ <div className="mt-4 text-text-warning system-xs-medium">{t('inconsistentEmbeddingModelTip', { ns: 'dataset' })}</div>)}{selectedDatasetsMode.mixtureInternalAndExternal && (- <div className="system-xs-medium mt-4 text-text-warning">+ <div className="mt-4 text-text-warning system-xs-medium">{t('mixtureInternalAndExternalTip', { ns: 'dataset' })}</div>)}{selectedDatasetsMode.allExternal && (- <div className="system-xs-medium mt-4 text-text-warning">+ <div className="mt-4 text-text-warning system-xs-medium">{t('allExternalTip', { ns: 'dataset' })}</div>)@@ -225,7 +225,7 @@ const ConfigContent: FC<Props> = ({{selectedDatasetsMode.mixtureHighQualityAndEconomic&& (- <div className="system-xs-medium mt-4 text-text-warning">+ <div className="mt-4 text-text-warning system-xs-medium">{t('mixtureHighQualityAndEconomicTip', { ns: 'dataset' })}</div>)@@ -238,7 +238,7 @@ const ConfigContent: FC<Props> = ({<divkey={option.value}className={cn(- 'system-sm-medium flex h-8 w-[calc((100%-8px)/2)] cursor-pointer items-center justify-center rounded-lg border border-components-option-card-option-border bg-components-option-card-option-bg text-text-secondary',+ 'flex h-8 w-[calc((100%-8px)/2)] cursor-pointer items-center justify-center rounded-lg border border-components-option-card-option-border bg-components-option-card-option-bg text-text-secondary system-sm-medium',selectedRerankMode === option.value && 'border-[1.5px] border-components-option-card-option-selected-border bg-components-option-card-option-selected-bg text-text-primary',)}onClick={() => handleRerankModeChange(option.value)}@@ -267,12 +267,12 @@ const ConfigContent: FC<Props> = ({canManuallyToggleRerank && (<Switchsize="md"- defaultValue={showRerankModel}+ value={showRerankModel ?? false}onChange={handleManuallyToggleRerank}/>)}- <div className="system-sm-semibold ml-1 leading-[32px] text-text-secondary">{t('modelProvider.rerankModel.key', { ns: 'common' })}</div>+ <div className="ml-1 leading-[32px] text-text-secondary system-sm-semibold">{t('modelProvider.rerankModel.key', { ns: 'common' })}</div><TooltippopupContent={(<div className="w-[200px]">diff --git a/web/app/components/app/configuration/tools/index.tsx b/web/app/components/app/configuration/tools/index.tsxindex bffddc0be99..d2873b0be37 100644--- a/web/app/components/app/configuration/tools/index.tsx+++ b/web/app/components/app/configuration/tools/index.tsx@@ -130,7 +130,7 @@ const Tools = () => {className="flex h-7 cursor-pointer items-center px-3 text-xs font-medium text-gray-700"onClick={() => handleOpenExternalDataToolModal({}, -1)}>- <RiAddLine className="mr-[5px] h-3.5 w-3.5 " />+ <RiAddLine className="mr-[5px] h-3.5 w-3.5" />{t('operation.add', { ns: 'common' })}</div></div>@@ -180,7 +180,7 @@ const Tools = () => {<div className="ml-2 mr-3 hidden h-3.5 w-[1px] bg-gray-200 group-hover:block" /><Switchsize="l"- defaultValue={item.enabled}+ value={item.enabled ?? false}onChange={(enabled: boolean) => handleSaveExternalDataToolModal({ ...item, enabled }, index)}/></div>diff --git a/web/app/components/app/overview/app-card.tsx b/web/app/components/app/overview/app-card.tsxindex 9975c81b3ef..1b02e54d5fe 100644--- a/web/app/components/app/overview/app-card.tsx+++ b/web/app/components/app/overview/app-card.tsx@@ -260,7 +260,7 @@ function AppCard({offset={24}><div>- <Switch defaultValue={runningStatus} onChange={onChangeStatus} disabled={toggleDisabled} />+ <Switch value={runningStatus} onChange={onChangeStatus} disabled={toggleDisabled} /></div></Tooltip></div>diff --git a/web/app/components/app/overview/settings/index.tsx b/web/app/components/app/overview/settings/index.tsxindex 0d087e27c29..040703f41cd 100644--- a/web/app/components/app/overview/settings/index.tsx+++ b/web/app/components/app/overview/settings/index.tsx@@ -281,7 +281,7 @@ const SettingsModal: FC<ISettingsModalProps> = ({<div className="flex items-center justify-between"><div className={cn('system-sm-semibold py-1 text-text-secondary')}>{t('answerIcon.title', { ns: 'app' })}</div><Switch- defaultValue={inputInfo.use_icon_as_answer_icon}+ value={inputInfo.use_icon_as_answer_icon}onChange={v => setInputInfo({ ...inputInfo, use_icon_as_answer_icon: v })}/></div>@@ -315,7 +315,7 @@ const SettingsModal: FC<ISettingsModalProps> = ({/><div className="flex items-center justify-between"><p className={cn('body-xs-regular text-text-tertiary')}>{t(`${prefixSettings}.chatColorThemeInverted`, { ns: 'appOverview' })}</p>- <Switch defaultValue={inputInfo.chatColorThemeInverted} onChange={v => setInputInfo({ ...inputInfo, chatColorThemeInverted: v })}></Switch>+ <Switch value={inputInfo.chatColorThemeInverted} onChange={v => setInputInfo({ ...inputInfo, chatColorThemeInverted: v })}></Switch></div></div></div>@@ -326,7 +326,7 @@ const SettingsModal: FC<ISettingsModalProps> = ({<div className={cn('system-sm-semibold py-1 text-text-secondary')}>{t(`${prefixSettings}.workflow.subTitle`, { ns: 'appOverview' })}</div><Switchdisabled={!(appInfo.mode === AppModeEnum.WORKFLOW || appInfo.mode === AppModeEnum.ADVANCED_CHAT)}- defaultValue={inputInfo.show_workflow_steps}+ value={inputInfo.show_workflow_steps}onChange={v => setInputInfo({ ...inputInfo, show_workflow_steps: v })}/></div>@@ -380,7 +380,7 @@ const SettingsModal: FC<ISettingsModalProps> = ({><Switchdisabled={!webappCopyrightEnabled}- defaultValue={inputInfo.copyrightSwitchValue}+ value={inputInfo.copyrightSwitchValue}onChange={v => setInputInfo({ ...inputInfo, copyrightSwitchValue: v })}/></Tooltip>diff --git a/web/app/components/app/overview/trigger-card.tsx b/web/app/components/app/overview/trigger-card.tsxindex 12a294b4eca..1f0f0dca561 100644--- a/web/app/components/app/overview/trigger-card.tsx+++ b/web/app/components/app/overview/trigger-card.tsx@@ -192,7 +192,7 @@ function TriggerCard({ appInfo, onToggleResult }: ITriggerCardProps) {</div><div className="shrink-0"><Switch- defaultValue={trigger.status === 'enabled'}+ value={trigger.status === 'enabled'}onChange={enabled => onToggleTrigger(trigger, enabled)}disabled={!isCurrentWorkspaceEditor}/>diff --git a/web/app/components/base/features/new-feature-panel/feature-card.tsx b/web/app/components/base/features/new-feature-panel/feature-card.tsxindex 7b7327517b3..23f140ba549 100644--- a/web/app/components/base/features/new-feature-panel/feature-card.tsx+++ b/web/app/components/base/features/new-feature-panel/feature-card.tsx@@ -48,7 +48,7 @@ const FeatureCard = ({</Tooltip>)}</div>- <Switch disabled={disabled} className="shrink-0" onChange={state => onChange?.(state)} defaultValue={value} />+ <Switch disabled={disabled} className="shrink-0" onChange={state => onChange?.(state)} value={value} /></div>{description && (<div className="system-xs-regular line-clamp-2 min-h-8 text-text-tertiary">{description}</div>diff --git a/web/app/components/base/features/new-feature-panel/moderation/moderation-content.tsx b/web/app/components/base/features/new-feature-panel/moderation/moderation-content.tsxindex 8e9d6ddbf0b..ed691b84d64 100644--- a/web/app/components/base/features/new-feature-panel/moderation/moderation-content.tsx+++ b/web/app/components/base/features/new-feature-panel/moderation/moderation-content.tsx@@ -38,7 +38,7 @@ const ModerationContent: FC<ModerationContentProps> = ({}<Switchsize="l"- defaultValue={config.enabled}+ value={config.enabled}onChange={v => handleConfigChange('enabled', v)}/></div>diff --git a/web/app/components/base/features/new-feature-panel/text-to-speech/param-config-content.tsx b/web/app/components/base/features/new-feature-panel/text-to-speech/param-config-content.tsxindex a17de2d151d..21b4f1e0cd2 100644--- a/web/app/components/base/features/new-feature-panel/text-to-speech/param-config-content.tsx+++ b/web/app/components/base/features/new-feature-panel/text-to-speech/param-config-content.tsx@@ -232,7 +232,7 @@ const VoiceParamConfig = ({</div><SwitchclassName="shrink-0"- defaultValue={text2speech?.autoPlay === TtsAutoPlay.enabled}+ value={text2speech?.autoPlay === TtsAutoPlay.enabled}onChange={(value: boolean) => {handleChange({autoPlay: value ? TtsAutoPlay.enabled : TtsAutoPlay.disabled,diff --git a/web/app/components/base/param-item/index.tsx b/web/app/components/base/param-item/index.tsxindex 504119bb383..1652290fda4 100644--- a/web/app/components/base/param-item/index.tsx+++ b/web/app/components/base/param-item/index.tsx@@ -30,7 +30,7 @@ const ParamItem: FC<Props> = ({ className, id, name, noTooltip, tip, step = 0.1,<Switchsize="md"className="mr-2"- defaultValue={enable}+ value={enable}onChange={async (val) => {onSwitchChange?.(id, val)}}diff --git a/web/app/components/base/switch/index.spec.tsx b/web/app/components/base/switch/index.spec.tsxindex b434ddd7298..d4788939c6f 100644--- a/web/app/components/base/switch/index.spec.tsx+++ b/web/app/components/base/switch/index.spec.tsx@@ -4,41 +4,54 @@ import { describe, expect, it, vi } from 'vitest'import Switch from './index'describe('Switch', () => {- it('should render in unchecked state by default', () => {- render(<Switch />)+ it('should render in unchecked state when value is false', () => {+ render(<Switch value={false} />)const switchElement = screen.getByRole('switch')expect(switchElement).toBeInTheDocument()expect(switchElement).toHaveAttribute('aria-checked', 'false')})- it('should render in checked state when defaultValue is true', () => {- render(<Switch defaultValue={true} />)+ it('should render in checked state when value is true', () => {+ render(<Switch value={true} />)const switchElement = screen.getByRole('switch')expect(switchElement).toHaveAttribute('aria-checked', 'true')})- it('should toggle state and call onChange when clicked', async () => {+ it('should call onChange with next value when clicked', async () => {const onChange = vi.fn()const user = userEvent.setup()- render(<Switch onChange={onChange} />)+ render(<Switch value={false} onChange={onChange} />)const switchElement = screen.getByRole('switch')await user.click(switchElement)- expect(switchElement).toHaveAttribute('aria-checked', 'true')expect(onChange).toHaveBeenCalledWith(true)expect(onChange).toHaveBeenCalledTimes(1)+ // Controlled component stays the same until parent updates value.+ expect(switchElement).toHaveAttribute('aria-checked', 'false')+ })++ it('should work in controlled mode with value prop', async () => {+ const onChange = vi.fn()+ const user = userEvent.setup()+ const { rerender } = render(<Switch value={false} onChange={onChange} />)+ const switchElement = screen.getByRole('switch')++ expect(switchElement).toHaveAttribute('aria-checked', 'false')+await user.click(switchElement)+ expect(onChange).toHaveBeenCalledWith(true)expect(switchElement).toHaveAttribute('aria-checked', 'false')- expect(onChange).toHaveBeenCalledWith(false)- expect(onChange).toHaveBeenCalledTimes(2)++ rerender(<Switch value={true} onChange={onChange} />)+ expect(switchElement).toHaveAttribute('aria-checked', 'true')})it('should not call onChange when disabled', async () => {const onChange = vi.fn()const user = userEvent.setup()- render(<Switch disabled onChange={onChange} />)+ render(<Switch value={false} disabled onChange={onChange} />)const switchElement = screen.getByRole('switch')expect(switchElement).toHaveClass('!cursor-not-allowed', '!opacity-50')@@ -48,37 +61,36 @@ describe('Switch', () => {})it('should apply correct size classes', () => {- const { rerender } = render(<Switch size="xs" />)+ const { rerender } = render(<Switch value={false} size="xs" />)// We only need to find the element onceconst switchElement = screen.getByRole('switch')expect(switchElement).toHaveClass('h-2.5', 'w-3.5', 'rounded-sm')- rerender(<Switch size="sm" />)+ rerender(<Switch value={false} size="sm" />)expect(switchElement).toHaveClass('h-3', 'w-5')- rerender(<Switch size="md" />)+ rerender(<Switch value={false} size="md" />)expect(switchElement).toHaveClass('h-4', 'w-7')- rerender(<Switch size="l" />)+ rerender(<Switch value={false} size="l" />)expect(switchElement).toHaveClass('h-5', 'w-9')- rerender(<Switch size="lg" />)+ rerender(<Switch value={false} size="lg" />)expect(switchElement).toHaveClass('h-6', 'w-11')})it('should apply custom className', () => {- render(<Switch className="custom-test-class" />)+ render(<Switch value={false} className="custom-test-class" />)expect(screen.getByRole('switch')).toHaveClass('custom-test-class')})- it('should apply correct background colors based on state', async () => {- const user = userEvent.setup()- render(<Switch />)+ it('should apply correct background colors based on value prop', () => {+ const { rerender } = render(<Switch value={false} />)const switchElement = screen.getByRole('switch')expect(switchElement).toHaveClass('bg-components-toggle-bg-unchecked')- await user.click(switchElement)+ rerender(<Switch value={true} />)expect(switchElement).toHaveClass('bg-components-toggle-bg')})})diff --git a/web/app/components/base/switch/index.stories.tsx b/web/app/components/base/switch/index.stories.tsxindex 7fe7d1fbec4..f3a24f2396c 100644--- a/web/app/components/base/switch/index.stories.tsx+++ b/web/app/components/base/switch/index.stories.tsx@@ -14,15 +14,18 @@ const meta = {},},tags: ['autodocs'],+ args: {+ value: false,+ },argTypes: {size: {control: 'select',options: ['xs', 'sm', 'md', 'lg', 'l'],description: 'Switch size',},- defaultValue: {+ value: {control: 'boolean',- description: 'Default checked state',+ description: 'Checked state (controlled)',},disabled: {control: 'boolean',@@ -36,14 +39,14 @@ type Story = StoryObj<typeof meta>// Interactive demo wrapperconst SwitchDemo = (args: any) => {- const [enabled, setEnabled] = useState(args.defaultValue || false)+ const [enabled, setEnabled] = useState(args.value ?? false)return (<div style={{ width: '300px' }}><div className="flex items-center gap-3"><Switch{...args}- defaultValue={enabled}+ value={enabled}onChange={(value) => {setEnabled(value)console.log('Switch toggled:', value)@@ -62,7 +65,7 @@ export const Default: Story = {render: args => <SwitchDemo {...args} />,args: {size: 'md',- defaultValue: false,+ value: false,disabled: false,},}@@ -72,7 +75,7 @@ export const DefaultOn: Story = {render: args => <SwitchDemo {...args} />,args: {size: 'md',- defaultValue: true,+ value: true,disabled: false,},}@@ -82,7 +85,7 @@ export const DisabledOff: Story = {render: args => <SwitchDemo {...args} />,args: {size: 'md',- defaultValue: false,+ value: false,disabled: true,},}@@ -92,7 +95,7 @@ export const DisabledOn: Story = {render: args => <SwitchDemo {...args} />,args: {size: 'md',- defaultValue: true,+ value: true,disabled: true,},}@@ -111,31 +114,31 @@ const SizeComparisonDemo = () => {<div style={{ width: '400px' }} className="space-y-4"><div className="flex items-center justify-between"><div className="flex items-center gap-3">- <Switch size="xs" defaultValue={states.xs} onChange={v => setStates({ ...states, xs: v })} />+ <Switch size="xs" value={states.xs} onChange={v => setStates({ ...states, xs: v })} /><span className="text-sm text-gray-700">Extra Small (xs)</span></div></div><div className="flex items-center justify-between"><div className="flex items-center gap-3">- <Switch size="sm" defaultValue={states.sm} onChange={v => setStates({ ...states, sm: v })} />+ <Switch size="sm" value={states.sm} onChange={v => setStates({ ...states, sm: v })} /><span className="text-sm text-gray-700">Small (sm)</span></div></div><div className="flex items-center justify-between"><div className="flex items-center gap-3">- <Switch size="md" defaultValue={states.md} onChange={v => setStates({ ...states, md: v })} />+ <Switch size="md" value={states.md} onChange={v => setStates({ ...states, md: v })} /><span className="text-sm text-gray-700">Medium (md)</span></div></div><div className="flex items-center justify-between"><div className="flex items-center gap-3">- <Switch size="l" defaultValue={states.l} onChange={v => setStates({ ...states, l: v })} />+ <Switch size="l" value={states.l} onChange={v => setStates({ ...states, l: v })} /><span className="text-sm text-gray-700">Large (l)</span></div></div><div className="flex items-center justify-between"><div className="flex items-center gap-3">- <Switch size="lg" defaultValue={states.lg} onChange={v => setStates({ ...states, lg: v })} />+ <Switch size="lg" value={states.lg} onChange={v => setStates({ ...states, lg: v })} /><span className="text-sm text-gray-700">Extra Large (lg)</span></div></div>@@ -160,7 +163,7 @@ const WithLabelsDemo = () => {</div><Switchsize="md"- defaultValue={enabled}+ value={enabled}onChange={setEnabled}/></div>@@ -197,7 +200,7 @@ const SettingsPanelDemo = () => {</div><Switchsize="md"- defaultValue={settings.notifications}+ value={settings.notifications}onChange={v => updateSetting('notifications', v)}/></div>@@ -209,7 +212,7 @@ const SettingsPanelDemo = () => {</div><Switchsize="md"- defaultValue={settings.autoSave}+ value={settings.autoSave}onChange={v => updateSetting('autoSave', v)}/></div>@@ -221,7 +224,7 @@ const SettingsPanelDemo = () => {</div><Switchsize="md"- defaultValue={settings.darkMode}+ value={settings.darkMode}onChange={v => updateSetting('darkMode', v)}/></div>@@ -233,7 +236,7 @@ const SettingsPanelDemo = () => {</div><Switchsize="md"- defaultValue={settings.analytics}+ value={settings.analytics}onChange={v => updateSetting('analytics', v)}/></div>@@ -245,7 +248,7 @@ const SettingsPanelDemo = () => {</div><Switchsize="md"- defaultValue={settings.emailUpdates}+ value={settings.emailUpdates}onChange={v => updateSetting('emailUpdates', v)}/></div>@@ -279,7 +282,7 @@ const PrivacyControlsDemo = () => {</div><Switchsize="md"- defaultValue={privacy.profilePublic}+ value={privacy.profilePublic}onChange={v => setPrivacy({ ...privacy, profilePublic: v })}/></div>@@ -291,7 +294,7 @@ const PrivacyControlsDemo = () => {</div><Switchsize="md"- defaultValue={privacy.showEmail}+ value={privacy.showEmail}onChange={v => setPrivacy({ ...privacy, showEmail: v })}/></div>@@ -303,7 +306,7 @@ const PrivacyControlsDemo = () => {</div><Switchsize="md"- defaultValue={privacy.allowMessages}+ value={privacy.allowMessages}onChange={v => setPrivacy({ ...privacy, allowMessages: v })}/></div>@@ -315,7 +318,7 @@ const PrivacyControlsDemo = () => {</div><Switchsize="md"- defaultValue={privacy.shareActivity}+ value={privacy.shareActivity}onChange={v => setPrivacy({ ...privacy, shareActivity: v })}/></div>@@ -351,7 +354,7 @@ const FeatureTogglesDemo = () => {</div><Switchsize="md"- defaultValue={features.betaFeatures}+ value={features.betaFeatures}onChange={v => setFeatures({ ...features, betaFeatures: v })}/></div>@@ -366,7 +369,7 @@ const FeatureTogglesDemo = () => {</div><Switchsize="md"- defaultValue={features.experimentalUI}+ value={features.experimentalUI}onChange={v => setFeatures({ ...features, experimentalUI: v })}/></div>@@ -381,7 +384,7 @@ const FeatureTogglesDemo = () => {</div><Switchsize="md"- defaultValue={features.advancedMode}+ value={features.advancedMode}onChange={v => setFeatures({ ...features, advancedMode: v })}/></div>@@ -396,7 +399,7 @@ const FeatureTogglesDemo = () => {</div><Switchsize="md"- defaultValue={features.developerTools}+ value={features.developerTools}onChange={v => setFeatures({ ...features, developerTools: v })}/></div>@@ -440,7 +443,7 @@ const NotificationPreferencesDemo = () => {</div><Switchsize="md"- defaultValue={notifications.email}+ value={notifications.email}onChange={v => setNotifications({ ...notifications, email: v })}/></div>@@ -455,7 +458,7 @@ const NotificationPreferencesDemo = () => {</div><Switchsize="md"- defaultValue={notifications.push}+ value={notifications.push}onChange={v => setNotifications({ ...notifications, push: v })}/></div>@@ -470,7 +473,7 @@ const NotificationPreferencesDemo = () => {</div><Switchsize="md"- defaultValue={notifications.sms}+ value={notifications.sms}onChange={v => setNotifications({ ...notifications, sms: v })}/></div>@@ -485,7 +488,7 @@ const NotificationPreferencesDemo = () => {</div><Switchsize="md"- defaultValue={notifications.desktop}+ value={notifications.desktop}onChange={v => setNotifications({ ...notifications, desktop: v })}/></div>@@ -523,7 +526,7 @@ const APIAccessControlDemo = () => {</div><Switchsize="md"- defaultValue={access.readAccess}+ value={access.readAccess}onChange={v => setAccess({ ...access, readAccess: v })}/></div>@@ -539,7 +542,7 @@ const APIAccessControlDemo = () => {</div><Switchsize="md"- defaultValue={access.writeAccess}+ value={access.writeAccess}onChange={v => setAccess({ ...access, writeAccess: v })}/></div>@@ -555,7 +558,7 @@ const APIAccessControlDemo = () => {</div><Switchsize="md"- defaultValue={access.deleteAccess}+ value={access.deleteAccess}onChange={v => setAccess({ ...access, deleteAccess: v })}/></div>@@ -571,7 +574,7 @@ const APIAccessControlDemo = () => {</div><Switchsize="md"- defaultValue={access.adminAccess}+ value={access.adminAccess}onChange={v => setAccess({ ...access, adminAccess: v })}/></div>@@ -609,7 +612,7 @@ const CompactListDemo = () => {<span className="text-sm text-gray-700">{item.name}</span><Switchsize="sm"- defaultValue={item.enabled}+ value={item.enabled}onChange={() => toggleItem(item.id)}/></div>@@ -628,7 +631,7 @@ export const Playground: Story = {render: args => <SwitchDemo {...args} />,args: {size: 'md',- defaultValue: false,+ value: false,disabled: false,},}diff --git a/web/app/components/base/switch/index.tsx b/web/app/components/base/switch/index.tsxindex 6296a33141b..8c900bb1239 100644--- a/web/app/components/base/switch/index.tsx+++ b/web/app/components/base/switch/index.tsx@@ -1,13 +1,12 @@'use client'import { Switch as OriginalSwitch } from '@headlessui/react'import * as React from 'react'-import { useEffect, useState } from 'react'import { cn } from '@/utils/classnames'type SwitchProps = {+ value: booleanonChange?: (value: boolean) => voidsize?: 'xs' | 'sm' | 'md' | 'lg' | 'l'- defaultValue?: booleandisabled?: booleanclassName?: string}@@ -15,19 +14,15 @@ type SwitchProps = {const Switch = ({ref: propRef,+ value,onChange,size = 'md',- defaultValue = false,disabled = false,className,}: SwitchProps & {ref?: React.RefObject<HTMLButtonElement>},) => {- const [enabled, setEnabled] = useState(defaultValue)- useEffect(() => {- setEnabled(defaultValue)- }, [defaultValue])const wrapStyle = {lg: 'h-6 w-11',l: 'h-5 w-9',@@ -54,18 +49,17 @@ const Switch = (return (<OriginalSwitchref={propRef}- checked={enabled}+ checked={value}onChange={(checked: boolean) => {if (disabled)return- setEnabled(checked)onChange?.(checked)}}- className={cn(wrapStyle[size], enabled ? 'bg-components-toggle-bg' : 'bg-components-toggle-bg-unchecked', 'relative inline-flex shrink-0 cursor-pointer rounded-[5px] border-2 border-transparent transition-colors duration-200 ease-in-out', disabled ? '!cursor-not-allowed !opacity-50' : '', size === 'xs' && 'rounded-sm', className)}+ className={cn(wrapStyle[size], value ? 'bg-components-toggle-bg' : 'bg-components-toggle-bg-unchecked', 'relative inline-flex shrink-0 cursor-pointer rounded-[5px] border-2 border-transparent transition-colors duration-200 ease-in-out', disabled ? '!cursor-not-allowed !opacity-50' : '', size === 'xs' && 'rounded-sm', className)}><spanaria-hidden="true"- className={cn(circleStyle[size], enabled ? translateLeft[size] : 'translate-x-0', size === 'xs' && 'rounded-[1px]', 'pointer-events-none inline-block rounded-[3px] bg-components-toggle-knob shadow ring-0 transition duration-200 ease-in-out')}+ className={cn(circleStyle[size], value ? translateLeft[size] : 'translate-x-0', size === 'xs' && 'rounded-[1px]', 'pointer-events-none inline-block rounded-[3px] bg-components-toggle-knob shadow ring-0 transition duration-200 ease-in-out')}/></OriginalSwitch>)diff --git a/web/app/components/billing/pricing/plan-switcher/plan-range-switcher.tsx b/web/app/components/billing/pricing/plan-switcher/plan-range-switcher.tsxindex cb5b0510d8c..92cbdf0e63e 100644--- a/web/app/components/billing/pricing/plan-switcher/plan-range-switcher.tsx+++ b/web/app/components/billing/pricing/plan-switcher/plan-range-switcher.tsx@@ -24,12 +24,12 @@ const PlanRangeSwitcher: FC<PlanRangeSwitcherProps> = ({<div className="flex items-center justify-end gap-x-3 pr-5"><Switchsize="l"- defaultValue={value === PlanRange.yearly}+ value={value === PlanRange.yearly}onChange={(v) => {onChange(v ? PlanRange.yearly : PlanRange.monthly)}}/>- <span className="system-md-regular text-text-tertiary">+ <span className="text-text-tertiary system-md-regular">{t('plansCommon.annualBilling', { ns: 'billing', percent: 17 })}</span></div>diff --git a/web/app/components/custom/custom-web-app-brand/index.tsx b/web/app/components/custom/custom-web-app-brand/index.tsxindex d9e80e80d12..438e69894de 100644--- a/web/app/components/custom/custom-web-app-brand/index.tsx+++ b/web/app/components/custom/custom-web-app-brand/index.tsx@@ -116,19 +116,19 @@ const CustomWebAppBrand = () => {return (<div className="py-4">- <div className="system-md-medium mb-2 flex items-center justify-between rounded-xl bg-background-section-burn p-4 text-text-primary">+ <div className="mb-2 flex items-center justify-between rounded-xl bg-background-section-burn p-4 text-text-primary system-md-medium">{t('webapp.removeBrand', { ns: 'custom' })}<Switchsize="l"- defaultValue={webappBrandRemoved}+ value={webappBrandRemoved ?? false}disabled={isSandbox || !isCurrentWorkspaceManager}onChange={handleSwitch}/></div><div className={cn('flex h-14 items-center justify-between rounded-xl bg-background-section-burn px-4', webappBrandRemoved && 'opacity-30')}><div>- <div className="system-md-medium text-text-primary">{t('webapp.changeLogo', { ns: 'custom' })}</div>- <div className="system-xs-regular text-text-tertiary">{t('webapp.changeLogoTip', { ns: 'custom' })}</div>+ <div className="text-text-primary system-md-medium">{t('webapp.changeLogo', { ns: 'custom' })}</div>+ <div className="text-text-tertiary system-xs-regular">{t('webapp.changeLogoTip', { ns: 'custom' })}</div></div><div className="flex items-center">{(!uploadDisabled && webappLogo && !webappBrandRemoved) && (@@ -204,7 +204,7 @@ const CustomWebAppBrand = () => {<div className="mt-2 text-xs text-[#D92D20]">{t('uploadedFail', { ns: 'custom' })}</div>)}<div className="mb-2 mt-5 flex items-center gap-2">- <div className="system-xs-medium-uppercase shrink-0 text-text-tertiary">{t('overview.appInfo.preview', { ns: 'appOverview' })}</div>+ <div className="shrink-0 text-text-tertiary system-xs-medium-uppercase">{t('overview.appInfo.preview', { ns: 'appOverview' })}</div><Divider bgStyle="gradient" className="grow" /></div><div className="relative mb-2 flex items-center gap-3">@@ -215,7 +215,7 @@ const CustomWebAppBrand = () => {<div className={cn('inline-flex h-8 w-8 items-center justify-center rounded-lg border border-divider-regular', 'bg-components-icon-bg-blue-light-solid')}><BubbleTextMod className="h-4 w-4 text-components-avatar-shape-fill-stop-100" /></div>- <div className="system-md-semibold grow text-text-secondary">Chatflow App</div>+ <div className="grow text-text-secondary system-md-semibold">Chatflow App</div><div className="p-1.5"><RiLayoutLeft2Line className="h-4 w-4 text-text-tertiary" /></div>@@ -246,7 +246,7 @@ const CustomWebAppBrand = () => {<div className="flex items-center gap-1.5">{!webappBrandRemoved && (<>- <div className="system-2xs-medium-uppercase text-text-tertiary">POWERED BY</div>+ <div className="text-text-tertiary system-2xs-medium-uppercase">POWERED BY</div>{systemFeatures.branding.enabled && systemFeatures.branding.workspace_logo? <img src={systemFeatures.branding.workspace_logo} alt="logo" className="block h-5 w-auto" />@@ -262,12 +262,12 @@ const CustomWebAppBrand = () => {<div className="flex w-[138px] grow flex-col justify-between p-2 pr-0"><div className="flex grow flex-col justify-between rounded-l-2xl border-[0.5px] border-r-0 border-components-panel-border-subtle bg-chatbot-bg pb-4 pl-[22px] pt-16"><div className="w-[720px] rounded-2xl border border-divider-subtle bg-chat-bubble-bg px-4 py-3">- <div className="body-md-regular mb-1 text-text-primary">Hello! How can I assist you today?</div>+ <div className="mb-1 text-text-primary body-md-regular">Hello! How can I assist you today?</div><Button size="small"><div className="h-2 w-[144px] rounded-sm bg-text-quaternary opacity-20"></div></Button></div>- <div className="body-lg-regular flex h-[52px] w-[578px] items-center rounded-xl border border-components-chat-input-border bg-components-panel-bg-blur pl-3.5 text-text-placeholder shadow-md backdrop-blur-sm">Talk to Dify</div>+ <div className="flex h-[52px] w-[578px] items-center rounded-xl border border-components-chat-input-border bg-components-panel-bg-blur pl-3.5 text-text-placeholder shadow-md backdrop-blur-sm body-lg-regular">Talk to Dify</div></div></div></div>@@ -278,14 +278,14 @@ const CustomWebAppBrand = () => {<div className={cn('inline-flex h-8 w-8 items-center justify-center rounded-lg border border-divider-regular', 'bg-components-icon-bg-indigo-solid')}><RiExchange2Fill className="h-4 w-4 text-components-avatar-shape-fill-stop-100" /></div>- <div className="system-md-semibold grow text-text-secondary">Workflow App</div>+ <div className="grow text-text-secondary system-md-semibold">Workflow App</div><div className="p-1.5"><RiLayoutLeft2Line className="h-4 w-4 text-text-tertiary" /></div></div><div className="flex items-center gap-4">- <div className="system-md-semibold-uppercase flex h-10 shrink-0 items-center border-b-2 border-components-tab-active text-text-primary">RUN ONCE</div>- <div className="system-md-semibold-uppercase flex h-10 grow items-center border-b-2 border-transparent text-text-tertiary">RUN BATCH</div>+ <div className="flex h-10 shrink-0 items-center border-b-2 border-components-tab-active text-text-primary system-md-semibold-uppercase">RUN ONCE</div>+ <div className="flex h-10 grow items-center border-b-2 border-transparent text-text-tertiary system-md-semibold-uppercase">RUN BATCH</div></div></div><div className="grow bg-components-panel-bg">@@ -293,7 +293,7 @@ const CustomWebAppBrand = () => {<div className="mb-1 py-2"><div className="h-2 w-20 rounded-sm bg-text-quaternary opacity-20"></div></div>- <div className="h-16 w-full rounded-lg bg-components-input-bg-normal "></div>+ <div className="h-16 w-full rounded-lg bg-components-input-bg-normal"></div></div><div className="flex items-center justify-between px-4 py-3"><Button size="small">@@ -308,7 +308,7 @@ const CustomWebAppBrand = () => {<div className="flex h-12 shrink-0 items-center gap-1.5 bg-components-panel-bg p-4 pt-3">{!webappBrandRemoved && (<>- <div className="system-2xs-medium-uppercase text-text-tertiary">POWERED BY</div>+ <div className="text-text-tertiary system-2xs-medium-uppercase">POWERED BY</div>{systemFeatures.branding.enabled && systemFeatures.branding.workspace_logo? <img src={systemFeatures.branding.workspace_logo} alt="logo" className="block h-5 w-auto" />diff --git a/web/app/components/datasets/common/retrieval-param-config/__tests__/index.spec.tsx b/web/app/components/datasets/common/retrieval-param-config/__tests__/index.spec.tsxindex a2bd2a51ce6..f5b41688e12 100644--- a/web/app/components/datasets/common/retrieval-param-config/__tests__/index.spec.tsx+++ b/web/app/components/datasets/common/retrieval-param-config/__tests__/index.spec.tsx@@ -123,11 +123,11 @@ vi.mock('@/app/components/base/radio-card', () => ({}))vi.mock('@/app/components/base/switch', () => ({- default: ({ defaultValue, onChange }: { defaultValue: boolean, onChange: (v: boolean) => void }) => (+ default: ({ value, onChange }: { value: boolean, onChange?: (v: boolean) => void }) => (<buttondata-testid="rerank-switch"- data-checked={defaultValue}- onClick={() => onChange(!defaultValue)}+ data-checked={value}+ onClick={() => onChange?.(!value)}>Switch</button>diff --git a/web/app/components/datasets/common/retrieval-param-config/index.tsx b/web/app/components/datasets/common/retrieval-param-config/index.tsxindex f6205a7862b..ef4ebdab73c 100644--- a/web/app/components/datasets/common/retrieval-param-config/index.tsx+++ b/web/app/components/datasets/common/retrieval-param-config/index.tsx@@ -122,7 +122,7 @@ const RetrievalParamConfig: FC<Props> = ({{canToggleRerankModalEnable && (<Switchsize="md"- defaultValue={value.reranking_enable}+ value={value.reranking_enable}onChange={handleToggleRerankEnable}/>)}diff --git a/web/app/components/datasets/documents/components/operations.tsx b/web/app/components/datasets/documents/components/operations.tsxindex cdd694fad92..15c89a9b26b 100644--- a/web/app/components/datasets/documents/components/operations.tsx+++ b/web/app/components/datasets/documents/components/operations.tsx@@ -191,7 +191,7 @@ const Operations = ({return (<div className="flex items-center" onClick={e => e.stopPropagation()}>{isListScene && !embeddingAvailable && (- <Switch defaultValue={false} onChange={noop} disabled={true} size="md" />+ <Switch value={false} onChange={noop} disabled={true} size="md" />)}{isListScene && embeddingAvailable && (<>@@ -202,11 +202,11 @@ const Operations = ({popupClassName="!font-semibold"><div>- <Switch defaultValue={false} onChange={noop} disabled={true} size="md" />+ <Switch value={false} onChange={noop} disabled={true} size="md" /></div></Tooltip>)- : <Switch defaultValue={enabled} onChange={v => handleSwitch(v ? 'enable' : 'disable')} size="md" />}+ : <Switch value={enabled} onChange={v => handleSwitch(v ? 'enable' : 'disable')} size="md" />}<Divider className="!ml-4 !mr-2 !h-3" type="vertical" /></>)}diff --git a/web/app/components/datasets/documents/detail/completed/segment-card/index.tsx b/web/app/components/datasets/documents/detail/completed/segment-card/index.tsxindex ce83d8ab5c0..759c26b00cb 100644--- a/web/app/components/datasets/documents/detail/completed/segment-card/index.tsx+++ b/web/app/components/datasets/documents/detail/completed/segment-card/index.tsx@@ -216,7 +216,7 @@ const SegmentCard: FC<ISegmentCardProps> = ({<Switchsize="md"disabled={archived || detail?.status !== 'completed'}- defaultValue={enabled}+ value={enabled}onChange={async (val) => {await onChangeSwitch?.(val, id)}}diff --git a/web/app/components/datasets/documents/status-item/index.tsx b/web/app/components/datasets/documents/status-item/index.tsxindex 703e3e4bf4e..60d837fd81c 100644--- a/web/app/components/datasets/documents/status-item/index.tsx+++ b/web/app/components/datasets/documents/status-item/index.tsx@@ -119,7 +119,7 @@ const StatusItem = ({disabled={!archived}><Switch- defaultValue={archived ? false : enabled}+ value={archived ? false : enabled}onChange={v => !archived && handleSwitch(v ? 'enable' : 'disable')}disabled={embedding || archived}size="md"diff --git a/web/app/components/datasets/extra-info/api-access/card.tsx b/web/app/components/datasets/extra-info/api-access/card.tsxindex 77c44795f48..946536bf2cb 100644--- a/web/app/components/datasets/extra-info/api-access/card.tsx+++ b/web/app/components/datasets/extra-info/api-access/card.tsx@@ -60,7 +60,7 @@ const Card = ({</div></div><Switch- defaultValue={apiEnabled}+ value={apiEnabled}onChange={onToggle}disabled={!isCurrentWorkspaceManager}/>diff --git a/web/app/components/datasets/metadata/metadata-dataset/dataset-metadata-drawer.tsx b/web/app/components/datasets/metadata/metadata-dataset/dataset-metadata-drawer.tsxindex 242275d5949..ccd6240814f 100644--- a/web/app/components/datasets/metadata/metadata-dataset/dataset-metadata-drawer.tsx+++ b/web/app/components/datasets/metadata/metadata-dataset/dataset-metadata-drawer.tsx@@ -204,7 +204,7 @@ const DatasetMetadataDrawer: FC<Props> = ({<div className="mt-3 flex h-6 items-center"><Switch- defaultValue={isBuiltInEnabled}+ value={isBuiltInEnabled}onChange={onIsBuiltInEnabledChange}/><div className="system-sm-semibold ml-2 mr-0.5 text-text-secondary">{t(`${i18nPrefix}.builtIn`, { ns: 'dataset' })}</div>diff --git a/web/app/components/datasets/settings/summary-index-setting.tsx b/web/app/components/datasets/settings/summary-index-setting.tsxindex b79f8ffe0c4..a6b99e8dabb 100644--- a/web/app/components/datasets/settings/summary-index-setting.tsx+++ b/web/app/components/datasets/settings/summary-index-setting.tsx@@ -72,7 +72,7 @@ const SummaryIndexSetting = ({</Tooltip></div><Switch- defaultValue={summaryIndexSetting?.enable ?? false}+ value={summaryIndexSetting?.enable ?? false}onChange={handleSummaryIndexEnableChange}size="md"/>@@ -119,7 +119,7 @@ const SummaryIndexSetting = ({<div className="system-sm-semibold flex items-center text-text-secondary"><SwitchclassName="mr-2"- defaultValue={summaryIndexSetting?.enable ?? false}+ value={summaryIndexSetting?.enable ?? false}onChange={handleSummaryIndexEnableChange}size="md"/>@@ -184,7 +184,7 @@ const SummaryIndexSetting = ({<div className="flex h-6 items-center"><SwitchclassName="mr-2"- defaultValue={summaryIndexSetting?.enable ?? false}+ value={summaryIndexSetting?.enable ?? false}onChange={handleSummaryIndexEnableChange}size="md"/>diff --git a/web/app/components/explore/create-app-modal/index.tsx b/web/app/components/explore/create-app-modal/index.tsxindex cfe59fb7f36..a6877692213 100644--- a/web/app/components/explore/create-app-modal/index.tsx+++ b/web/app/components/explore/create-app-modal/index.tsx@@ -166,7 +166,7 @@ const CreateAppModal = ({<div className="flex items-center justify-between"><div className="py-2 text-sm font-medium leading-[20px] text-text-primary">{t('answerIcon.title', { ns: 'app' })}</div><Switch- defaultValue={useIconAsAnswerIcon}+ value={useIconAsAnswerIcon}onChange={v => setUseIconAsAnswerIcon(v)}/></div>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.tsxindex b10634873a8..f2c35c18236 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@@ -257,7 +257,7 @@ const ParameterItem: FC<ParameterItemProps> = ({!parameterRule.required && parameterRule.name !== 'stop' && (<div className="mr-2 w-7"><Switch- defaultValue={!isNullOrUndefined(value)}+ value={!isNullOrUndefined(value)}onChange={handleSwitch}size="md"/>diff --git a/web/app/components/header/account-setting/model-provider-page/provider-added-card/model-list-item.tsx b/web/app/components/header/account-setting/model-provider-page/provider-added-card/model-list-item.tsxindex d12fbcbad2e..908d2f0e6c6 100644--- a/web/app/components/header/account-setting/model-provider-page/provider-added-card/model-list-item.tsx+++ b/web/app/components/header/account-setting/model-provider-page/provider-added-card/model-list-item.tsx@@ -92,13 +92,13 @@ const ModelListItem = ({ model, provider, isConfigurable, onChange, onModifyLoad}offset={{ mainAxis: 4 }}>- <Switch defaultValue={false} disabled size="md" />+ <Switch value={false} disabled size="md" /></Tooltip>): (isCurrentWorkspaceManager && (<SwitchclassName="ml-2"- defaultValue={model?.status === ModelStatusEnum.active}+ value={model?.status === ModelStatusEnum.active}disabled={![ModelStatusEnum.active, ModelStatusEnum.disabled].includes(model.status)}size="md"onChange={onEnablingStateChange}diff --git a/web/app/components/header/account-setting/model-provider-page/provider-added-card/model-load-balancing-configs.tsx b/web/app/components/header/account-setting/model-provider-page/provider-added-card/model-load-balancing-configs.tsxindex 7e53c774f72..8ed647a6ad4 100644--- a/web/app/components/header/account-setting/model-provider-page/provider-added-card/model-load-balancing-configs.tsx+++ b/web/app/components/header/account-setting/model-provider-page/provider-added-card/model-load-balancing-configs.tsx@@ -167,7 +167,7 @@ const ModelLoadBalancingConfigs = ({{withSwitch && (<Switch- defaultValue={Boolean(draftConfig.enabled)}+ value={Boolean(draftConfig.enabled)}size="l"className="ml-3 justify-self-end"disabled={!modelLoadBalancingEnabled && !draftConfig.enabled}@@ -227,7 +227,7 @@ const ModelLoadBalancingConfigs = ({<><span className="mr-2 h-3 border-r border-r-divider-subtle" /><Switch- defaultValue={credential?.not_allowed_to_use ? false : Boolean(config.enabled)}+ value={credential?.not_allowed_to_use ? false : Boolean(config.enabled)}size="md"className="justify-self-end"onChange={value => toggleConfigEntryEnabled(index, value)}diff --git a/web/app/components/plugins/plugin-detail-panel/endpoint-card.tsx b/web/app/components/plugins/plugin-detail-panel/endpoint-card.tsxindex 4190ef0a7f9..164bab0f045 100644--- a/web/app/components/plugins/plugin-detail-panel/endpoint-card.tsx+++ b/web/app/components/plugins/plugin-detail-panel/endpoint-card.tsx@@ -181,7 +181,7 @@ const EndpointCard = ({)}<SwitchclassName="ml-3"- defaultValue={active}+ value={active}onChange={handleSwitch}size="sm"/>diff --git a/web/app/components/plugins/plugin-detail-panel/tool-selector/components/reasoning-config-form.tsx b/web/app/components/plugins/plugin-detail-panel/tool-selector/components/reasoning-config-form.tsxindex 6ffb8756d31..7460226768c 100644--- a/web/app/components/plugins/plugin-detail-panel/tool-selector/components/reasoning-config-form.tsx+++ b/web/app/components/plugins/plugin-detail-panel/tool-selector/components/reasoning-config-form.tsx@@ -258,7 +258,7 @@ const ReasoningConfigForm: React.FC<Props> = ({<span className="system-xs-medium text-text-secondary">{t('detailPanel.toolSelector.auto', { ns: 'plugin' })}</span><Switchsize="xs"- defaultValue={!!auto}+ value={!!auto}onChange={val => handleAutomatic(variable, val, type)}/></div>diff --git a/web/app/components/plugins/plugin-detail-panel/tool-selector/components/tool-item.tsx b/web/app/components/plugins/plugin-detail-panel/tool-selector/components/tool-item.tsxindex dd85bc376cf..b35770f23dd 100644--- a/web/app/components/plugins/plugin-detail-panel/tool-selector/components/tool-item.tsx+++ b/web/app/components/plugins/plugin-detail-panel/tool-selector/components/tool-item.tsx@@ -95,8 +95,8 @@ const ToolItem = ({</div>)}<div className={cn('grow truncate pl-0.5', isTransparent && 'opacity-50', isShowCanNotChooseMCPTip && 'opacity-30')}>- <div className="system-2xs-medium-uppercase text-text-tertiary">{providerNameText}</div>- <div className="system-xs-medium text-text-secondary">{toolLabel}</div>+ <div className="text-text-tertiary system-2xs-medium-uppercase">{providerNameText}</div>+ <div className="text-text-secondary system-xs-medium">{toolLabel}</div></div><div className="hidden items-center gap-1 group-hover:flex">{!noAuth && !isError && !uninstalled && !versionMismatch && !isShowCanNotChooseMCPTip && (@@ -120,7 +120,7 @@ const ToolItem = ({<div className="mr-1" onClick={e => e.stopPropagation()}><Switchsize="md"- defaultValue={switchValue}+ value={switchValue ?? false}onChange={onSwitchChange}/></div>diff --git a/web/app/components/tools/mcp/mcp-service-card.tsx b/web/app/components/tools/mcp/mcp-service-card.tsxindex 4a85fff7c81..f0efefd7b1b 100644--- a/web/app/components/tools/mcp/mcp-service-card.tsx+++ b/web/app/components/tools/mcp/mcp-service-card.tsx@@ -250,7 +250,7 @@ const MCPServiceCard: FC<IAppCardProps> = ({offset={24}><div>- <Switch defaultValue={activated} onChange={onChangeStatus} disabled={toggleDisabled} />+ <Switch value={activated} onChange={onChangeStatus} disabled={toggleDisabled} /></div></Tooltip></div>diff --git a/web/app/components/tools/mcp/sections/authentication-section.tsx b/web/app/components/tools/mcp/sections/authentication-section.tsxindex dc27e573ef2..0e202b2f593 100644--- a/web/app/components/tools/mcp/sections/authentication-section.tsx+++ b/web/app/components/tools/mcp/sections/authentication-section.tsx@@ -32,7 +32,7 @@ const AuthenticationSection: FC<AuthenticationSectionProps> = ({<div className="mb-1 flex h-6 items-center"><SwitchclassName="mr-2"- defaultValue={isDynamicRegistration}+ value={isDynamicRegistration}onChange={onDynamicRegistrationChange}/><span className="system-sm-medium text-text-secondary">{t('mcp.modal.useDynamicClientRegistration', { ns: 'tools' })}</span>diff --git a/web/app/components/workflow/nodes/_base/components/config-vision.tsx b/web/app/components/workflow/nodes/_base/components/config-vision.tsxindex b81d0b9a902..65a179fddd8 100644--- a/web/app/components/workflow/nodes/_base/components/config-vision.tsx+++ b/web/app/components/workflow/nodes/_base/components/config-vision.tsx@@ -65,7 +65,7 @@ const ConfigVision: FC<Props> = ({popupContent={t('vision.onlySupportVisionModelTip', { ns: 'appDebug' })!}disabled={isVisionModel}>- <Switch disabled={readOnly || !isVisionModel} size="md" defaultValue={!isVisionModel ? false : enabled} onChange={onEnabledChange} />+ <Switch disabled={readOnly || !isVisionModel} size="md" value={!isVisionModel ? false : enabled} onChange={onEnabledChange} /></Tooltip>)}>diff --git a/web/app/components/workflow/nodes/_base/components/memory-config.tsx b/web/app/components/workflow/nodes/_base/components/memory-config.tsxindex 4669762f0c3..ac82162915c 100644--- a/web/app/components/workflow/nodes/_base/components/memory-config.tsx+++ b/web/app/components/workflow/nodes/_base/components/memory-config.tsx@@ -136,7 +136,7 @@ const MemoryConfig: FC<Props> = ({tooltip={t(`${i18nPrefix}.memoryTip`, { ns: 'workflow' })!}operations={(<Switch- defaultValue={!!payload}+ value={!!payload}onChange={handleMemoryEnabledChange}size="md"disabled={readonly}@@ -149,7 +149,7 @@ const MemoryConfig: FC<Props> = ({<div className="flex justify-between"><div className="flex h-8 items-center space-x-2"><Switch- defaultValue={payload?.window?.enabled}+ value={payload?.window?.enabled}onChange={handleWindowEnabledChange}size="md"disabled={readonly}diff --git a/web/app/components/workflow/nodes/_base/components/prompt/editor.tsx b/web/app/components/workflow/nodes/_base/components/prompt/editor.tsxindex 627d473a108..ceb60e7cdb4 100644--- a/web/app/components/workflow/nodes/_base/components/prompt/editor.tsx+++ b/web/app/components/workflow/nodes/_base/components/prompt/editor.tsx@@ -196,7 +196,7 @@ const Editor: FC<Props> = ({<Jinja className="h-3 w-6 text-text-quaternary" /><Switchsize="sm"- defaultValue={editionType === EditionType.jinja2}+ value={editionType === EditionType.jinja2}onChange={(checked) => {onEditionTypeChange?.(checked ? EditionType.jinja2 : EditionType.basic)}}diff --git a/web/app/components/workflow/nodes/_base/components/retry/retry-on-panel.tsx b/web/app/components/workflow/nodes/_base/components/retry/retry-on-panel.tsxindex b4ac15bf38e..d509ea4757c 100644--- a/web/app/components/workflow/nodes/_base/components/retry/retry-on-panel.tsx+++ b/web/app/components/workflow/nodes/_base/components/retry/retry-on-panel.tsx@@ -55,10 +55,10 @@ const RetryOnPanel = ({<div className="pt-2"><div className="flex h-10 items-center justify-between px-4 py-2"><div className="flex items-center">- <div className="system-sm-semibold-uppercase mr-0.5 text-text-secondary">{t('nodes.common.retry.retryOnFailure', { ns: 'workflow' })}</div>+ <div className="mr-0.5 text-text-secondary system-sm-semibold-uppercase">{t('nodes.common.retry.retryOnFailure', { ns: 'workflow' })}</div></div><Switch- defaultValue={retry_config?.retry_enabled}+ value={retry_config?.retry_enabled ?? false}onChange={v => handleRetryEnabledChange(v)}/></div>@@ -66,7 +66,7 @@ const RetryOnPanel = ({retry_config?.retry_enabled && (<div className="px-4 pb-2"><div className="mb-1 flex w-full items-center">- <div className="system-xs-medium-uppercase mr-2 grow text-text-secondary">{t('nodes.common.retry.maxRetries', { ns: 'workflow' })}</div>+ <div className="mr-2 grow text-text-secondary system-xs-medium-uppercase">{t('nodes.common.retry.maxRetries', { ns: 'workflow' })}</div><SliderclassName="mr-3 w-[108px]"value={retry_config?.max_retries || 3}@@ -87,7 +87,7 @@ const RetryOnPanel = ({/></div><div className="flex items-center">- <div className="system-xs-medium-uppercase mr-2 grow text-text-secondary">{t('nodes.common.retry.retryInterval', { ns: 'workflow' })}</div>+ <div className="mr-2 grow text-text-secondary system-xs-medium-uppercase">{t('nodes.common.retry.retryInterval', { ns: 'workflow' })}</div><SliderclassName="mr-3 w-[108px]"value={retry_config?.retry_interval || 1000}diff --git a/web/app/components/workflow/nodes/http/panel.tsx b/web/app/components/workflow/nodes/http/panel.tsxindex 0a1358d1262..7926d52fc72 100644--- a/web/app/components/workflow/nodes/http/panel.tsx+++ b/web/app/components/workflow/nodes/http/panel.tsx@@ -131,7 +131,7 @@ const Panel: FC<NodePanelProps<HttpNodeType>> = ({tooltip={t(`${i18nPrefix}.verifySSL.warningTooltip`, { ns: 'workflow' })}operations={(<Switch- defaultValue={!!inputs.ssl_verify}+ value={!!inputs.ssl_verify}onChange={handleSSLVerifyChange}size="md"disabled={readOnly}diff --git a/web/app/components/workflow/nodes/human-input/components/delivery-method/email-configure-modal.tsx b/web/app/components/workflow/nodes/human-input/components/delivery-method/email-configure-modal.tsxindex 4ca1c282902..fa5cbfd3a2e 100644--- a/web/app/components/workflow/nodes/human-input/components/delivery-method/email-configure-modal.tsx+++ b/web/app/components/workflow/nodes/human-input/components/delivery-method/email-configure-modal.tsx@@ -149,7 +149,7 @@ const EmailConfigureModal = ({</div></div><Switch- defaultValue={debugMode}+ value={debugMode}onChange={checked => setDebugMode(checked)}/></div>diff --git a/web/app/components/workflow/nodes/human-input/components/delivery-method/method-item.tsx b/web/app/components/workflow/nodes/human-input/components/delivery-method/method-item.tsxindex bea2f8cb354..40f0acf137b 100644--- a/web/app/components/workflow/nodes/human-input/components/delivery-method/method-item.tsx+++ b/web/app/components/workflow/nodes/human-input/components/delivery-method/method-item.tsx@@ -160,7 +160,7 @@ const DeliveryMethodItem: FC<DeliveryMethodItemProps> = ({)}{(method.config || method.type === DeliveryMethodType.WebApp) && (<Switch- defaultValue={method.enabled}+ value={method.enabled}onChange={handleEnableStatusChange}disabled={readonly}/>diff --git a/web/app/components/workflow/nodes/human-input/components/delivery-method/recipient/index.tsx b/web/app/components/workflow/nodes/human-input/components/delivery-method/recipient/index.tsxindex 9b5f4ef68c8..f186daab4d8 100644--- a/web/app/components/workflow/nodes/human-input/components/delivery-method/recipient/index.tsx+++ b/web/app/components/workflow/nodes/human-input/components/delivery-method/recipient/index.tsx@@ -91,7 +91,7 @@ const Recipient = ({</div><div className={cn('system-sm-medium grow text-text-secondary')}>{t(`${i18nPrefix}.deliveryMethod.emailConfigure.allMembers`, { workspaceName: currentWorkspace.name.replace(/'/g, '’'), ns: 'workflow' })}</div><Switch- defaultValue={data.whole_workspace}+ value={data.whole_workspace}onChange={checked => onChange({ ...data, whole_workspace: checked })}/></div>diff --git a/web/app/components/workflow/nodes/iteration/panel.tsx b/web/app/components/workflow/nodes/iteration/panel.tsxindex 6307869bd4a..c1c5e978392 100644--- a/web/app/components/workflow/nodes/iteration/panel.tsx+++ b/web/app/components/workflow/nodes/iteration/panel.tsx@@ -92,7 +92,7 @@ const Panel: FC<NodePanelProps<IterationNodeType>> = ({</div><div className="px-4 pb-2"><Field title={t(`${i18nPrefix}.parallelMode`, { ns: 'workflow' })} tooltip={<div className="w-[230px]">{t(`${i18nPrefix}.parallelPanelDesc`, { ns: 'workflow' })}</div>} inline>- <Switch defaultValue={inputs.is_parallel} onChange={changeParallel} />+ <Switch value={inputs.is_parallel} onChange={changeParallel} /></Field></div>{@@ -130,7 +130,7 @@ const Panel: FC<NodePanelProps<IterationNodeType>> = ({tooltip={<div className="w-[230px]">{t(`${i18nPrefix}.flattenOutputDesc`, { ns: 'workflow' })}</div>}inline>- <Switch defaultValue={inputs.flatten_output} onChange={changeFlattenOutput} />+ <Switch value={inputs.flatten_output} onChange={changeFlattenOutput} /></Field></div></div>diff --git a/web/app/components/workflow/nodes/knowledge-base/components/retrieval-setting/search-method-option.tsx b/web/app/components/workflow/nodes/knowledge-base/components/retrieval-setting/search-method-option.tsxindex d5f632699f6..c7addde4c5c 100644--- a/web/app/components/workflow/nodes/knowledge-base/components/retrieval-setting/search-method-option.tsx+++ b/web/app/components/workflow/nodes/knowledge-base/components/retrieval-setting/search-method-option.tsx@@ -166,10 +166,10 @@ const SearchMethodOption = ({<div>{showRerankModelSelectorSwitch && (- <div className="system-sm-semibold mb-1 flex items-center text-text-secondary">+ <div className="mb-1 flex items-center text-text-secondary system-sm-semibold"><SwitchclassName="mr-1"- defaultValue={rerankingModelEnabled}+ value={rerankingModelEnabled ?? false}onChange={onRerankingModelEnabledChange}disabled={readonly}/>@@ -192,7 +192,7 @@ const SearchMethodOption = ({<div className="p-1"><AlertTriangle className="size-4 text-text-warning-secondary" /></div>- <span className="system-xs-medium text-text-primary">+ <span className="text-text-primary system-xs-medium">{t('form.retrievalSetting.multiModalTip', { ns: 'datasetSettings' })}</span></div>diff --git a/web/app/components/workflow/nodes/knowledge-base/components/retrieval-setting/top-k-and-score-threshold.tsx b/web/app/components/workflow/nodes/knowledge-base/components/retrieval-setting/top-k-and-score-threshold.tsxindex bf3b8297c36..62b4e68093f 100644--- a/web/app/components/workflow/nodes/knowledge-base/components/retrieval-setting/top-k-and-score-threshold.tsx+++ b/web/app/components/workflow/nodes/knowledge-base/components/retrieval-setting/top-k-and-score-threshold.tsx@@ -56,7 +56,7 @@ const TopKAndScoreThreshold = ({return (<div className="grid grid-cols-2 gap-4"><div>- <div className="system-xs-medium mb-0.5 flex h-6 items-center text-text-secondary">+ <div className="mb-0.5 flex h-6 items-center text-text-secondary system-xs-medium">{t('datasetConfig.top_k', { ns: 'appDebug' })}<TooltiptriggerClassName="ml-0.5 shrink-0 w-3.5 h-3.5"@@ -78,11 +78,11 @@ const TopKAndScoreThreshold = ({<div className="mb-0.5 flex h-6 items-center"><SwitchclassName="mr-2"- defaultValue={isScoreThresholdEnabled}+ value={isScoreThresholdEnabled ?? false}onChange={onScoreThresholdEnabledChange}disabled={readonly}/>- <div className="system-sm-medium grow truncate text-text-secondary">+ <div className="grow truncate text-text-secondary system-sm-medium">{t('datasetConfig.score_threshold', { ns: 'appDebug' })}</div><Tooltipdiff --git a/web/app/components/workflow/nodes/list-operator/components/limit-config.tsx b/web/app/components/workflow/nodes/list-operator/components/limit-config.tsxindex f3eb3e6985d..964366b325e 100644--- a/web/app/components/workflow/nodes/list-operator/components/limit-config.tsx+++ b/web/app/components/workflow/nodes/list-operator/components/limit-config.tsx@@ -56,7 +56,7 @@ const LimitConfig: FC<Props> = ({title={t(`${i18nPrefix}.limit`, { ns: 'workflow' })}operations={(<Switch- defaultValue={payload.enabled}+ value={payload.enabled}onChange={handleLimitEnabledChange}size="md"disabled={readonly}diff --git a/web/app/components/workflow/nodes/list-operator/panel.tsx b/web/app/components/workflow/nodes/list-operator/panel.tsxindex adfb789b297..e9adff80475 100644--- a/web/app/components/workflow/nodes/list-operator/panel.tsx+++ b/web/app/components/workflow/nodes/list-operator/panel.tsx@@ -65,7 +65,7 @@ const Panel: FC<NodePanelProps<ListFilterNodeType>> = ({title={t(`${i18nPrefix}.filterCondition`, { ns: 'workflow' })}operations={(<Switch- defaultValue={inputs.filter_by?.enabled}+ value={inputs.filter_by?.enabled}onChange={handleFilterEnabledChange}size="md"disabled={readOnly}@@ -90,7 +90,7 @@ const Panel: FC<NodePanelProps<ListFilterNodeType>> = ({title={t(`${i18nPrefix}.extractsCondition`, { ns: 'workflow' })}operations={(<Switch- defaultValue={inputs.extract_by?.enabled}+ value={inputs.extract_by?.enabled}onChange={handleExtractsEnabledChange}size="md"disabled={readOnly}@@ -123,7 +123,7 @@ const Panel: FC<NodePanelProps<ListFilterNodeType>> = ({title={t(`${i18nPrefix}.orderBy`, { ns: 'workflow' })}operations={(<Switch- defaultValue={inputs.order_by?.enabled}+ value={inputs.order_by?.enabled}onChange={handleOrderByEnabledChange}size="md"disabled={readOnly}diff --git a/web/app/components/workflow/nodes/llm/components/json-schema-config-modal/visual-editor/edit-card/required-switch.tsx b/web/app/components/workflow/nodes/llm/components/json-schema-config-modal/visual-editor/edit-card/required-switch.tsxindex e94cf413c39..712ce8f62ea 100644--- a/web/app/components/workflow/nodes/llm/components/json-schema-config-modal/visual-editor/edit-card/required-switch.tsx+++ b/web/app/components/workflow/nodes/llm/components/json-schema-config-modal/visual-editor/edit-card/required-switch.tsx@@ -17,7 +17,7 @@ const RequiredSwitch: FC<RequiredSwitchProps> = ({return (<div className="flex items-center gap-x-1 rounded-[5px] border border-divider-subtle bg-background-default-lighter px-1.5 py-1"><span className="system-2xs-medium-uppercase text-text-secondary">{t('nodes.llm.jsonSchema.required', { ns: 'workflow' })}</span>- <Switch size="xs" defaultValue={defaultValue} onChange={toggleRequired} />+ <Switch size="xs" value={defaultValue} onChange={toggleRequired} /></div>)}diff --git a/web/app/components/workflow/nodes/llm/components/reasoning-format-config.tsx b/web/app/components/workflow/nodes/llm/components/reasoning-format-config.tsxindex 5d4193502e6..7e6ddd02826 100644--- a/web/app/components/workflow/nodes/llm/components/reasoning-format-config.tsx+++ b/web/app/components/workflow/nodes/llm/components/reasoning-format-config.tsx@@ -24,7 +24,7 @@ const ReasoningFormatConfig: FC<ReasoningFormatConfigProps> = ({operations={(// ON = separated, OFF = tagged<Switch- defaultValue={value === 'separated'}+ value={value === 'separated'}onChange={enabled => onChange(enabled ? 'separated' : 'tagged')}size="md"disabled={readonly}diff --git a/web/app/components/workflow/nodes/llm/panel.tsx b/web/app/components/workflow/nodes/llm/panel.tsxindex 7146d9e64a1..5948ee7ac54 100644--- a/web/app/components/workflow/nodes/llm/panel.tsx+++ b/web/app/components/workflow/nodes/llm/panel.tsx@@ -285,7 +285,7 @@ const Panel: FC<NodePanelProps<LLMNodeType>> = ({</Tooltip><SwitchclassName="ml-2"- defaultValue={!!inputs.structured_output_enabled}+ value={!!inputs.structured_output_enabled}onChange={handleStructureOutputEnableChange}size="md"disabled={readOnly}diff --git a/web/app/components/workflow/nodes/parameter-extractor/components/extract-parameter/update.tsx b/web/app/components/workflow/nodes/parameter-extractor/components/extract-parameter/update.tsxindex e24e1e18e16..b3fb0bebbd6 100644--- a/web/app/components/workflow/nodes/parameter-extractor/components/extract-parameter/update.tsx+++ b/web/app/components/workflow/nodes/parameter-extractor/components/extract-parameter/update.tsx@@ -174,7 +174,7 @@ const AddExtractParameter: FC<Props> = ({<Field title={t(`${i18nPrefix}.addExtractParameterContent.required`, { ns: 'workflow' })}><><div className="mb-1.5 text-xs font-normal leading-[18px] text-text-tertiary">{t(`${i18nPrefix}.addExtractParameterContent.requiredContent`, { ns: 'workflow' })}</div>- <Switch size="l" defaultValue={param.required} onChange={handleParamChange('required')} />+ <Switch size="l" value={param.required ?? false} onChange={handleParamChange('required')} /></></Field></div>diff --git a/web/app/components/workflow/nodes/variable-assigner/panel.tsx b/web/app/components/workflow/nodes/variable-assigner/panel.tsxindex 9665e947a15..d7bf571efd4 100644--- a/web/app/components/workflow/nodes/variable-assigner/panel.tsx+++ b/web/app/components/workflow/nodes/variable-assigner/panel.tsx@@ -90,7 +90,7 @@ const Panel: FC<NodePanelProps<VariableAssignerNodeType>> = ({tooltip={t(`${i18nPrefix}.aggregationGroupTip`, { ns: 'workflow' })!}operations={(<Switch- defaultValue={isEnableGroup}+ value={isEnableGroup}onChange={handleGroupEnabledChange}size="md"disabled={readOnly}diff --git a/web/app/components/workflow/note-node/note-editor/toolbar/operator.tsx b/web/app/components/workflow/note-node/note-editor/toolbar/operator.tsxindex 77ba62d926f..321e8a084cc 100644--- a/web/app/components/workflow/note-node/note-editor/toolbar/operator.tsx+++ b/web/app/components/workflow/note-node/note-editor/toolbar/operator.tsx@@ -80,7 +80,7 @@ const Operator = ({<div>{t('nodes.note.editor.showAuthor', { ns: 'workflow' })}</div><Switchsize="l"- defaultValue={showAuthor}+ value={showAuthor}onChange={onShowAuthorChange}/></div>diff --git a/web/app/components/workflow/panel/version-history-panel/filter/filter-switch.tsx b/web/app/components/workflow/panel/version-history-panel/filter/filter-switch.tsxindex e5ed396a250..866e61730be 100644--- a/web/app/components/workflow/panel/version-history-panel/filter/filter-switch.tsx+++ b/web/app/components/workflow/panel/version-history-panel/filter/filter-switch.tsx@@ -21,7 +21,7 @@ const FilterSwitch: FC<FilterSwitchProps> = ({{t('versionHistory.filter.onlyShowNamedVersions', { ns: 'workflow' })}</div><Switch- defaultValue={enabled}+ value={enabled}onChange={v => handleSwitch(v)}size="md"className="shrink-0"diff --git a/web/eslint-suppressions.json b/web/eslint-suppressions.jsonindex c88a3550a0a..8f08836a70a 100644--- a/web/eslint-suppressions.json+++ b/web/eslint-suppressions.json@@ -452,9 +452,6 @@"react-hooks-extra/no-direct-set-state-in-use-effect": {"count": 1},- "tailwindcss/enforce-consistent-class-order": {- "count": 2- },"ts/no-explicit-any": {"count": 5}@@ -803,11 +800,6 @@"count": 1}},- "app/components/app/configuration/dataset-config/params-config/config-content.tsx": {- "tailwindcss/enforce-consistent-class-order": {- "count": 9- }- },"app/components/app/configuration/dataset-config/params-config/index.tsx": {"react-hooks-extra/no-direct-set-state-in-use-effect": {"count": 1@@ -954,11 +946,6 @@"count": 2}},- "app/components/app/configuration/tools/index.tsx": {- "tailwindcss/no-unnecessary-whitespace": {- "count": 1- }- },"app/components/app/create-app-dialog/app-card/index.spec.tsx": {"ts/no-explicit-any": {"count": 1@@ -2758,14 +2745,6 @@"count": 1}},- "app/components/base/switch/index.tsx": {- "react-hooks-extra/no-direct-set-state-in-use-effect": {- "count": 1- },- "tailwindcss/no-unnecessary-whitespace": {- "count": 1- }- },"app/components/base/tab-header/index.tsx": {"tailwindcss/enforce-consistent-class-order": {"count": 1@@ -2927,9 +2906,6 @@"app/components/billing/pricing/plan-switcher/plan-range-switcher.tsx": {"react-refresh/only-export-components": {"count": 1- },- "tailwindcss/enforce-consistent-class-order": {- "count": 1}},"app/components/billing/pricing/plan-switcher/tab.tsx": {@@ -3001,12 +2977,6 @@}},"app/components/custom/custom-web-app-brand/index.tsx": {- "tailwindcss/enforce-consistent-class-order": {- "count": 12- },- "tailwindcss/no-unnecessary-whitespace": {- "count": 1- },"ts/no-explicit-any": {"count": 2}@@ -5034,11 +5004,6 @@"count": 2}},- "app/components/plugins/plugin-detail-panel/tool-selector/components/tool-item.tsx": {- "tailwindcss/enforce-consistent-class-order": {- "count": 2- }- },"app/components/plugins/plugin-detail-panel/tool-selector/components/tool-settings-panel.tsx": {"tailwindcss/enforce-consistent-class-order": {"count": 4@@ -6319,11 +6284,6 @@"count": 1}},- "app/components/workflow/nodes/_base/components/retry/retry-on-panel.tsx": {- "tailwindcss/enforce-consistent-class-order": {- "count": 3- }- },"app/components/workflow/nodes/_base/components/selector.tsx": {"tailwindcss/no-unnecessary-whitespace": {"count": 2@@ -6944,16 +6904,6 @@"count": 1}},- "app/components/workflow/nodes/knowledge-base/components/retrieval-setting/search-method-option.tsx": {- "tailwindcss/enforce-consistent-class-order": {- "count": 2- }- },- "app/components/workflow/nodes/knowledge-base/components/retrieval-setting/top-k-and-score-threshold.tsx": {- "tailwindcss/enforce-consistent-class-order": {- "count": 2- }- },"app/components/workflow/nodes/knowledge-base/components/retrieval-setting/type.ts": {"ts/no-explicit-any": {"count": 2