Skip to content

armgit / dify

Public Imported from GitHub
0

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

fix: rendering errors occur when displaying hit test results in full text search (#12191)

Hiroshi Fujita716bb8574d60
diff --git a/web/app/components/datasets/hit-testing/components/score.tsx b/web/app/components/datasets/hit-testing/components/score.tsx
index 115141eaaa0..175b00b7e7f 100644
--- a/web/app/components/datasets/hit-testing/components/score.tsx
+++ b/web/app/components/datasets/hit-testing/components/score.tsx
@@ -4,7 +4,7 @@ import React from 'react'
import cn from '@/utils/classnames'
type Props = {
- value: number
+ value: number | null
besideChunkName?: boolean
}
@@ -12,6 +12,9 @@ const Score: FC<Props> = ({
value,
besideChunkName,
}) => {
+ if (!value)
+ return null
+
return (
<div className={cn('relative items-center px-[5px] border border-components-progress-bar-border overflow-hidden', besideChunkName ? 'border-l-0 h-[20.5px]' : 'h-[20px] rounded-md')}>
<div className={cn('absolute top-0 left-0 h-full bg-util-colors-blue-brand-blue-brand-100 border-r-[1.5px] border-components-progress-brand-progress', value === 1 && 'border-r-0')} style={{ width: `${value * 100}%` }} />