WorkflowLive.Edit: Reduce Complexity and Improve Maintainability
@theroinaochieng is already working on this.
Since Jul 16, 2025.
- Dominant language
- Elixir
- Stars
- 296
- Forks
- 86
- Avg merge
- 1d 13h
- Merged PRs (30d)
- 50
Description
Description
The LightningWeb.WorkflowLive.Edit module has grown to over 3000 lines and handles numerous responsibilities, making it difficult to maintain, test, and understand. This technical debt needs to be addressed through a comprehensive refactoring effort.
Current Issues
-
Size and Complexity: The module is extremely large with 3000+ lines of code
-
Multiple Responsibilities: It handles:
- Workflow editing UI
- Job management
- Trigger management
- Edge/path management
- Manual run execution
- AI assistant integration
- GitHub sync functionality
- Version control/snapshots
- Presence tracking
- Real-time updates
- Template publishing
-
Complex State Management: The socket assigns contain 40+ fields
-
Event Handler Overload: 30+ different event handlers in a single module
-
Nested Conditionals: Deep nesting in render functions and event handlers
-
Mixed Concerns: UI rendering, business logic, and data persistence are intertwined
Proposed Refactoring Strategy
-
Extract Components: Break down the large render function into smaller, focused components
-
Separate Concerns: Create dedicated modules for:
- Workflow state management
- Job operations
- Trigger operations
- Version control operations
- AI assistant integration
- Manual run handling
-
Simplify Event Handling: Group related events and delegate to specialized handlers
-
Improve State Management: Consider using a more structured approach to state management
-
Extract Business Logic: Move complex business logic out of the LiveView into service modules
Expected Benefits
- Improved maintainability and readability
- Easier testing of individual components
- Better separation of concerns
- Reduced cognitive load for developers
- Faster development of new features
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.