refactor(client): overhaul gating selection UX, accessibility, and hook stability#29
Conversation
…ok stability Phase 1: Migrate useJarCreation from manual useState to React Hook Form + Zod - Extract jarCreationSchema.ts with METHOD_TO_ACCESS_TYPE mapping - Replace ~15 useState calls with useForm + zodResolver - Simplify StepContent bridge with lookup instead of 6-case switch Phase 2: Redesign ProtocolSelector UX and consolidate NFTGateInput state - Merge duplicate ConfigurationPanels into one using real protocol components - Add visibleMethods, recommendedMethod props - Replace 11 useState calls in NFTGateInput with typed useReducer - Enhanced useRateLimit with countdown timer and amber UI banner Phase 3: Fix useHats race condition and parallelize ERC detection - Wrap async functions in useCallback with AbortSignal to prevent infinite re-render loops caused by unstable function references in useEffect deps - Add AbortController cleanup to all effects - Remove duplicate cache check in useEnhancedNFTValidation Phase 4: Add ARIA accessibility across all protocol config inputs - ProtocolSelector: role="button", tabIndex, aria-pressed, keyboard handlers - POAPConfig: Convert div onClick to semantic button for search results - ProtocolConfigBase: Add errorId prop + role="alert" on error alerts - All protocol configs: aria-invalid + aria-describedby on inputs - NFTGateInput: aria-label on sliders, remove redundant aria-disabled Phase 5: NFTSelector accessibility and Coming Soon features - NFTCard: role="button", tabIndex, aria-pressed, keyboard handlers - View toggle: aria-label, aria-pressed, role="group" - Skip @tanstack/react-virtual (pagination already bounds DOM nodes) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing touches🧪 Generate unit tests (beta)
Tip Issue Planner is now in beta. Read the docs and try it out! Share your feedback on Discord. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Summary
useJarCreationfrom manualuseStateto React Hook Form + Zod schema validation, extractjarCreationSchema.tswithMETHOD_TO_ACCESS_TYPEmappingProtocolSelectorUX — merge duplicate ConfigurationPanels, consolidateNFTGateInput11useStatecalls into typeduseReducer, add rate limit countdownuseHatsinfinite re-render loop — wrap async functions inuseCallbackwithAbortSignal, addAbortControllercleanup to all effectsrole="button",tabIndex,aria-pressed, keyboard handlers,aria-invalid/aria-describedby, semantic<button>elementsaria-label, skip unnecessary virtualization (pagination already bounds DOM nodes)Test plan
tsc --noEmit)aria-describedbyon all protocol config inputs<button>elements)🤖 Generated with Claude Code