Implementation:Infiniflow Ragflow ReparseDialog Component
| Knowledge Sources | |
|---|---|
| Domains | Frontend, Knowledge_Base |
| Last Updated | 2026-02-12 06:00 GMT |
Overview
Dynamic form generation dialog for document reparse operations with conditional checkbox fields.
Description
ReparseDialog is a memoized component that dynamically generates form fields based on chunk_num and enable_metadata flags. When chunk_num > 0, a delete checkbox is shown (offering to redo existing chunks). When enable_metadata is true, an apply_kb checkbox offers to apply auto-metadata settings. The component uses DynamicForm.Root with a ref-based imperative API for form control. If hidden is true (no chunks and no metadata), it auto-triggers the operation immediately via useEffect. The dialog wraps ConfirmDeleteDialog with custom title, content, and OK/Cancel handlers.
Usage
Opened by ParsingStatusCell when the user initiates a reparse operation on a document that may have existing chunks or metadata settings.
Code Reference
Source Location
- Repository: Infiniflow_Ragflow
- File: web/src/pages/dataset/dataset/reparse-dialog.tsx
- Lines: 1-176
Signature
export const ReparseDialog = memo(({
handleOperationIconClick, chunk_num, enable_metadata,
hidden, visible, hideModal,
}: DialogProps & {
chunk_num: number;
handleOperationIconClick: (options?: { delete: boolean; apply_kb: boolean }) => void;
enable_metadata?: boolean;
visible: boolean;
hideModal: () => void;
hidden?: boolean;
}) => JSX.Element);
Import
import { ReparseDialog } from './reparse-dialog';
I/O Contract
Inputs
| Name | Type | Required | Description |
|---|---|---|---|
| chunk_num | number | Yes | Number of existing chunks (controls delete checkbox) |
| handleOperationIconClick | function | Yes | Callback with delete/apply_kb options |
| enable_metadata | boolean | No | Whether metadata auto-apply is available |
| visible | boolean | Yes | Dialog visibility |
| hideModal | function | Yes | Close dialog callback |
| hidden | boolean | No | If true, auto-triggers operation without dialog |
Outputs
| Name | Type | Description |
|---|---|---|
| JSX.Element | React element | Confirmation dialog with dynamic checkbox form |
Usage Examples
<ReparseDialog
chunk_num={42}
enable_metadata={true}
handleOperationIconClick={(opts) => runParse(opts)}
visible={dialogVisible}
hideModal={hideDialog}
/>