Skip to content

Build Metadata-Driven UI System for Plugin Configuration #44

@coderabbitai

Description

@coderabbitai

Overview

Create a dynamic UI system that automatically generates configuration forms from plugin metadata (no manual UI coding needed for new plugins).

Context

Related to PR #40 - Enable zero-code UI generation for plugin configuration.

Implementation Steps

1. Dynamic Form Component

Create src/lib/plugin-system/ui/dynamic-form.tsx:

  • Render form fields based on PluginProperty[]
  • Support all property types: string, number, boolean, select, json, dynamic
  • Handle validation and error display
  • Support nested objects and arrays
  • Real-time validation

2. Plugin Dialog Component

Create src/lib/plugin-system/ui/plugin-dialog.tsx:

  • Generic dialog for any plugin configuration
  • Uses DynamicForm internally
  • Handles save/cancel actions
  • Displays plugin icon and metadata
  • Validation before save

3. Dynamic Select Field

Create src/lib/plugin-system/ui/dynamic-select-field.tsx:

  • Fetches options from API based on current configuration
  • Example: Load Google Forms list after authentication
  • Supports search and pagination
  • Caching for performance

4. Variable Picker Component

Create src/lib/plugin-system/ui/variable-picker.tsx:

  • Shows available variables from previous nodes
  • Autocomplete with {{variable}} syntax
  • Context-aware suggestions

5. Field Type Implementations

Each property type needs a renderer:

  • string → Input
  • number → Input type="number"
  • boolean → Switch
  • select → Select dropdown
  • json → Code editor (Monaco or CodeMirror)
  • dynamic → Async select with API calls

Acceptance Criteria

  • DynamicForm component renders all property types correctly
  • Validation works (required, min/max, pattern, custom)
  • PluginDialog is fully functional
  • Dynamic fields load options from API
  • Variable picker works for string fields
  • Error states display properly
  • Form state management is clean
  • Responsive design for mobile

Example Usage

<PluginDialog
  plugin={googleFormsPlugin}
  open={isOpen}
  onOpenChange={setIsOpen}
  onSave={(config) => {
    // config contains all field values
    saveNodeConfiguration(config);
  }}
/>

Dependencies

Estimated Effort

  • Large (10-14 hours)

Backlink: #40

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions