Skip to content

Workflow Settings: Workflow name field #3643

@theroinaochieng

Description

@theroinaochieng

User story

As a user managing workflows, I need to edit the workflow name with proper validation and uniqueness checks

Part of #3649
Depends on #3642

Details

Implement the workflow name text input field in the settings panel. This replicates functionality from lib/lightning_web/live/workflow_live/components.ex:114-122.

Current behavior:

  • Text input labeled "Workflow Name"
  • Required field
  • Must be unique within the project
  • Disabled during AI processing
  • Validation happens on change (real-time)
  • Errors display below input field

Field properties:

  • Field: workflow.name (string)
  • Type: text input
  • Label: "Workflow Name"
  • Disabled when: sending_ai_message == true

Validation rules (lib/lightning/workflows/workflow.ex:81-89):

  • Required: validate_required([:name])
  • Unique constraint: unique_constraint([:name, :project_id])
  • Error message: "a workflow with this name already exists in this project."

Error display:

  • Shows below input field
  • Common errors:
    • "can't be blank"
    • "a workflow with this name already exists in this project."

Visual state:

  • When name has validation error, settings icon in header turns red
  • Error detection: workflow_settings_errors?(changeset) checks if :name in errors (edit.ex:2888-2891)

Event handling:

  • Uses parent form's "validate" event (edit.ex:1838)
  • Triggers validation on every change
  • No separate save button - uses main Save button in header

Implementation notes

Reference: lib/lightning_web/live/workflow_live/components.ex:114-122

The component should:

  • Use controlled input pattern
  • Call onValidate callback on change
  • Display validation errors
  • Disable input when AI processing
  • Support real-time validation
  • Integrate with form state management

Props needed:

  • value: string (current workflow name)
  • onChange: (name: string) => void
  • onValidate: (name: string) => Promise
  • disabled: boolean (AI processing state)
  • errors: string[] (validation errors)

Release notes

Add workflow name field to settings panel

User acceptance criteria

  • Text input displays with "Workflow Name" label
  • Input shows current workflow name
  • Validation triggers on change
  • Required validation shows "can't be blank" error
  • Unique constraint shows appropriate error message
  • Input disabled during AI processing
  • Errors display below input field
  • Settings icon turns red when name has errors
  • Changes saved via main Save button in header

Metadata

Metadata

Assignees

Type

No type

Projects

Status

Done

Relationships

None yet

Development

No branches or pull requests

Issue actions