Implementation:Ucbepic Docetl NamespaceDialog
| Knowledge Sources | |
|---|---|
| Domains | Frontend, React_UI |
| Last Updated | 2026-02-08 00:00 GMT |
Overview
Concrete tool for the namespace configuration dialog used to set the user's workspace namespace in the DocETL playground.
Description
The NamespaceDialog provides a form for entering or generating a namespace identifier that isolates the user's pipeline data and files on the backend. It includes a random namespace generator that combines adjectives and nouns (e.g., "swift-eagle-a3b2c1d4"), namespace validation via the /api/checkNamespace endpoint, a warning when an existing namespace is detected with data, and a shake animation on validation errors. The namespace is used to organize files and pipeline configurations on the server.
Usage
Opened when the user first visits the playground or wants to change their workspace namespace. Required before uploading datasets or running pipelines.
Code Reference
Source Location
- Repository: Ucbepic_Docetl
- File: website/src/components/NamespaceDialog.tsx
- Lines: 1-234
Signature
interface NamespaceDialogProps {
open: boolean;
onOpenChange: (open: boolean) => void;
currentNamespace: string | null;
onSave: (namespace: string) => void;
}
export function NamespaceDialog({ open, onOpenChange, currentNamespace, onSave }: NamespaceDialogProps): JSX.Element
Import
import { NamespaceDialog } from "@/components/NamespaceDialog";
I/O Contract
Inputs (Props)
| Name | Type | Required | Description |
|---|---|---|---|
| open | boolean | Yes | Whether the dialog is visible |
| onOpenChange | (open: boolean) => void | Yes | Toggle dialog visibility |
| currentNamespace | string or null | Yes | Current namespace value |
| onSave | (namespace: string) => void | Yes | Callback with the saved namespace |
Outputs
| Name | Type | Description |
|---|---|---|
| rendered | JSX.Element | Namespace input dialog with random generation |
Usage Examples
<NamespaceDialog
open={showNamespace}
onOpenChange={setShowNamespace}
currentNamespace={namespace}
onSave={(ns) => setNamespace(ns)}
/>