Jump to content

Connect SuperML | Leeroopedia MCP: Equip your AI agents with best practices, code verification, and debugging knowledge. Powered by Leeroo — building Organizational Superintelligence. Contact us at founders@leeroo.com.

Implementation:Ucbepic Docetl OperationComponents

From Leeroopedia
Revision as of 17:01, 16 February 2026 by Admin (talk | contribs) (Auto-imported from implementations/Ucbepic_Docetl_OperationComponents.md)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)


Knowledge Sources
Domains Frontend, React_UI
Last Updated 2026-02-08 00:00 GMT

Overview

Concrete tool for the operation-type-specific editor components that render configuration forms for each DocETL operation type.

Description

This module implements editor components for every supported DocETL operation type and exports a factory function createOperationComponent that returns the appropriate component based on operation type. It includes MapFilterOperationComponent (for map, filter, parallel_map, and rank operations), ReduceOperationComponent, ResolveOperationComponent, UnnestOperationComponent, SplitOperationComponent, GatherOperationComponent, SampleOperationComponent, CodeOperationComponent, and ExtractOperationComponent. Each renders the relevant prompt inputs, schema editors, and operation-specific configuration fields (reduce keys, blocking thresholds, split keys, peripheral chunks, etc.).

Usage

Called by OperationCard via the createOperationComponent factory to render the correct editor form for the selected operation type.

Code Reference

Source Location

Signature

interface OperationComponentProps {
  operation: Operation;
  isSchemaExpanded: boolean;
  onUpdate: (updatedOperation: Operation) => void;
  onToggleSchema: () => void;
}

export const MapFilterOperationComponent: React.FC<OperationComponentProps>
export const ReduceOperationComponent: React.FC<OperationComponentProps>
export const ResolveOperationComponent: React.FC<OperationComponentProps>
// ... additional operation components

export default function createOperationComponent(
  operation: Operation,
  isSchemaExpanded: boolean,
  onUpdate: (op: Operation) => void,
  onToggleSchema: () => void
): JSX.Element

Import

import createOperationComponent from "@/components/operations/components";

I/O Contract

Inputs (Props)

Name Type Required Description
operation Operation Yes The operation to render an editor for
isSchemaExpanded boolean Yes Whether the schema section is expanded
onUpdate (updatedOperation: Operation) => void Yes Callback for operation updates
onToggleSchema () => void Yes Toggle schema section visibility

Outputs

Name Type Description
rendered JSX.Element Operation-type-specific editor form

Usage Examples

const operationEditor = createOperationComponent(
  operation,
  isSchemaExpanded,
  handleUpdate,
  toggleSchema
);

// Renders the appropriate editor based on operation.type
return <div>{operationEditor}</div>;

Related Pages

Page Connections

Double-click a node to navigate. Hold to expand connections.
Principle
Implementation
Heuristic
Environment