diff --git a/web/app/components/datasets/hit-testing/components/result-item.tsx b/web/app/components/datasets/hit-testing/components/result-item.tsx index 9da7206601..e1e51bfbe9 100644 --- a/web/app/components/datasets/hit-testing/components/result-item.tsx +++ b/web/app/components/datasets/hit-testing/components/result-item.tsx @@ -38,9 +38,9 @@ const ResultItem: FC = ({ }] = useBoolean(false) return ( -
+
{/* Meta info */} -
+
= ({
{/* Main */} -
+
{content}
{isParentChildRetrieval && (
diff --git a/web/app/components/datasets/hit-testing/index.tsx b/web/app/components/datasets/hit-testing/index.tsx index 0aef53cd6d..f82edf0267 100644 --- a/web/app/components/datasets/hit-testing/index.tsx +++ b/web/app/components/datasets/hit-testing/index.tsx @@ -65,33 +65,26 @@ const HitTesting: FC = ({ datasetId }: Props) => { const total = recordsRes?.total || 0 - const onClickCard = (detail: HitTestingType) => { - setCurrParagraph({ paraInfo: detail, showModal: true }) - } - - const onClickExternalCard = (detail: ExternalKnowledgeBaseHitTestingType) => { - setExternalCurrParagraph({ paraInfo: detail, showModal: true }) - } const { dataset: currentDataset } = useContext(DatasetDetailContext) const isExternal = currentDataset?.provider === 'external' const [retrievalConfig, setRetrievalConfig] = useState(currentDataset?.retrieval_model_dict as RetrievalConfig) const [isShowModifyRetrievalModal, setIsShowModifyRetrievalModal] = useState(false) const [isShowRightPanel, { setTrue: showRightPanel, setFalse: hideRightPanel, set: setShowRightPanel }] = useBoolean(!isMobile) - const renderHitResults = (results: any[], onClickCard: (record: any) => void) => ( - <> -
{t('datasetHitTesting.hit.title')}
-
-
- {results.map((record, idx) => ( - - ))} -
+ const renderHitResults = (results: any[]) => ( +
+
+ {t('datasetHitTesting.hit.title', { num: results.length })}
- +
+ {results.map((record, idx) => ( + + ))} +
+
) const renderEmptyState = () => ( @@ -180,8 +173,8 @@ const HitTesting: FC = ({ datasetId }: Props) => { )}
-
- {renderHitResults(generalResultData, onClickCard)} +
+ {renderHitResults(generalResultData)} {submitLoading ?
= ({ datasetId }: Props) => { return renderEmptyState() if (hitResult?.records.length) - return renderHitResults(hitResult.records, onClickCard) + return renderHitResults(hitResult.records) - return renderHitResults(externalHitResult?.records || [], onClickExternalCard) + return renderHitResults(externalHitResult?.records || []) })() ) } diff --git a/web/app/components/datasets/hit-testing/style.module.css b/web/app/components/datasets/hit-testing/style.module.css index 1e90902a70..7d83b8abb6 100644 --- a/web/app/components/datasets/hit-testing/style.module.css +++ b/web/app/components/datasets/hit-testing/style.module.css @@ -5,7 +5,7 @@ @apply flex-1 h-full; } .leftDiv { - @apply border-r border-gray-100 px-6 py-3 flex flex-col; + @apply px-6 py-3 flex flex-col; } .rightDiv { @apply flex flex-col; diff --git a/web/i18n/en-US/dataset-hit-testing.ts b/web/i18n/en-US/dataset-hit-testing.ts index 6dbfa47fee..385d68c771 100644 --- a/web/i18n/en-US/dataset-hit-testing.ts +++ b/web/i18n/en-US/dataset-hit-testing.ts @@ -19,7 +19,7 @@ const translation = { testing: 'Testing', }, hit: { - title: 'RETRIEVAL PARAGRAPHS', + title: '{{num}} Retrieved Chunks', emptyTip: 'Retrieval Testing results will show here', }, noRecentTip: 'No recent query results here', diff --git a/web/i18n/zh-Hans/dataset-hit-testing.ts b/web/i18n/zh-Hans/dataset-hit-testing.ts index 09cfdc2824..6aba135c71 100644 --- a/web/i18n/zh-Hans/dataset-hit-testing.ts +++ b/web/i18n/zh-Hans/dataset-hit-testing.ts @@ -19,7 +19,7 @@ const translation = { testing: '测试', }, hit: { - title: '召回段落', + title: '{{num}} 个召回段落', emptyTip: '召回测试结果将展示在这里', }, noRecentTip: '最近无查询结果',