refactor(pm-wizard): split 1,679-line god component into modular structure#635
Merged
zbigniewsobiecki merged 1 commit intodevfrom Mar 7, 2026
Merged
Conversation
nhopeatall
approved these changes
Mar 7, 2026
Collaborator
nhopeatall
left a comment
There was a problem hiding this comment.
Summary
LGTM — This is a clean, well-executed decomposition of a 1,679-line god component into 6 focused modules with no behavioral changes.
The module structure follows a sensible dependency graph: pm-wizard-state.ts (pure state, zero imports from other pm-wizard files) → pm-wizard-hooks.ts (side-effects) → pm-wizard.tsx (orchestrator), with step components importing only from pm-wizard-state and wizard-shared. No circular dependencies.
The extraction is mechanical and faithful — I verified the code in each new file matches the removed sections line-by-line. The 44 new unit tests cover all the pure functions that were previously untestable because they were embedded in the component. All CI checks pass.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Refactors the 1,679-line PM wizard god component into a modular, maintainable structure without any behavioral changes.
pm-wizard.tsx: 1,679 → 298 lines — now a thin orchestrator that calls extracted hooks and delegates rendering to sub-componentspm-wizard-state.ts(new): All types, constants (INITIAL_JIRA_LABELS),createInitialState(),wizardReducer, step-completion helpers, andbuildEditState()— zero imports from other pm-wizard filespm-wizard-hooks.ts(new):useTrelloDiscovery,useJiraDiscovery,useVerification,useWebhookManagement,useSaveMutation— each hook encapsulates one concernpm-wizard-trello-steps.tsx(new):TrelloCredentialsStep,TrelloBoardStep,TrelloFieldMappingSteppm-wizard-jira-steps.tsx(new):JiraCredentialsStep,JiraProjectStep,JiraFieldMappingSteppm-wizard-common-steps.tsx(new):WebhookStep,SaveStep(provider-agnostic)wizard-shared.tsx(updated): AddedSearchableSelectandFieldMappingRowcomponents from the original file — now shared across all wizard consumersTest plan
wizardReducer, step-completion helpers,buildEditState, andareCredentialsReadyTrello card: https://trello.com/c/69abb7e4b94a126e439d0041
🤖 Generated with Claude Code