feat(codegen): multi-step wizard form generation (#121)#127
Open
feat(codegen): multi-step wizard form generation (#121)#127
Conversation
…121) Add FormStep type and optional steps field to FormDescriptor. When steps are defined, codegen produces a wizard-style form with step indicator, Card-wrapped step content, Next/Back/Submit navigation, and per-step field validation using TanStack Form's validateField API. Single-step forms remain unchanged (backward compatible). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Add FormStep to root barrel export (src/index.ts) - Fix per-step validation: use 'submit' cause instead of 'change' to match the onSubmit validator registration - Extract indentJSX helper to reduce duplication - Simplify generateStepContentBlocks with functional patterns - Add generateWizardOutput() test helper to reduce 19-test boilerplate Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Validate step field references: throw when a step references an unknown field name (fail-hard, no silent drops) - Validate field coverage: throw when a form field is not assigned to any step in wizard mode - Replace hardcoded color classes (bg-gray-*, text-gray-*, etc.) with semantic Tailwind tokens (bg-primary, text-muted-foreground, bg-border, etc.) for theme compatibility - Fix ARIA pattern: replace incorrect role="tablist"/role="tab" with nav element and aria-current="step" for sequential wizard progress - Escape step labels and descriptions to prevent broken output from special characters (quotes, angle brackets, etc.) - Add as const to STEPS array for better type inference Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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
FormStepinterface and optionalstepsproperty toFormDescriptorstepsis defined, codegen produces a wizard-style form component with:role="tablist"accessibilityhandleNext()with per-step field validation viaform.validateField()useStatefor step trackingstepsis undefined, existing single-step form generation is unchangedFormStepexported from both introspection barrel and root package barrelTest plan
Closes #121
🤖 Generated with Claude Code