diff --git a/web/src/components/ragflow-form.tsx b/web/src/components/ragflow-form.tsx index 5d10124ff1..72fddad41a 100644 --- a/web/src/components/ragflow-form.tsx +++ b/web/src/components/ragflow-form.tsx @@ -21,6 +21,7 @@ type RAGFlowFormItemProps = { horizontal?: boolean; required?: boolean; labelClassName?: string; + valueClassName?: string; className?: string; } & Pick, 'rules'>; @@ -32,6 +33,7 @@ export function RAGFlowFormItem({ horizontal = false, required = false, labelClassName, + valueClassName, className, rules, }: RAGFlowFormItemProps) { @@ -60,10 +62,14 @@ export function RAGFlowFormItem({ )}
{typeof children === 'function' diff --git a/web/src/locales/en.ts b/web/src/locales/en.ts index 98936bf80a..33dc1a63fd 100644 --- a/web/src/locales/en.ts +++ b/web/src/locales/en.ts @@ -1513,9 +1513,9 @@ Example: Virtual Hosted Style`, includeHeadingContent: 'Include heading content', includeHeadingContentTip: 'When enabled, content directly under a heading is kept as its own chunk. Child chunks keep only the heading path.', - hierarchyTip: `Build a heading tree and produce self-contained chunks, each carrying its full ancestor heading path (e.g. Part 1 › Chapter 3 › Section 2 + body text).
+ hierarchyTip: `Build a heading tree and produce self-contained chunks, each carrying its full ancestor heading path (e.g. Part 1 › Chapter 3 › Section 2 + body text).\n Best for: Documents with independent, structurally significant sections — such as legal statutes, regulations, contracts, and technical specifications — where each chunk must be identifiable by its structural position even without surrounding context.`, - groupTip: `Split the document flat at a chosen heading level and automatically merge adjacent small sections to preserve content continuity. No parent-heading path is injected.
+ groupTip: `Split the document flat at a chosen heading level and automatically merge adjacent small sections to preserve content continuity. No parent-heading path is injected.\n Best for: Documents with flowing, contextually connected content — such as books, manuals, reports, and articles — where adjacent paragraphs should stay together to maintain narrative coherence.`, enableMultiColumn: 'Detect multi-column layout', enableMultiColumnTip: @@ -2281,8 +2281,11 @@ This process aggregates variables from multiple branches into a single variable }, fields: 'Field', addParser: 'Add Parser', + rule: 'Rule', + addRule: 'Add rule', group: 'Group', hierarchy: 'Hierarchy', + addRegularExpressions: 'Add regular expressions', regularExpressions: 'Regular Expressions', overlappedPercent: 'Overlapped percent (%)', searchMethod: 'Search method', diff --git a/web/src/locales/zh.ts b/web/src/locales/zh.ts index 9feee86134..924fc9147a 100644 --- a/web/src/locales/zh.ts +++ b/web/src/locales/zh.ts @@ -1259,9 +1259,9 @@ General:实体和关系提取提示来自 GitHub - microsoft/graphrag:基于 includeHeadingContent: '包含标题内容', includeHeadingContentTip: '启用后,标题下的直接内容将作为一个独立的块保留。子块仅保留标题路径。', - hierarchyTip: `构建标题树并生成独立的块,每个块携带其完整的祖先标题路径(例如 第1部分 › 第3章 › 第2节 + 正文)。
+ hierarchyTip: `构建标题树并生成独立的块,每个块携带其完整的祖先标题路径(例如 第1部分 › 第3章 › 第2节 + 正文)。\n 适用场景:具有独立的、结构性重要章节的文档——如法律条款、法规、合同和技术规范——其中每个块即使没有上下文也能通过其结构位置来识别。`, - groupTip: `在选定的标题级别将文档扁平分割,并自动合并相邻的小节以保持内容连续性。不注入父标题路径。
+ groupTip: `在选定的标题级别将文档扁平分割,并自动合并相邻的小节以保持内容连续性。不注入父标题路径。\n 适用场景:具有流动性的、内容相关联的文档——如书籍、手册、报告和文章——其中相邻段落应保持在一起以维持叙述连贯性。`, enableMultiColumn: '启用多栏', enableMultiColumnTip: @@ -1980,8 +1980,11 @@ General:实体和关系提取提示来自 GitHub - microsoft/graphrag:基于 }, fields: '字段', addParser: '增加解析器', - group: '聚合', - hierarchy: '层次结构', + rule: '规则', + addRule: '增加规则', + addRegularExpressions: '增加正则表达式', + // group: '聚合', + // hierarchy: '层次结构', regularExpressions: '正则表达式', overlappedPercent: '重叠百分比(%)', searchMethod: '搜索方法', diff --git a/web/src/pages/agent/form/parser-form/common-form-fields.tsx b/web/src/pages/agent/form/parser-form/common-form-fields.tsx index 71f29750c1..c0f0082d36 100644 --- a/web/src/pages/agent/form/parser-form/common-form-fields.tsx +++ b/web/src/pages/agent/form/parser-form/common-form-fields.tsx @@ -9,7 +9,7 @@ import { SelectWithSearchFlagOptionType, } from '@/components/originui/select-with-search'; import { RAGFlowFormItem } from '@/components/ragflow-form'; -import { Checkbox } from '@/components/ui/checkbox'; +import { Switch } from '@/components/ui/switch'; import { upperCase, upperFirst } from 'lodash'; import { useTranslation } from 'react-i18next'; import { @@ -96,10 +96,11 @@ export function TwoColumnCheckFormField({ prefix }: CommonProps) { label={t('flow.enableMultiColumn')} horizontal={true} labelClassName="w-full" + valueClassName="w-8" tooltip={t('flow.enableMultiColumnTip')} > {(field) => ( - { field.onChange?.(checked); @@ -119,9 +120,10 @@ export function RmdirFormField({ prefix }: CommonProps) { horizontal={true} tooltip={t('flow.removeTocTip')} labelClassName="w-full" + valueClassName="w-8" > {(field) => ( - { field.onChange?.(checked); diff --git a/web/src/pages/agent/form/title-chunker-form/index.tsx b/web/src/pages/agent/form/title-chunker-form/index.tsx index 7f60bc27f2..b800c4f023 100644 --- a/web/src/pages/agent/form/title-chunker-form/index.tsx +++ b/web/src/pages/agent/form/title-chunker-form/index.tsx @@ -3,11 +3,12 @@ import { SelectWithSearch } from '@/components/originui/select-with-search'; import { RAGFlowFormItem } from '@/components/ragflow-form'; import { BlockButton, Button } from '@/components/ui/button'; import { Card, CardContent, CardHeader } from '@/components/ui/card'; -import { Checkbox } from '@/components/ui/checkbox'; import { Form } from '@/components/ui/form'; import { Input } from '@/components/ui/input'; +import { Switch } from '@/components/ui/switch'; +import { cn } from '@/lib/utils'; import { zodResolver } from '@hookform/resolvers/zod'; -import { Trash2 } from 'lucide-react'; +import { ChevronDown, ChevronUp, Trash2 } from 'lucide-react'; import { memo, useEffect, useRef, useState } from 'react'; import { useFieldArray, useForm, useFormContext } from 'react-hook-form'; import { useTranslation } from 'react-i18next'; @@ -145,7 +146,7 @@ function CardBody({ cardName }: CardBodyProps) { onClick={() => appendLevel({ expression: '' })} className="mt-4" > - {t('flow.addLevel', 'Add Level')} + {t('flow.addRegularExpressions')} ); @@ -297,27 +298,25 @@ const TitleChunkerForm = ({ node }: INextOperatorForm) => { {method === 'group' && t('flow.groupTip')}
*/}
setShowAllTip(!showAllTip)} > -
- - {/* {method === 'hierarchy' && t('flow.hierarchyTip')} - {method === 'group' && t('flow.groupTip')} */} - - {/* - {showAllTip ? '▲' : ''} - */} +
+
+ {method === 'hierarchy' + ? t('flow.hierarchyTip') + : method === 'group' + ? t('flow.groupTip') + : ''} +
+
+ {showAllTip ? : } +
@@ -330,9 +329,10 @@ const TitleChunkerForm = ({ node }: INextOperatorForm) => { tooltip={t('flow.includeHeadingContentTip')} horizontal={true} labelClassName="w-full" + valueClassName="w-8" > {(field) => ( - { field.onChange?.(checked); @@ -389,7 +389,7 @@ const TitleChunkerForm = ({ node }: INextOperatorForm) => { } className="mt-4" > - {t('flow.rule', 'Add Rule')} + {t('flow.addRule', 'Add Rule')} {/* )} */}