Skip to content

feat: Generate task form from schema #384

Description

@handreyrc

Description

Generate a form for a selected task and present it in the side panel. The form shall be generated directly from the filtered schema and populated with the selected values retrieved from the task in the model.

The goal is to start with the setTask definition and, in subsequent tasks, extend it to other task definitions. Some tasks have a deep and complex structure that may require custom code to handle them. To keep the scope small and easy to validate, this work is restricted to setTask.

Motivation

The blueprint for building the model comes from the schema, which also provides the full task definition — including validation rules and field descriptions.

To properly build a dynamic form, it is necessary to consume the task definitions from the schema and then populate it with the task instance values from the current model state.

Proposed Implementation

current workflow model
        │
        ▼
  Task population: resolve selected node → task instance
        │
        ▼
workflowSchema ($defs)
        │
        ▼
  Stage 1: extract and prepare the definition
        │
        ▼
  Stage 2: resolve node type → definition name
        │
        ▼
  Stage 3: walk schema → FormFieldDescriptor[]
        │
        ▼
  Stage 4: render form with react-hook-form

Refer to the spike for more detailed information and references for this implementation.

Definition of Done

  • Implementation: Fully implemented according to the Open Workflow spec.
  • Unit Tests: Comprehensive unit tests are included and passing.
  • Integration Tests: Verified within the monorepo and target environments (Web/VS Code).
  • Documentation: Updated README.md, ADRs, or official docs.
  • Performance: No significant regression in editor responsiveness.
  • Accessibility: UI changes comply with accessibility standards.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions