Description
Current State
components/workflow-progress-button.tsx is 1885 lines long — the largest component in the codebase. It handles:
- Multiple dialog states (progress, form, approval, rejection)
- Form rendering with conditional fields
- User assignment selection
- Workflow state management
- Approval/rejection logic
- Form submission
This creates:
- Difficult testing (can't test dialogs independently)
- Hard to understand flow
- Risk of bugs in deeply nested logic
Desired Outcome
Break into composable components:
components/
workflow/
workflow-progress-button.tsx (orchestrator, ~200 lines)
workflow-progress-dialog.tsx
workflow-form-dialog.tsx
workflow-approval-dialog.tsx
workflow-user-select.tsx
hooks/
use-workflow-progress.ts
use-workflow-form.ts
How to approach
- Identify the distinct UI states (dialogs)
- Extract each dialog to its own component
- Create a custom hook for shared state logic
- Keep the main component as a thin orchestrator
Related large components to tackle after
components/account-overview.tsx (1424 lines)
components/unified-projects-section.tsx (965 lines)
components/department-overview.tsx (708 lines)
Acceptance Criteria
Description
Current State
components/workflow-progress-button.tsxis 1885 lines long — the largest component in the codebase. It handles:This creates:
Desired Outcome
Break into composable components:
How to approach
Related large components to tackle after
components/account-overview.tsx(1424 lines)components/unified-projects-section.tsx(965 lines)components/department-overview.tsx(708 lines)Acceptance Criteria