fix(onboarding): surface why 'Complete Profile' is blocked (dead-button bug)#372
Merged
Conversation
… silent no-op On Step 3 the navy 'Complete Profile' button could look active yet do nothing: react-hook-form's handleSubmit swallowed zod validation failures, and handleComplete silently returned if an agreement wasn't set. The user got a dead button with no explanation. - Wire an onInvalid handler + testable profileSubmitBlockMessage() that maps the first failing field to friendly guidance (photo / address / name / agreements), shown in an Alert. - Replace the silent agreements return with the same visible message. - Clear the message on step navigation. This makes the failure visible (and, on the next attempt, tells us exactly which field is blocking — see the draft-serialization suspicion in the PR). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This was referenced Jul 1, 2026
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.
Bug (found in testing, on production)
On Step 3 of the profile wizard, the navy "Complete Profile" button looked active but did nothing — no submit, no error, no redirect. A dead end.
Why
Two silent-failure paths:
handleSubmit(handleComplete)had noonInvalidhandler, so any zod schema failure was swallowed —handleCompletenever ran and nothing was shown.handleCompleteitself did a barereturnif an agreement wasn't set.Crucially, the button's enabled-check (
canProceed = hasVerifiedAddress && Boolean(profilePicture)) does not match what submission actually validates, so the button can be enabled while the submit is impossible.This PR (the visible-feedback fix)
profileSubmitBlockMessage(errors)that maps the first failing field → friendly guidance (photo / address / name / agreements).onInvalidhandler and reuses it for the agreements guard; shows the message in a dismissibleAlert. Clears on step navigation.Result: the button can never again silently do nothing — it either submits or tells you exactly what's missing.
Lead hypothesis for the underlying field (to confirm next)
Strong suspicion: the async user-load in
ProfileCreationHandlertriggersmethods.reset(draft)mid-flow, and the draft's JSON-serializedprofilePicture(aFile→{}) clobbers the in-memory File.Boolean({})is truthy → button stays navy, butz.instanceof(File)fails → silent block. Timing/network-dependent, which fits why it hit mobile intermittently and left the user stuck on Step 3 (activeStep isn't reset).This PR makes that failure visible (it'll now say "Please add a profile photo"). Once we confirm the surfaced message in testing, the targeted root-cause fix is to stop the draft restore from clobbering an in-progress form (exclude the
Filefrom the persisted draft / guard the one-time load). Kept separate to avoid shipping a speculative draft-system change unverified.Verification
tsc, eslint, and the new + existing wizard unit tests pass.🤖 Generated with Claude Code