Skip to content

STA-13: Debounced founder validation with inline input status icons - #53

Merged
gertsio merged 2 commits into
mainfrom
agent/STA-13-resolve-founder-ens
Feb 23, 2026
Merged

STA-13: Debounced founder validation with inline input status icons#53
gertsio merged 2 commits into
mainfrom
agent/STA-13-resolve-founder-ens

Conversation

@gertsio

@gertsio gertsio commented Feb 23, 2026

Copy link
Copy Markdown
Collaborator

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:

  • New resolveFounderIdentityAction server action validates ENS names and resolves them to addresses
  • Per-keystroke validation with 350ms debounce prevents excessive API calls
  • Version tracking system guards against stale responses when user types quickly
  • Inline UI feedback (spinner/check/error icons) replaces row-level text blocks
  • Submit button disabled until all founders have valid, resolved addresses
  • Preserves submit-time re-validation as safety check before registration

Quality:

  • Comprehensive test coverage for new validation logic and debounce behavior
  • Proper cleanup of timers on unmount and founder removal
  • Handles race conditions with version-based stale response detection

Confidence Score: 4/5

  • Safe to merge with minor attention to complex async validation logic
  • Well-tested implementation with comprehensive test coverage for both client and server logic. Proper handling of race conditions and stale responses. The version-tracking system prevents most edge cases. Docking one point due to the complexity of the async validation orchestration in setup-wizard.tsx which warrants careful testing in production.
  • Pay attention to src/app/(app)/dashboard/setup/components/setup-wizard.tsx - the validation orchestration is complex with multiple effects and async operations

Important Files Changed

Filename Overview
src/app/(app)/dashboard/setup/actions.ts Added resolveFounderIdentityAction server action to validate ENS names and addresses. Clean implementation with proper error handling.
src/app/(app)/dashboard/setup/components/founder-validation-utils.ts New utility module for debounced validation with timer management and stale-response guards. Well-tested with testable setTimeout/clearTimeout injection.
src/app/(app)/dashboard/setup/components/setup-wizard.tsx Complex debounced validation logic with version tracking and stale-response guards. Properly syncs validation state with form rows and prevents submission with unresolved identities.

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()
Loading

Last reviewed commit: 669e816

@vercel

vercel Bot commented Feb 23, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
startupchain Error Error Feb 23, 2026 3:57am

@greptile-apps greptile-apps Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

6 files reviewed, no comments

Edit Code Review Agent Settings | Greptile

@gertsio
gertsio merged commit c34d0f6 into main Feb 23, 2026
3 of 5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant