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
fix: enforce no-leaked-conditional-rendering as error and fix violations (#31262)
byteforge805676810641
diff --git a/web/app/components/app-sidebar/dataset-info/index.tsx b/web/app/components/app-sidebar/dataset-info/index.tsxindex 2d2eeefbb20..ba82099b6cc 100644--- a/web/app/components/app-sidebar/dataset-info/index.tsx+++ b/web/app/components/app-sidebar/dataset-info/index.tsx@@ -71,7 +71,7 @@ const DatasetInfo: FC<DatasetInfoProps> = ({</div><div className="system-2xs-medium-uppercase text-text-tertiary">{isExternalProvider && t('externalTag', { ns: 'dataset' })}- {!isExternalProvider && isPipelinePublished && dataset.doc_form && dataset.indexing_technique && (+ {!!(!isExternalProvider && isPipelinePublished && dataset.doc_form && dataset.indexing_technique) && (<div className="flex items-center gap-x-2"><span>{t(`chunkingMode.${DOC_FORM_TEXT[dataset.doc_form]}`, { ns: 'dataset' })}</span><span>{formatIndexingTechniqueAndMethod(dataset.indexing_technique, dataset.retrieval_model_dict?.search_method)}</span>diff --git a/web/app/components/app-sidebar/dataset-sidebar-dropdown.tsx b/web/app/components/app-sidebar/dataset-sidebar-dropdown.tsxindex 4ba98142555..c81125e973a 100644--- a/web/app/components/app-sidebar/dataset-sidebar-dropdown.tsx+++ b/web/app/components/app-sidebar/dataset-sidebar-dropdown.tsx@@ -114,7 +114,7 @@ const DatasetSidebarDropdown = ({</div><div className="system-2xs-medium-uppercase text-text-tertiary">{isExternalProvider && t('externalTag', { ns: 'dataset' })}- {!isExternalProvider && dataset.doc_form && dataset.indexing_technique && (+ {!!(!isExternalProvider && dataset.doc_form && dataset.indexing_technique) && (<div className="flex items-center gap-x-2"><span>{t(`chunkingMode.${DOC_FORM_TEXT[dataset.doc_form]}`, { ns: 'dataset' })}</span><span>{formatIndexingTechniqueAndMethod(dataset.indexing_technique, dataset.retrieval_model_dict?.search_method)}</span>diff --git a/web/app/components/app/annotation/edit-annotation-modal/index.tsx b/web/app/components/app/annotation/edit-annotation-modal/index.tsxindex b7f7cd16005..2595ec38b2e 100644--- a/web/app/components/app/annotation/edit-annotation-modal/index.tsx+++ b/web/app/components/app/annotation/edit-annotation-modal/index.tsx@@ -144,7 +144,7 @@ const EditAnnotationModal: FC<Props> = ({<MessageCheckRemove /><div>{t('editModal.removeThisCache', { ns: 'appAnnotation' })}</div></div>- {createdAt && (+ {!!createdAt && (<div>{t('editModal.createdAt', { ns: 'appAnnotation' })} diff --git a/web/app/components/app/configuration/base/feature-panel/index.tsx b/web/app/components/app/configuration/base/feature-panel/index.tsxindex 06ae2ab10aa..7f337c1572a 100644--- a/web/app/components/app/configuration/base/feature-panel/index.tsx+++ b/web/app/components/app/configuration/base/feature-panel/index.tsx@@ -28,16 +28,16 @@ const FeaturePanel: FC<IFeaturePanelProps> = ({<div className={cn('px-3 pt-2', hasHeaderBottomBorder && 'border-b border-divider-subtle')} data-testid="feature-panel-header"><div className="flex h-8 items-center justify-between"><div className="flex shrink-0 items-center space-x-1">- {headerIcon && <div className="flex h-6 w-6 items-center justify-center">{headerIcon}</div>}+ {!!headerIcon && <div className="flex h-6 w-6 items-center justify-center">{headerIcon}</div>}<div className="system-sm-semibold text-text-secondary">{title}</div></div><div className="flex items-center gap-2">- {headerRight && <div>{headerRight}</div>}+ {!!headerRight && <div>{headerRight}</div>}</div></div></div>{/* Body */}- {children && (+ {!!children && (<div className={cn(!noBodySpacing && 'mt-1 px-3')} data-testid="feature-panel-body">{children}</div>diff --git a/web/app/components/app/configuration/dataset-config/card-item/index.tsx b/web/app/components/app/configuration/dataset-config/card-item/index.tsxindex 81c2b470ad4..00d3f6d6ade 100644--- a/web/app/components/app/configuration/dataset-config/card-item/index.tsx+++ b/web/app/components/app/configuration/dataset-config/card-item/index.tsx@@ -91,7 +91,7 @@ const Item: FC<ItemProps> = ({</ActionButton></div>{- config.indexing_technique && (+ !!config.indexing_technique && (<BadgeclassName="shrink-0 group-hover:hidden"text={formatIndexingTechniqueAndMethod(config.indexing_technique, config.retrieval_model_dict?.search_method)}diff --git a/web/app/components/app/configuration/dataset-config/select-dataset/index.tsx b/web/app/components/app/configuration/dataset-config/select-dataset/index.tsxindex 36d78920faa..330223f9749 100644--- a/web/app/components/app/configuration/dataset-config/select-dataset/index.tsx+++ b/web/app/components/app/configuration/dataset-config/select-dataset/index.tsx@@ -175,7 +175,7 @@ const SelectDataSet: FC<ISelectDataSetProps> = ({</div>)}{- item.indexing_technique && (+ !!item.indexing_technique && (<BadgeclassName="shrink-0"text={formatIndexingTechniqueAndMethod(item.indexing_technique, item.retrieval_model_dict?.search_method)}diff --git a/web/app/components/app/configuration/dataset-config/settings-modal/index.tsx b/web/app/components/app/configuration/dataset-config/settings-modal/index.tsxindex 32ca4f99cd3..e910702b664 100644--- a/web/app/components/app/configuration/dataset-config/settings-modal/index.tsx+++ b/web/app/components/app/configuration/dataset-config/settings-modal/index.tsx@@ -247,7 +247,7 @@ const SettingsModal: FC<SettingsModalProps> = ({/></div></div>- {currentDataset && currentDataset.indexing_technique && (+ {!!(currentDataset && currentDataset.indexing_technique) && (<div className={cn(rowClass)}><div className={labelClass}><div className="system-sm-semibold text-text-secondary">{t('form.indexMethod', { ns: 'datasetSettings' })}</div>diff --git a/web/app/components/app/configuration/debug/debug-with-single-model/index.spec.tsx b/web/app/components/app/configuration/debug/debug-with-single-model/index.spec.tsxindex b9a1c5ba8bd..08bdd2bfcb2 100644--- a/web/app/components/app/configuration/debug/debug-with-single-model/index.spec.tsx+++ b/web/app/components/app/configuration/debug/debug-with-single-model/index.spec.tsx@@ -465,8 +465,8 @@ vi.mock('@/app/components/base/chat/chat', () => ({</div>))}</div>- {questionIcon && <div data-testid="question-icon">{questionIcon}</div>}- {answerIcon && <div data-testid="answer-icon">{answerIcon}</div>}+ {!!questionIcon && <div data-testid="question-icon">{questionIcon}</div>}+ {!!answerIcon && <div data-testid="answer-icon">{answerIcon}</div>}<textareadata-testid="chat-input"placeholder="Type a message"diff --git a/web/app/components/base/agent-log-modal/tool-call.tsx b/web/app/components/base/agent-log-modal/tool-call.tsxindex d68aac7e956..2385dc2d876 100644--- a/web/app/components/base/agent-log-modal/tool-call.tsx+++ b/web/app/components/base/agent-log-modal/tool-call.tsx@@ -72,7 +72,7 @@ const ToolCallItem: FC<Props> = ({ toolCall, isLLM = false, isFinal, tokens, obs{toolName}</div><div className="shrink-0 text-xs leading-[18px] text-text-tertiary">- {toolCall.time_cost && (+ {!!toolCall.time_cost && (<span>{getTime(toolCall.time_cost || 0)}</span>)}{isLLM && (diff --git a/web/app/components/base/chat/chat/answer/index.tsx b/web/app/components/base/chat/chat/answer/index.tsxindex 7420b84ede7..9f1efa3ae0f 100644--- a/web/app/components/base/chat/chat/answer/index.tsx+++ b/web/app/components/base/chat/chat/answer/index.tsx@@ -212,7 +212,7 @@ const Answer: FC<AnswerProps> = ({)}{- item.siblingCount && item.siblingCount > 1 && item.siblingIndex !== undefined && (+ !!(item.siblingCount && item.siblingCount > 1 && item.siblingIndex !== undefined) && (<ContentSwitchcount={item.siblingCount}currentIndex={item.siblingIndex}diff --git a/web/app/components/base/chat/chat/answer/more.tsx b/web/app/components/base/chat/chat/answer/more.tsxindex 96fd91f212b..c091418cef6 100644--- a/web/app/components/base/chat/chat/answer/more.tsx+++ b/web/app/components/base/chat/chat/answer/more.tsx@@ -29,7 +29,7 @@ const More: FC<MoreProps> = ({>{`${t('detail.tokenCost', { ns: 'appLog' })} ${formatNumber(more.tokens)}`}</div>- {more.tokens_per_second && (+ {!!more.tokens_per_second && (<divclassName="mr-2 max-w-[25%] shrink-0 truncate"title={`${more.tokens_per_second} tokens/s`}diff --git a/web/app/components/base/chat/chat/citation/popup.tsx b/web/app/components/base/chat/chat/citation/popup.tsxindex e033a9fa77c..88d66f28b94 100644--- a/web/app/components/base/chat/chat/citation/popup.tsx+++ b/web/app/components/base/chat/chat/citation/popup.tsx@@ -146,7 +146,7 @@ const Popup: FC<PopupProps> = ({icon={<BezierCurve03 className="mr-1 h-3 w-3" />}/>{- source.score && (+ !!source.score && (<ProgressTooltip data={Number(source.score.toFixed(2))} />)}diff --git a/web/app/components/base/image-uploader/chat-image-uploader.tsx b/web/app/components/base/image-uploader/chat-image-uploader.tsxindex 462352c7d49..44a9d5ce4fc 100644--- a/web/app/components/base/image-uploader/chat-image-uploader.tsx+++ b/web/app/components/base/image-uploader/chat-image-uploader.tsx@@ -90,7 +90,7 @@ const UploaderButton: FC<UploaderButtonProps> = ({<PortalToFollowElemContent className="z-50"><div className="w-[260px] rounded-lg border-[0.5px] border-gray-200 bg-white p-2 shadow-lg"><ImageLinkInput onUpload={handleUpload} disabled={disabled} />- {hasUploadFromLocal && (+ {!!hasUploadFromLocal && (<><div className="mt-2 flex items-center px-2 text-xs font-medium text-gray-400"><div className="mr-3 h-px w-[93px] bg-gradient-to-l from-[#F3F4F6]" />diff --git a/web/app/components/base/input/index.tsx b/web/app/components/base/input/index.tsxindex 27adbb3973a..ae76b71a1c6 100644--- a/web/app/components/base/input/index.tsx+++ b/web/app/components/base/input/index.tsx@@ -109,7 +109,7 @@ const Input = React.forwardRef<HTMLInputElement, InputProps>(({disabled={disabled}{...props}/>- {showClearIcon && value && !disabled && !destructive && (+ {!!(showClearIcon && value && !disabled && !destructive) && (<divclassName={cn('group absolute right-2 top-1/2 -translate-y-1/2 cursor-pointer p-[1px]')}onClick={onClear}diff --git a/web/app/components/base/modal/index.tsx b/web/app/components/base/modal/index.tsxindex e38254b27a3..192fb7b70aa 100644--- a/web/app/components/base/modal/index.tsx+++ b/web/app/components/base/modal/index.tsx@@ -52,7 +52,7 @@ export default function Modal({<div className={cn('flex min-h-full items-center justify-center p-4 text-center', containerClassName)}><TransitionChild><DialogPanel className={cn('relative w-full max-w-[480px] rounded-2xl bg-components-panel-bg p-6 text-left align-middle shadow-xl transition-all', overflowVisible ? 'overflow-visible' : 'overflow-hidden', 'duration-100 ease-in data-[closed]:scale-95 data-[closed]:opacity-0', 'data-[enter]:scale-100 data-[enter]:opacity-100', 'data-[enter]:scale-95 data-[leave]:opacity-0', className)}>- {title && (+ {!!title && (<DialogTitleas="h3"className="title-2xl-semi-bold text-text-primary"@@ -60,7 +60,7 @@ export default function Modal({{title}</DialogTitle>)}- {description && (+ {!!description && (<div className="body-md-regular mt-2 text-text-secondary">{description}</div>diff --git a/web/app/components/base/modal/modal.tsx b/web/app/components/base/modal/modal.tsxindex a24ca1765eb..0061cdf7a0e 100644--- a/web/app/components/base/modal/modal.tsx+++ b/web/app/components/base/modal/modal.tsx@@ -86,7 +86,7 @@ const Modal = ({</div></div>{- children && (+ !!children && (<div className="min-h-0 flex-1 overflow-y-auto px-6 py-3">{children}</div>)}@@ -125,7 +125,7 @@ const Modal = ({</Button></div></div>- {bottomSlot && (+ {!!bottomSlot && (<div className="shrink-0">{bottomSlot}</div>diff --git a/web/app/components/base/radio-card/index.tsx b/web/app/components/base/radio-card/index.tsxindex c349d08a96b..4ed1d45ed0c 100644--- a/web/app/components/base/radio-card/index.tsx+++ b/web/app/components/base/radio-card/index.tsx@@ -56,7 +56,7 @@ const RadioCard: FC<Props> = ({</div>)}</div>- {((isChosen && chosenConfig) || noRadio) && (+ {!!((isChosen && chosenConfig) || noRadio) && (<div className="mt-2 flex gap-x-2"><div className="size-8 shrink-0"></div><div className={cn(chosenConfigWrapClassName, 'grow')}>diff --git a/web/app/components/base/radio/component/radio/index.tsx b/web/app/components/base/radio/component/radio/index.tsxindex 6e278f66e39..34226f0390a 100644--- a/web/app/components/base/radio/component/radio/index.tsx+++ b/web/app/components/base/radio/component/radio/index.tsx@@ -52,7 +52,7 @@ export default function Radio({)}onClick={() => handleChange(value)}>- {children && (+ {!!children && (<labelclassName={cn(labelClassName, 'cursor-pointer text-sm')diff --git a/web/app/components/base/segmented-control/index.tsx b/web/app/components/base/segmented-control/index.tsxindex 89a15a1f651..1f6bd4073f3 100644--- a/web/app/components/base/segmented-control/index.tsx+++ b/web/app/components/base/segmented-control/index.tsx@@ -130,7 +130,7 @@ export const SegmentedControl = <T extends string | number | symbol>({{text && (<div className={cn('inline-flex items-center gap-x-1', ItemTextWrapperVariants({ size }))}><span>{text}</span>- {count && size === 'large' && (+ {!!(count && size === 'large') && (<div className="system-2xs-medium-uppercase inline-flex h-[18px] min-w-[18px] items-center justify-center rounded-[5px] border border-divider-deep bg-components-badge-bg-dimm px-[5px] text-text-tertiary">{count}</div>diff --git a/web/app/components/base/select/index.tsx b/web/app/components/base/select/index.tsxindex b2cdcee7fc5..ac59894771a 100644--- a/web/app/components/base/select/index.tsx+++ b/web/app/components/base/select/index.tsx@@ -379,7 +379,7 @@ const PortalSelect: FC<PortalSelectProps> = ({{selectedItem?.name ?? localPlaceholder}</span><div className="mx-0.5">- {installedValue && selectedItem && selectedItem.value !== installedValue && (+ {!!(installedValue && selectedItem && selectedItem.value !== installedValue) && (<Badge>{installedValue}{' '}diff --git a/web/app/components/base/toast/index.tsx b/web/app/components/base/toast/index.tsxindex 0ab636efc18..1b9ae4eedb7 100644--- a/web/app/components/base/toast/index.tsx+++ b/web/app/components/base/toast/index.tsx@@ -80,7 +80,7 @@ const Toast = ({<div className="system-sm-semibold text-text-primary [word-break:break-word]">{message}</div>{customComponent}</div>- {children && (+ {!!children && (<div className="system-xs-regular text-text-secondary">{children}</div>diff --git a/web/app/components/base/tooltip/content.tsx b/web/app/components/base/tooltip/content.tsxindex ee52c838690..1879e077e55 100644--- a/web/app/components/base/tooltip/content.tsx+++ b/web/app/components/base/tooltip/content.tsx@@ -12,11 +12,11 @@ export const ToolTipContent: FC<ToolTipContentProps> = ({}) => {return (<div className="w-[180px]">- {title && (+ {!!title && (<div className="mb-1.5 font-semibold text-text-secondary">{title}</div>)}<div className="mb-1.5 text-text-tertiary">{children}</div>- {action && <div className="cursor-pointer text-text-accent">{action}</div>}+ {!!action && <div className="cursor-pointer text-text-accent">{action}</div>}</div>)}diff --git a/web/app/components/base/tooltip/index.tsx b/web/app/components/base/tooltip/index.tsxindex 3bd379b3185..ee9928745db 100644--- a/web/app/components/base/tooltip/index.tsx+++ b/web/app/components/base/tooltip/index.tsx@@ -109,7 +109,7 @@ const Tooltip: FC<TooltipProps> = ({<PortalToFollowElemContentclassName={cn('z-[9999]', portalContentClassName || '')}>- {popupContent && (+ {!!popupContent && (<divclassName={cn(!noDecoration && 'system-xs-regular relative max-w-[300px] break-words rounded-md bg-components-panel-bg px-3 py-2 text-left text-text-tertiary shadow-lg',diff --git a/web/app/components/datasets/create/step-two/components/option-card.tsx b/web/app/components/datasets/create/step-two/components/option-card.tsxindex 666ae43df9d..55cbf5276f9 100644--- a/web/app/components/datasets/create/step-two/components/option-card.tsx+++ b/web/app/components/datasets/create/step-two/components/option-card.tsx@@ -87,10 +87,10 @@ export const OptionCard: FC<OptionCardProps> = (disabled={disabled}/>{/** Body */}- {isActive && (children || actions) && (+ {!!(isActive && (children || actions)) && (<div className="rounded-b-xl bg-components-panel-bg px-4 py-3">{children}- {actions && (+ {!!actions && (<div className="mt-4 flex gap-2">{actions}</div>diff --git a/web/app/components/datasets/documents/components/list.tsx b/web/app/components/datasets/documents/components/list.tsxindex 0c78da113bb..01d4afb6460 100644--- a/web/app/components/datasets/documents/components/list.tsx+++ b/web/app/components/datasets/documents/components/list.tsx@@ -508,7 +508,7 @@ const DocumentList: FC<IDocumentListProps> = ({/>)}{/* Show Pagination only if the total is more than the limit */}- {pagination.total && (+ {!!pagination.total && (<Pagination{...pagination}className="w-full shrink-0"diff --git a/web/app/components/datasets/documents/create-from-pipeline/processing/embedding-process/rule-detail.spec.tsx b/web/app/components/datasets/documents/create-from-pipeline/processing/embedding-process/rule-detail.spec.tsxindex c375d7a2e29..33b162d4502 100644--- a/web/app/components/datasets/documents/create-from-pipeline/processing/embedding-process/rule-detail.spec.tsx+++ b/web/app/components/datasets/documents/create-from-pipeline/processing/embedding-process/rule-detail.spec.tsx@@ -24,7 +24,7 @@ vi.mock('@/app/components/datasets/documents/detail/metadata', () => ({<div data-testid="field-info" data-label={label}><span data-testid="field-label">{label}</span><span data-testid="field-value">{displayedValue}</span>- {valueIcon && <span data-testid="field-icon">{valueIcon}</span>}+ {!!valueIcon && <span data-testid="field-icon">{valueIcon}</span>}</div>),}))diff --git a/web/app/components/datasets/list/dataset-card/components/dataset-card-header.tsx b/web/app/components/datasets/list/dataset-card/components/dataset-card-header.tsxindex abe7595e142..89951ce3b7d 100644--- a/web/app/components/datasets/list/dataset-card/components/dataset-card-header.tsx+++ b/web/app/components/datasets/list/dataset-card/components/dataset-card-header.tsx@@ -49,7 +49,7 @@ const DocModeInfo = ({return (<div className="system-2xs-medium-uppercase flex items-center gap-x-3 text-text-tertiary">- {dataset.doc_form && (+ {!!dataset.doc_form && (<spanclassName="min-w-0 max-w-full truncate"title={t(`chunkingMode.${DOC_FORM_TEXT[dataset.doc_form]}`, { ns: 'dataset' })}diff --git a/web/app/components/datasets/metadata/metadata-dataset/create-content.spec.tsx b/web/app/components/datasets/metadata/metadata-dataset/create-content.spec.tsxindex 4931ab4ebc9..fd064bc9287 100644--- a/web/app/components/datasets/metadata/metadata-dataset/create-content.spec.tsx+++ b/web/app/components/datasets/metadata/metadata-dataset/create-content.spec.tsx@@ -27,7 +27,7 @@ vi.mock('../../../base/modal-like-wrap', () => ({default: ({ children, title, onClose, onConfirm, beforeHeader }: ModalLikeWrapProps) => (<div data-testid="modal-wrap"><div data-testid="modal-title">{title}</div>- {beforeHeader && <div data-testid="before-header">{beforeHeader}</div>}+ {!!beforeHeader && <div data-testid="before-header">{beforeHeader}</div>}<div data-testid="modal-content">{children}</div><button data-testid="close-btn" onClick={onClose}>Close</button><button data-testid="confirm-btn" onClick={onConfirm}>Confirm</button>diff --git a/web/app/components/datasets/settings/form/index.tsx b/web/app/components/datasets/settings/form/index.tsxindex 6081a36fcc8..5fbaefade79 100644--- a/web/app/components/datasets/settings/form/index.tsx+++ b/web/app/components/datasets/settings/form/index.tsx@@ -265,7 +265,7 @@ const Form = () => {</div></div>{- currentDataset?.doc_form && (+ !!currentDataset?.doc_form && (<><Dividertype="horizontal"@@ -298,13 +298,13 @@ const Form = () => {</>)}- {(isShowIndexMethod || indexMethod === 'high_quality') && (+ {!!(isShowIndexMethod || indexMethod === 'high_quality') && (<Dividertype="horizontal"className="my-1 h-px bg-divider-subtle"/>)}- {isShowIndexMethod && (+ {!!isShowIndexMethod && (<div className={rowClass}><div className={labelClass}><div className="system-sm-semibold text-text-secondary">{t('form.indexMethod', { ns: 'datasetSettings' })}</div>diff --git a/web/app/components/datasets/settings/option-card.tsx b/web/app/components/datasets/settings/option-card.tsxindex 67d7b28a8f6..d40a72ca448 100644--- a/web/app/components/datasets/settings/option-card.tsx+++ b/web/app/components/datasets/settings/option-card.tsx@@ -77,7 +77,7 @@ const OptionCard = <T,>({)}{- icon && (+ !!icon && (<div className={cn('flex size-6 shrink-0 items-center justify-center text-text-tertiary',isActive && iconActiveColor,@@ -110,7 +110,7 @@ const OptionCard = <T,>({</div></div>{- children && showChildren && (+ !!(children && showChildren) && (<div className="relative rounded-b-xl bg-components-panel-bg p-4"><ArrowShape className="absolute left-[14px] top-[-11px] size-4 text-components-panel-bg" />{children}diff --git a/web/app/components/header/account-setting/model-provider-page/model-name/index.tsx b/web/app/components/header/account-setting/model-provider-page/model-name/index.tsxindex b7cca82bc0b..bf6c10aeeb0 100644--- a/web/app/components/header/account-setting/model-provider-page/model-name/index.tsx+++ b/web/app/components/header/account-setting/model-provider-page/model-name/index.tsx@@ -48,21 +48,21 @@ const ModelName: FC<ModelNameProps> = ({</div><div className="flex items-center gap-0.5">{- showModelType && modelItem.model_type && (+ !!(showModelType && modelItem.model_type) && (<ModelBadge className={modelTypeClassName}>{modelTypeFormat(modelItem.model_type)}</ModelBadge>)}{- modelItem.model_properties.mode && showMode && (+ !!(modelItem.model_properties.mode && showMode) && (<ModelBadge className={modeClassName}>{(modelItem.model_properties.mode as string).toLocaleUpperCase()}</ModelBadge>)}{- showContextSize && modelItem.model_properties.context_size && (+ !!(showContextSize && modelItem.model_properties.context_size) && (<ModelBadge>{sizeFormat(modelItem.model_properties.context_size as number)}</ModelBadge>diff --git a/web/app/components/header/account-setting/model-provider-page/model-selector/popup-item.tsx b/web/app/components/header/account-setting/model-provider-page/model-selector/popup-item.tsxindex bfa6f8d8679..56c589e7bdf 100644--- a/web/app/components/header/account-setting/model-provider-page/model-selector/popup-item.tsx+++ b/web/app/components/header/account-setting/model-provider-page/model-selector/popup-item.tsx@@ -96,17 +96,17 @@ const PopupItem: FC<PopupItemProps> = ({<div className='text-text-tertiary system-xs-regular'>{currentProvider?.description?.[language] || currentProvider?.description?.en_US}</div>)} */}<div className="flex flex-wrap gap-1">- {modelItem.model_type && (+ {!!modelItem.model_type && (<ModelBadge>{modelTypeFormat(modelItem.model_type)}</ModelBadge>)}- {modelItem.model_properties.mode && (+ {!!modelItem.model_properties.mode && (<ModelBadge>{(modelItem.model_properties.mode as string).toLocaleUpperCase()}</ModelBadge>)}- {modelItem.model_properties.context_size && (+ {!!modelItem.model_properties.context_size && (<ModelBadge>{sizeFormat(modelItem.model_properties.context_size as number)}</ModelBadge>diff --git a/web/app/components/plugins/card/index.spec.tsx b/web/app/components/plugins/card/index.spec.tsxindex 8dd7e67d69c..e9a4e624c34 100644--- a/web/app/components/plugins/card/index.spec.tsx+++ b/web/app/components/plugins/card/index.spec.tsx@@ -81,7 +81,7 @@ vi.mock('@/app/components/base/app-icon', () => ({data-size={size}data-icon-type={iconType}>- {innerIcon && <div data-testid="inner-icon">{innerIcon}</div>}+ {!!innerIcon && <div data-testid="inner-icon">{innerIcon}</div>}</div>),}))diff --git a/web/app/components/plugins/card/index.tsx b/web/app/components/plugins/card/index.tsxindex 85784211167..0fc5e37241f 100644--- a/web/app/components/plugins/card/index.tsx+++ b/web/app/components/plugins/card/index.tsx@@ -95,7 +95,7 @@ const Card = ({text={getLocalizedText(brief)}descriptionLineRows={descriptionLineRows}/>- {footer && <div>{footer}</div>}+ {!!footer && <div>{footer}</div>}</div>{limitedInstall&& (diff --git a/web/app/components/plugins/install-plugin/install-from-github/steps/loaded.spec.tsx b/web/app/components/plugins/install-plugin/install-from-github/steps/loaded.spec.tsxindex a8411fcc065..3c70c35dc7c 100644--- a/web/app/components/plugins/install-plugin/install-from-github/steps/loaded.spec.tsx+++ b/web/app/components/plugins/install-plugin/install-from-github/steps/loaded.spec.tsx@@ -32,7 +32,7 @@ vi.mock('../../../card', () => ({default: ({ payload, titleLeft }: { payload: Plugin, titleLeft?: React.ReactNode }) => (<div data-testid="plugin-card"><span data-testid="card-name">{payload.name}</span>- {titleLeft && <span data-testid="title-left">{titleLeft}</span>}+ {!!titleLeft && <span data-testid="title-left">{titleLeft}</span>}</div>),}))diff --git a/web/app/components/plugins/install-plugin/install-from-marketplace/steps/install.spec.tsx b/web/app/components/plugins/install-plugin/install-from-marketplace/steps/install.spec.tsxindex 6727a431b42..b283f0ebe81 100644--- a/web/app/components/plugins/install-plugin/install-from-marketplace/steps/install.spec.tsx+++ b/web/app/components/plugins/install-plugin/install-from-marketplace/steps/install.spec.tsx@@ -118,7 +118,7 @@ vi.mock('../../../card', () => ({<div data-testid="plugin-card"><span data-testid="card-payload-name">{payload?.name}</span><span data-testid="card-limited-install">{limitedInstall ? 'true' : 'false'}</span>- {titleLeft && <div data-testid="card-title-left">{titleLeft}</div>}+ {!!titleLeft && <div data-testid="card-title-left">{titleLeft}</div>}</div>),}))diff --git a/web/app/components/plugins/marketplace/index.spec.tsx b/web/app/components/plugins/marketplace/index.spec.tsxindex dc2513ac054..654b667deb3 100644--- a/web/app/components/plugins/marketplace/index.spec.tsx+++ b/web/app/components/plugins/marketplace/index.spec.tsx@@ -279,7 +279,7 @@ vi.mock('@/app/components/plugins/card', () => ({default: ({ payload, footer }: { payload: Plugin, footer?: React.ReactNode }) => (<div data-testid={`card-${payload.name}`}><div data-testid="card-name">{payload.name}</div>- {footer && <div data-testid="card-footer">{footer}</div>}+ {!!footer && <div data-testid="card-footer">{footer}</div>}</div>),}))diff --git a/web/app/components/plugins/marketplace/list/index.spec.tsx b/web/app/components/plugins/marketplace/list/index.spec.tsxindex 81616f5958a..31419030a48 100644--- a/web/app/components/plugins/marketplace/list/index.spec.tsx+++ b/web/app/components/plugins/marketplace/list/index.spec.tsx@@ -126,7 +126,7 @@ vi.mock('@/app/components/plugins/card', () => ({<div data-testid={`card-${payload.name}`}><div data-testid="card-name">{payload.name}</div><div data-testid="card-label">{payload.label?.['en-US'] || payload.name}</div>- {footer && <div data-testid="card-footer">{footer}</div>}+ {!!footer && <div data-testid="card-footer">{footer}</div>}</div>),}))diff --git a/web/app/components/plugins/plugin-detail-panel/detail-header.tsx b/web/app/components/plugins/plugin-detail-panel/detail-header.tsxindex 9b83e388774..7f7e11ad510 100644--- a/web/app/components/plugins/plugin-detail-panel/detail-header.tsx+++ b/web/app/components/plugins/plugin-detail-panel/detail-header.tsx@@ -229,7 +229,7 @@ const DetailHeader = ({<div className="flex h-5 items-center"><Title title={label[locale]} />{verified && !isReadmeView && <Verified className="ml-0.5 h-4 w-4" text={t('marketplace.verifiedTip', { ns: 'plugin' })} />}- {version && (+ {!!version && (<PluginVersionPickerdisabled={!isFromMarketplace || isReadmeView}isShow={isShow}@@ -297,7 +297,7 @@ const DetailHeader = ({orgName={author}packageName={name?.includes('/') ? (name.split('/').pop() || '') : name}/>- {source && (+ {!!source && (<><div className="system-xs-regular ml-1 mr-0.5 text-text-quaternary">·</div>{source === PluginSource.marketplace && (diff --git a/web/app/components/plugins/plugin-detail-panel/subscription-list/edit/index.spec.tsx b/web/app/components/plugins/plugin-detail-panel/subscription-list/edit/index.spec.tsxindex b7988c916b8..a6162967f06 100644--- a/web/app/components/plugins/plugin-detail-panel/subscription-list/edit/index.spec.tsx+++ b/web/app/components/plugins/plugin-detail-panel/subscription-list/edit/index.spec.tsx@@ -196,7 +196,7 @@ vi.mock('@/app/components/base/modal/modal', () => ({{extraButtonText}</button>)}- {bottomSlot && <div data-testid="modal-bottom-slot">{bottomSlot}</div>}+ {!!bottomSlot && <div data-testid="modal-bottom-slot">{bottomSlot}</div>}</div>),}))diff --git a/web/app/components/plugins/plugin-mutation-model/index.spec.tsx b/web/app/components/plugins/plugin-mutation-model/index.spec.tsxindex 95c9db3c977..98be2e4373a 100644--- a/web/app/components/plugins/plugin-mutation-model/index.spec.tsx+++ b/web/app/components/plugins/plugin-mutation-model/index.spec.tsx@@ -78,7 +78,7 @@ vi.mock('@/app/components/base/app-icon', () => ({data-size={size}data-icon-type={iconType}>- {innerIcon && <div data-testid="inner-icon">{innerIcon}</div>}+ {!!innerIcon && <div data-testid="inner-icon">{innerIcon}</div>}</div>),}))diff --git a/web/app/components/tools/provider/empty.tsx b/web/app/components/tools/provider/empty.tsxindex 4940dd6fc54..3b9748dc27b 100644--- a/web/app/components/tools/provider/empty.tsx+++ b/web/app/components/tools/provider/empty.tsx@@ -41,7 +41,7 @@ const Empty = ({<div className="mb-1 mt-2 text-[13px] font-medium leading-[18px] text-text-primary">{(hasTitle && renderType) ? t(`addToolModal.${renderType}.title`, { ns: 'tools' }) : 'No tools available'}</div>- {(!isAgent && hasTitle && renderType) && (+ {!!(!isAgent && hasTitle && renderType) && (<Comp className={cn('flex items-center text-[13px] leading-[18px] text-text-tertiary', hasLink && 'cursor-pointer hover:text-text-accent')} {...linkProps}>{t(`addToolModal.${renderType}.tip`, { ns: 'tools' })}{' '}diff --git a/web/app/components/workflow/nodes/_base/components/editor/base.tsx b/web/app/components/workflow/nodes/_base/components/editor/base.tsxindex 3d5ca5f78a2..6ed582369cb 100644--- a/web/app/components/workflow/nodes/_base/components/editor/base.tsx+++ b/web/app/components/workflow/nodes/_base/components/editor/base.tsx@@ -95,7 +95,7 @@ const Base: FC<Props> = ({}}>{headerRight}- {showCodeGenerator && codeLanguages && (+ {!!(showCodeGenerator && codeLanguages) && (<div className="ml-1"><CodeGeneratorButtononGenerated={onGenerated}@@ -119,7 +119,7 @@ const Base: FC<Props> = ({</div></div></div>- {tip && <div className="px-1 py-0.5">{tip}</div>}+ {!!tip && <div className="px-1 py-0.5">{tip}</div>}<PromptEditorHeightResizeWrapheight={isExpand ? editorExpandHeight : editorContentHeight}minHeight={editorContentMinHeight}diff --git a/web/app/components/workflow/nodes/_base/components/field.tsx b/web/app/components/workflow/nodes/_base/components/field.tsxindex 93fd331f947..948dcb603c2 100644--- a/web/app/components/workflow/nodes/_base/components/field.tsx+++ b/web/app/components/workflow/nodes/_base/components/field.tsx@@ -46,7 +46,7 @@ const Field: FC<Props> = ({{' '}{required && <span className="text-text-destructive">*</span>}</div>- {tooltip && (+ {!!tooltip && (<TooltippopupContent={tooltip}popupClassName="ml-1"@@ -55,13 +55,13 @@ const Field: FC<Props> = ({)}</div><div className="flex">- {operations && <div>{operations}</div>}+ {!!operations && <div>{operations}</div>}{supportFold && (<RiArrowDownSLine className="h-4 w-4 cursor-pointer text-text-tertiary transition-transform" style={{ transform: fold ? 'rotate(-90deg)' : 'rotate(0deg)' }} />)}</div></div>- {children && (!supportFold || (supportFold && !fold)) && <div className={cn(!inline && 'mt-1')}>{children}</div>}+ {!!(children && (!supportFold || (supportFold && !fold))) && <div className={cn(!inline && 'mt-1')}>{children}</div>}</div>)}diff --git a/web/app/components/workflow/nodes/_base/components/prompt/editor.tsx b/web/app/components/workflow/nodes/_base/components/prompt/editor.tsxindex 0004a9688b7..627d473a108 100644--- a/web/app/components/workflow/nodes/_base/components/prompt/editor.tsx+++ b/web/app/components/workflow/nodes/_base/components/prompt/editor.tsx@@ -165,7 +165,7 @@ const Editor: FC<Props> = ({{' '}{required && <span className="text-text-destructive">*</span>}</div>- {titleTooltip && <Tooltip popupContent={titleTooltip} />}+ {!!titleTooltip && <Tooltip popupContent={titleTooltip} />}</div><div className="flex items-center"><div className="text-xs font-medium leading-[18px] text-text-tertiary">{value?.length || 0}</div>diff --git a/web/app/components/workflow/nodes/_base/components/variable/variable-label/base/variable-label.tsx b/web/app/components/workflow/nodes/_base/components/variable/variable-label/base/variable-label.tsxindex 55d6a14d371..032746ad5bd 100644--- a/web/app/components/workflow/nodes/_base/components/variable/variable-label/base/variable-label.tsx+++ b/web/app/components/workflow/nodes/_base/components/variable/variable-label/base/variable-label.tsx@@ -61,7 +61,7 @@ const VariableLabel = ({notShowFullPath={notShowFullPath}/>{- variableType && (+ !!variableType && (<div className="system-xs-regular shrink-0 text-text-tertiary">{capitalize(variableType)}</div>diff --git a/web/app/components/workflow/nodes/_base/node.tsx b/web/app/components/workflow/nodes/_base/node.tsxindex d2cc8195e4e..47f5028054c 100644--- a/web/app/components/workflow/nodes/_base/node.tsx+++ b/web/app/components/workflow/nodes/_base/node.tsx@@ -275,7 +275,7 @@ const BaseNode: FC<BaseNodeProps> = ({}</div>{- data._iterationLength && data._iterationIndex && data._runningStatus === NodeRunningStatus.Running && (+ !!(data._iterationLength && data._iterationIndex && data._runningStatus === NodeRunningStatus.Running) && (<div className="mr-1.5 text-xs font-medium text-text-accent">{data._iterationIndex > data._iterationLength ? data._iterationLength : data._iterationIndex}/@@ -284,7 +284,7 @@ const BaseNode: FC<BaseNodeProps> = ({)}{- data.type === BlockEnum.Loop && data._loopIndex && LoopIndex+ !!(data.type === BlockEnum.Loop && data._loopIndex) && LoopIndex}{isLoading@@ -327,7 +327,7 @@ const BaseNode: FC<BaseNodeProps> = ({)}{- data.desc && data.type !== BlockEnum.Iteration && data.type !== BlockEnum.Loop && (+ !!(data.desc && data.type !== BlockEnum.Iteration && data.type !== BlockEnum.Loop) && (<div className="system-xs-regular whitespace-pre-line break-words px-3 pb-2 pt-1 text-text-tertiary">{data.desc}</div>diff --git a/web/app/components/workflow/nodes/assigner/components/var-list/index.tsx b/web/app/components/workflow/nodes/assigner/components/var-list/index.tsxindex 202d7469aa6..36ef1685771 100644--- a/web/app/components/workflow/nodes/assigner/components/var-list/index.tsx+++ b/web/app/components/workflow/nodes/assigner/components/var-list/index.tsx@@ -178,7 +178,7 @@ const VarList: FC<Props> = ({className="w-full"/>)}- {item.operation === WriteMode.set && assignedVarType && (+ {!!(item.operation === WriteMode.set && assignedVarType) && (<>{assignedVarType === 'number' && (<Inputdiff --git a/web/app/components/workflow/nodes/assigner/node.tsx b/web/app/components/workflow/nodes/assigner/node.tsxindex f429c4a957d..a933f570500 100644--- a/web/app/components/workflow/nodes/assigner/node.tsx+++ b/web/app/components/workflow/nodes/assigner/node.tsx@@ -51,7 +51,7 @@ const NodeComponent: FC<NodeProps<AssignerNodeType>> = ({nodeType={node?.data.type}nodeTitle={node?.data.title}rightSlot={- value.operation && <Badge className="!ml-auto shrink-0" text={t(`${i18nPrefix}.operations.${value.operation}`, { ns: 'workflow' })} />+ !!value.operation && <Badge className="!ml-auto shrink-0" text={t(`${i18nPrefix}.operations.${value.operation}`, { ns: 'workflow' })} />}/>)diff --git a/web/app/components/workflow/nodes/knowledge-base/components/chunk-structure/index.tsx b/web/app/components/workflow/nodes/knowledge-base/components/chunk-structure/index.tsxindex a62831fa559..f246194d052 100644--- a/web/app/components/workflow/nodes/knowledge-base/components/chunk-structure/index.tsx+++ b/web/app/components/workflow/nodes/knowledge-base/components/chunk-structure/index.tsx@@ -41,7 +41,7 @@ const ChunkStructure = ({}}>{- chunkStructure && (+ !!chunkStructure && (<OptionCard{...optionMap[chunkStructure]}selectedId={chunkStructure}diff --git a/web/app/components/workflow/nodes/knowledge-base/components/option-card.tsx b/web/app/components/workflow/nodes/knowledge-base/components/option-card.tsxindex 93e92a10277..7a38dc0bc47 100644--- a/web/app/components/workflow/nodes/knowledge-base/components/option-card.tsx+++ b/web/app/components/workflow/nodes/knowledge-base/components/option-card.tsx@@ -100,7 +100,7 @@ const OptionCard = memo(({>{effectElement}{- icon && (+ !!icon && (<div className="mr-1 flex h-[18px] w-[18px] shrink-0 items-center justify-center">{typeof icon === 'function' ? icon(isActive) : icon}</div>@@ -139,7 +139,7 @@ const OptionCard = memo(({</div></div>{- children && isActive && (+ !!(children && isActive) && (<div className="relative rounded-b-xl bg-components-panel-bg p-3"><ArrowShape className="absolute left-[14px] top-[-11px] h-4 w-4 text-components-panel-bg" />{children}diff --git a/web/app/components/workflow/nodes/knowledge-base/panel.tsx b/web/app/components/workflow/nodes/knowledge-base/panel.tsxindex f32278fc227..ec99145d860 100644--- a/web/app/components/workflow/nodes/knowledge-base/panel.tsx+++ b/web/app/components/workflow/nodes/knowledge-base/panel.tsx@@ -118,7 +118,7 @@ const Panel: FC<NodePanelProps<KnowledgeBaseNodeType>> = ({/></Group>{- data.chunk_structure && (+ !!data.chunk_structure && (<><BoxGroupFieldboxGroupProps={{diff --git a/web/app/components/workflow/nodes/knowledge-retrieval/components/dataset-item.tsx b/web/app/components/workflow/nodes/knowledge-retrieval/components/dataset-item.tsxindex 9a5a44453f9..c865a49ba92 100644--- a/web/app/components/workflow/nodes/knowledge-retrieval/components/dataset-item.tsx+++ b/web/app/components/workflow/nodes/knowledge-retrieval/components/dataset-item.tsx@@ -110,7 +110,7 @@ const DatasetItem: FC<Props> = ({</div>)}{- payload.indexing_technique && (+ !!payload.indexing_technique && (<BadgeclassName="shrink-0 group-hover/dataset-item:hidden"text={formatIndexingTechniqueAndMethod(payload.indexing_technique, payload.retrieval_model_dict?.search_method)}diff --git a/web/app/components/workflow/nodes/knowledge-retrieval/components/metadata/condition-list/condition-date.tsx b/web/app/components/workflow/nodes/knowledge-retrieval/components/metadata/condition-list/condition-date.tsxindex caf092681c4..b34093b7b09 100644--- a/web/app/components/workflow/nodes/knowledge-retrieval/components/metadata/condition-list/condition-date.tsx+++ b/web/app/components/workflow/nodes/knowledge-retrieval/components/metadata/condition-list/condition-date.tsx@@ -46,7 +46,7 @@ const ConditionDate = ({}</div>{- value && (+ !!value && (<RiCloseCircleFillclassName={cn('hidden h-4 w-4 shrink-0 cursor-pointer hover:text-components-input-text-filled group-hover:block',diff --git a/web/app/components/workflow/nodes/llm/components/config-prompt-item.tsx b/web/app/components/workflow/nodes/llm/components/config-prompt-item.tsxindex 118e3a7c0a1..f8916d3785a 100644--- a/web/app/components/workflow/nodes/llm/components/config-prompt-item.tsx+++ b/web/app/components/workflow/nodes/llm/components/config-prompt-item.tsx@@ -121,7 +121,7 @@ const ConfigPromptItem: FC<Props> = ({<TooltippopupContent={- <div className="max-w-[180px]">{payload.role && t(`${i18nPrefix}.roleDescription.${payload.role}`, { ns: 'workflow' })}</div>+ <div className="max-w-[180px]">{!!payload.role && t(`${i18nPrefix}.roleDescription.${payload.role}`, { ns: 'workflow' })}</div>}triggerClassName="w-4 h-4"/>diff --git a/web/app/components/workflow/nodes/loop/components/condition-list/index.tsx b/web/app/components/workflow/nodes/loop/components/condition-list/index.tsxindex 4c70d9073c9..8fca606f583 100644--- a/web/app/components/workflow/nodes/loop/components/condition-list/index.tsx+++ b/web/app/components/workflow/nodes/loop/components/condition-list/index.tsx@@ -86,7 +86,7 @@ const ConditionList = ({className="absolute right-1 top-1/2 flex h-[21px] -translate-y-1/2 cursor-pointer select-none items-center rounded-md border-[0.5px] border-components-button-secondary-border bg-components-button-secondary-bg px-1 text-[10px] font-semibold text-text-accent-secondary shadow-xs"onClick={() => doToggleConditionLogicalOperator(conditionId)}>- {logicalOperator && logicalOperator.toUpperCase()}+ {!!logicalOperator && logicalOperator.toUpperCase()}<RiLoopLeftLine className="ml-0.5 h-3 w-3" /></div></div>diff --git a/web/app/components/workflow/panel/debug-and-preview/conversation-variable-modal.tsx b/web/app/components/workflow/panel/debug-and-preview/conversation-variable-modal.tsxindex 0f6a4c081d4..34cc3695316 100644--- a/web/app/components/workflow/panel/debug-and-preview/conversation-variable-modal.tsx+++ b/web/app/components/workflow/panel/debug-and-preview/conversation-variable-modal.tsx@@ -115,7 +115,7 @@ const ConversationVariableModal = ({}}></div>- {latestValueTimestampMap[currentVar.id] && (+ {!!latestValueTimestampMap[currentVar.id] && (<div className="system-xs-regular shrink-0 text-text-tertiary">{t('chatVariable.updatedAt', { ns: 'workflow' })}{formatTime(latestValueTimestampMap[currentVar.id], t('dateTimeFormat', { ns: 'appLog' }) as string)}diff --git a/web/app/components/workflow/run/agent-log/agent-log-item.tsx b/web/app/components/workflow/run/agent-log/agent-log-item.tsxindex 3e67f2a1b15..2fe5f859d97 100644--- a/web/app/components/workflow/run/agent-log/agent-log-item.tsx+++ b/web/app/components/workflow/run/agent-log/agent-log-item.tsx@@ -79,7 +79,7 @@ const AgentLogItem = ({{label}</div>{- metadata?.elapsed_time && (+ !!metadata?.elapsed_time && (<div className="system-xs-regular mr-2 shrink-0 text-text-tertiary">{metadata?.elapsed_time?.toFixed(3)}sdiff --git a/web/tsslint.config.ts b/web/tsslint.config.tsindex 10c427638bd..1a0406d7d87 100644--- a/web/tsslint.config.ts+++ b/web/tsslint.config.ts@@ -5,7 +5,7 @@ import { defineConfig, importESLintRules } from '@tsslint/config'export default defineConfig({rules: {...await importESLintRules({- 'react-x/no-leaked-conditional-rendering': 'warn',+ 'react-x/no-leaked-conditional-rendering': 'error',}),},})