Skip to content

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

fix(web): require chunk content when creating or editing a chunk (#18739)

chanx6916ddf17e4f
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 71d0f676ff..822fb27d56 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
@@ -128,9 +128,13 @@ const ChunkCreatingModal: React.FC<IModalProps<any> & kFProps> = ({
<FormField
control={form.control}
name="content_with_weight"
+ rules={{
+ validate: (value: string) =>
+ value?.trim() ? true : t('chunk.chunkMessage'),
+ }}
render={({ field }) => (
<FormItem>
- <FormLabel>{t('chunk.chunk')}</FormLabel>
+ <FormLabel required>{t('chunk.chunk')}</FormLabel>
<FormControl>
<Textarea
{...field}