STA-13: Debounced founder validation with inline input status icons - #53
Merged
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
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\n- add founder identity resolver action for ENS/address validation\n- switch setup founder validation to debounced per-keystroke flow (350ms)\n- add stale-response guard with per-founder request versions\n- replace row-level validation text blocks with inline input-end icons (spinner/check/error)\n- keep submit-time safety validation and resolved-address-only payloads\n\n## Testing\n- yarn vitest run src/app/(app)/dashboard/setup/components/founder-validation-utils.test.ts src/app/(app)/dashboard/setup/actions.test.ts\n- yarn check\n\n## Notes\n- preserves existing registration/onchain flow behavior\n- existing unrelated lint warnings remain outside this PR scope
Greptile Summary
Adds real-time debounced founder validation with inline status icons, replacing the previous submit-time validation approach.
Key changes:
resolveFounderIdentityActionserver action validates ENS names and resolves them to addressesQuality:
Confidence Score: 4/5
src/app/(app)/dashboard/setup/components/setup-wizard.tsx- the validation orchestration is complex with multiple effects and async operationsImportant Files Changed
resolveFounderIdentityActionserver action to validate ENS names and addresses. Clean implementation with proper error handling.Sequence Diagram
sequenceDiagram participant User participant FoundersForm participant SetupWizard participant ValidationUtils participant ServerAction participant ENS User->>FoundersForm: Types ENS/address FoundersForm->>SetupWizard: onFounderInputChange() SetupWizard->>SetupWizard: Update draft state SetupWizard->>SetupWizard: Set validation to 'idle' SetupWizard->>ValidationUtils: scheduleFounderValidation() Note over ValidationUtils: Debounce 350ms User->>FoundersForm: Types more characters FoundersForm->>SetupWizard: onFounderInputChange() SetupWizard->>ValidationUtils: scheduleFounderValidation() Note over ValidationUtils: Clear previous timer<br/>Start new 350ms timer Note over ValidationUtils: 350ms elapsed ValidationUtils->>SetupWizard: onDebouncedValidate() SetupWizard->>SetupWizard: Set status 'validating' SetupWizard->>ServerAction: resolveFounderIdentityAction() alt Direct 0x address ServerAction-->>SetupWizard: {resolvedAddress, source: 'address'} else ENS name ServerAction->>ENS: getOwner() ENS-->>ServerAction: owner address ServerAction-->>SetupWizard: {resolvedAddress, ensName, source: 'ens'} else Invalid/Error ServerAction-->>SetupWizard: {error, resolvedAddress: null} end SetupWizard->>SetupWizard: Check version & input match alt Current version SetupWizard->>SetupWizard: Apply validation result SetupWizard->>FoundersForm: Update validation state FoundersForm->>User: Show icon (check/error/spinner) else Stale version SetupWizard->>SetupWizard: Discard result end User->>FoundersForm: Click "Create Business" FoundersForm->>SetupWizard: handleCreateBusiness() SetupWizard->>SetupWizard: Validate all founders SetupWizard->>ServerAction: resolveFounderIdentityAction() x N ServerAction-->>SetupWizard: All resolved addresses SetupWizard->>SetupWizard: initializeRegistration()Last reviewed commit: 669e816