Skip to content

RAGFlow is an agent-native database: a Retrieval-Augmented Generation (RAG) engine that grew into context infrastructure.

Feat: Add chunk also supports uploading image. (#13628)

chanx5403f142aee3
diff --git a/web/src/components/file-uploader.tsx b/web/src/components/file-uploader.tsx
index 813787a7ca..0f6318e252 100644
--- a/web/src/components/file-uploader.tsx
+++ b/web/src/components/file-uploader.tsx
@@ -382,7 +382,7 @@ export function FileUploader(props: FileUploaderProps) {
<div className="relative flex flex-col gap-4 overflow-hidden">
{!(hideDropzoneOnMaxFileCount && reachesMaxFileCount) && (
<Tabs defaultValue="file" className="w-full">
- <TabsList className="w-full justify-start">
+ <TabsList className="w-fit justify-start">
<TabsTrigger value="file" className="gap-2">
<FileText className="size-4" />
{t('fileManager.files', 'Files')}
diff --git a/web/src/pages/chunk/parsed-result/add-knowledge/components/knowledge-chunk/components/chunk-creating-modal/index.tsx b/web/src/pages/chunk/parsed-result/add-knowledge/components/knowledge-chunk/components/chunk-creating-modal/index.tsx
index 94e771ce22..5b3d65e67e 100644
--- a/web/src/pages/chunk/parsed-result/add-knowledge/components/knowledge-chunk/components/chunk-creating-modal/index.tsx
+++ b/web/src/pages/chunk/parsed-result/add-knowledge/components/knowledge-chunk/components/chunk-creating-modal/index.tsx
@@ -146,7 +146,6 @@ const ChunkCreatingModal: React.FC<IModalProps<any> & kFProps> = ({
</FormItem>
)}
/>
-
{/* Do not display the type field in create mode */}
{isEditMode && (
<FormField
@@ -174,7 +173,7 @@ const ChunkCreatingModal: React.FC<IModalProps<any> & kFProps> = ({
/>
)}
- {isEditMode && form.getValues('doc_type_kwd') === 'image' && (
+ {(!isEditMode || form.getValues('doc_type_kwd') + '' === 'image') && (
<FormField
control={form.control}
name="image"
@@ -213,7 +212,6 @@ const ChunkCreatingModal: React.FC<IModalProps<any> & kFProps> = ({
)}
/>
)}
-
<FormField
control={form.control}
name="important_kwd"
@@ -227,7 +225,6 @@ const ChunkCreatingModal: React.FC<IModalProps<any> & kFProps> = ({
</FormItem>
)}
/>
-
<FormField
control={form.control}
name="question_kwd"
@@ -255,7 +252,6 @@ const ChunkCreatingModal: React.FC<IModalProps<any> & kFProps> = ({
</FormItem>
)}
/>
-
{isTagParser && (
<FormField
control={form.control}
@@ -271,7 +267,6 @@ const ChunkCreatingModal: React.FC<IModalProps<any> & kFProps> = ({
)}
/>
)}
-
{!isTagParser && (
<FormProvider {...form}>
<TagFeatureItem />