diff --git a/web/app/components/base/file-uploader/file-type-icon.tsx b/web/app/components/base/file-uploader/file-type-icon.tsx index 4e31ab66a8..de9166d2ae 100644 --- a/web/app/components/base/file-uploader/file-type-icon.tsx +++ b/web/app/components/base/file-uploader/file-type-icon.tsx @@ -82,8 +82,8 @@ const FileTypeIcon = ({ size = 'sm', className, }: FileTypeIconProps) => { - const Icon = FILE_TYPE_ICON_MAP[type]?.component || FileAppearanceTypeEnum.custom - const color = FILE_TYPE_ICON_MAP[type]?.color || FILE_TYPE_ICON_MAP.custom.color + const Icon = FILE_TYPE_ICON_MAP[type]?.component || FileAppearanceTypeEnum.document + const color = FILE_TYPE_ICON_MAP[type]?.color || FILE_TYPE_ICON_MAP[FileAppearanceTypeEnum.document].color return } diff --git a/web/app/components/datasets/hit-testing/assets/test-data.ts b/web/app/components/datasets/hit-testing/assets/test-data.ts index 035bfcc827..74f27908b8 100644 --- a/web/app/components/datasets/hit-testing/assets/test-data.ts +++ b/web/app/components/datasets/hit-testing/assets/test-data.ts @@ -54,7 +54,7 @@ export const generalResultData: HitTesting[] = [ content: 'It is quite natural for ', }, ], - score: 0.8771945, + score: 0.99, tsne_position: null, }, { @@ -99,7 +99,7 @@ export const generalResultData: HitTesting[] = [ }, }, child_chunks: null, - score: 0.8642928, + score: 1, tsne_position: null, }, { @@ -144,7 +144,7 @@ export const generalResultData: HitTesting[] = [ }, }, child_chunks: null, - score: 0.80618876, + score: 0.2, tsne_position: null, }, ] diff --git a/web/app/components/datasets/hit-testing/components/child-chunks-item.tsx b/web/app/components/datasets/hit-testing/components/child-chunks-item.tsx index f6be610114..052d270b3f 100644 --- a/web/app/components/datasets/hit-testing/components/child-chunks-item.tsx +++ b/web/app/components/datasets/hit-testing/components/child-chunks-item.tsx @@ -19,11 +19,11 @@ const ChildChunks: FC = ({
-
-
C-{id}
- +
+
C-{id}
+
- {content} + {content}
) } diff --git a/web/app/components/datasets/hit-testing/components/chunk-detail-modal.tsx b/web/app/components/datasets/hit-testing/components/chunk-detail-modal.tsx index 18e89f5890..5b5f42a6af 100644 --- a/web/app/components/datasets/hit-testing/components/chunk-detail-modal.tsx +++ b/web/app/components/datasets/hit-testing/components/chunk-detail-modal.tsx @@ -28,8 +28,8 @@ const ChunkDetailModal: FC = ({ const { segment, score, child_chunks } = payload const { position, content, keywords, document } = segment const isParentChildRetrieval = !!(child_chunks && child_chunks.length > 0) - const extension = document.name.split('.').slice(0, -1)[0] as FileAppearanceTypeEnum - const maxHeighClassName = 'max-h-[752px] overflow-y-auto' + const extension = document.name.split('.').slice(-1)[0] as FileAppearanceTypeEnum + const maxHeighClassName = 'max-h-[min(752px,_80vh)] overflow-y-auto' return ( = ({ onClose={onHide} className={cn(isParentChildRetrieval ? '!min-w-[1200px]' : '!min-w-[720px]')} > -
+
{/* Meta info */}
@@ -49,7 +49,7 @@ const ChunkDetailModal: FC = ({ className={cn('w-fit group-hover:opacity-100')} /> -
+
{document.name}
@@ -62,7 +62,7 @@ const ChunkDetailModal: FC = ({ {!isParentChildRetrieval && keywords && keywords.length > 0 && (
{t(`${i18nPrefix}.keyword`)}
-
+
{keywords.map(keyword => ( ))} 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 e8f85baf9f..6e2827857a 100644 --- a/web/app/components/datasets/hit-testing/components/result-item.tsx +++ b/web/app/components/datasets/hit-testing/components/result-item.tsx @@ -27,7 +27,7 @@ const ResultItem: FC = ({ const { segment, score, child_chunks } = payload const { position, word_count, content, keywords, document } = segment const isParentChildRetrieval = !!(child_chunks && child_chunks.length > 0) - const extension = document.name.split('.').slice(0, -1)[0] as FileAppearanceTypeEnum + const extension = document.name.split('.').slice(-1)[0] as FileAppearanceTypeEnum const [isFold, { toggle: toggleFold, }] = useBoolean(false) @@ -61,7 +61,7 @@ const ResultItem: FC = ({
-
{t(`${i18nPrefix}.dataset.hitChunks`, { num: child_chunks.length })}
+
{t(`${i18nPrefix}.hitChunks`, { num: child_chunks.length })}
{child_chunks.map(item => ( @@ -73,7 +73,7 @@ const ResultItem: FC = ({
)} {!isParentChildRetrieval && keywords && keywords.length > 0 && ( -
+
{keywords.map(keyword => ( ))} @@ -82,7 +82,7 @@ const ResultItem: FC = ({
{/* Foot */}
-
+
{document.name}
diff --git a/web/app/components/datasets/hit-testing/components/score.tsx b/web/app/components/datasets/hit-testing/components/score.tsx index bcbcabf20e..6f48edd4bd 100644 --- a/web/app/components/datasets/hit-testing/components/score.tsx +++ b/web/app/components/datasets/hit-testing/components/score.tsx @@ -13,9 +13,9 @@ const Score: FC = ({ besideChunkName, }) => { return ( -
-
-
+
+
+
score
{value.toFixed(2)}