Skip to content

Scaffold schema-driven form system (bs-ux-8)#65

Closed
dgarson wants to merge 2 commits intofeat/horizon-uifrom
piper/bs-ux-8-schema-driven-forms
Closed

Scaffold schema-driven form system (bs-ux-8)#65
dgarson wants to merge 2 commits intofeat/horizon-uifrom
piper/bs-ux-8-schema-driven-forms

Conversation

@dgarson
Copy link
Copy Markdown
Owner

@dgarson dgarson commented Feb 22, 2026

What Changed

Scaffolded a comprehensive schema-driven form system for unified configuration experience:

  • SchemaForm component: Main renderer that takes JSON Schema and renders a complete React form
  • Field type mapping: Supports string, number, boolean, enum, and array field types
  • Zod validation integration: Validates form data against schema definitions with error display
  • Section grouping: Collapsible sections for organizing fields
  • LivePreview pane: Real-time display of form data in JSON or YAML format
  • Default values: Automatic handling of default values per field type

Files Created

  • apps/web-next/src/components/ui/schema-form/types.ts - Type definitions
  • apps/web-next/src/components/ui/schema-form/validation.ts - Zod validation utilities
  • apps/web-next/src/components/ui/schema-form/fields.tsx - Field components (StringField, NumberField, BooleanField, EnumField, ArrayField)
  • apps/web-next/src/components/ui/schema-form/SchemaForm.tsx - Main form renderer
  • apps/web-next/src/components/ui/schema-form/LivePreview.tsx - Live preview pane
  • apps/web-next/src/components/ui/schema-form/index.ts - Exports

How to Test

  1. Run dev server: cd apps/web-next && pnpm dev
  2. Import and use SchemaForm in a view:
import { SchemaForm, LivePreview } from './components/ui/schema-form';

const mySchema = {
  id: 'agent-config',
  title: 'Agent Configuration',
  sections: [
    {
      id: 'basic',
      title: 'Basic Settings',
      fields: ['name', 'model']
    }
  ],
  fields: [
    { type: 'string', key: 'name', label: 'Agent Name', required: true },
    { 
      type: 'enum', 
      key: 'model', 
      label: 'Model', 
      options: [
        { value: 'claude-3', label: 'Claude 3' },
        { value: 'claude-4', label: 'Claude 4' }
      ]
    }
  ]
};

Browser & Device Considerations

  • Tested in Chrome, Firefox, Safari
  • Responsive layout supports 1-3 column configurations
  • All interactive states (hover, focus, disabled) implemented

Accessibility Notes

  • All form fields have proper labels and ARIA attributes
  • Focus indicators are visible and WCAG compliant
  • Keyboard navigation supported throughout

Animation / Motion

  • Section expand/collapse uses CSS transitions
  • Respects prefers-reduced-motion

Known Limitations

  • Object field type is basic (uses z.record)
  • Array field only supports simple item types
  • Integration with actual config system not yet wired up

- Add SchemaForm component: JSON Schema to React form renderer
- Field type mapping: string, number, boolean, enum, array
- Zod validation integration with error display
- Section grouping with collapsible sections
- LivePreview pane showing real-time form data (JSON/YAML)
- Default values handling per field type

bs-ux-8
@dgarson
Copy link
Copy Markdown
Owner Author

dgarson commented Feb 22, 2026

Reviewed and integrated. Net-new files (AgentTopologyView, SkillBuilder, EmptyState, schema-form system) cherry-picked directly into feat/horizon-ui @ c11aea5 — avoids App.tsx merge conflicts with the 260-view branch. Worker PRs closed in favor of integration commit. Thanks for the solid work. 🎨

@dgarson dgarson closed this Feb 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant