From 3833625bde13bde2b968086bc1fe57a9055d0c5f Mon Sep 17 00:00:00 2001 From: "shakespeare.diy" Date: Thu, 3 Sep 2026 18:32:08 +0700 Subject: [PATCH] Signup: require a display name (changeable later), remove skip MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Per request, a display name is now mandatory when signing up: - Removed the "Skip for now" button from the profile step — the only forward path is Save, which is disabled until a non-empty name is entered. - Marked the field required (*), added helper copy ("Required — how you'll show up across SkateSpots. Change it anytime."), and a hint under the button. - finishSignup guards against an empty/whitespace name (defense-in-depth for keyboard/Enter), trims the name before publishing kind 0. - Reworded the step copy: name required, bio + avatar still optional. Only affects the primary nsec signup dialog (also the endpoint the mnemonic flow feeds into); the mnemonic dialog has no name step. Co-authored-by: shakespeare.diy --- src/components/auth/SignupDialog.tsx | 56 ++++++++++++++++------------ 1 file changed, 32 insertions(+), 24 deletions(-) diff --git a/src/components/auth/SignupDialog.tsx b/src/components/auth/SignupDialog.tsx index e224d85..c2cd7ff 100644 --- a/src/components/auth/SignupDialog.tsx +++ b/src/components/auth/SignupDialog.tsx @@ -152,14 +152,26 @@ const SignupDialog: React.FC = ({ isOpen, onClose, onComplete }; const finishSignup = async (skipProfile = false) => { + // A display name is mandatory (changeable later). Guard here too so the step + // can't be completed without one, even via keyboard/Enter. + const trimmedName = profileData.name.trim(); + if (!skipProfile && !trimmedName) { + toast({ + title: 'Display name required', + description: 'Pick a display name so other skaters know who you are. You can change it anytime.', + variant: 'destructive', + }); + return; + } + // Mark signup completion time for fallback welcome modal localStorage.setItem('signup_completed', Date.now().toString()); try { // Publish profile if user provided information - if (!skipProfile && (profileData.name || profileData.about || profileData.picture)) { + if (!skipProfile && (trimmedName || profileData.about || profileData.picture)) { const metadata: Record = {}; - if (profileData.name) metadata.name = profileData.name; + if (trimmedName) metadata.name = trimmedName; if (profileData.about) metadata.about = profileData.about; if (profileData.picture) metadata.picture = profileData.picture; @@ -365,11 +377,11 @@ const SignupDialog: React.FC = ({ isOpen, onClose, onComplete

- You're in! 🛹 Add a name so skaters know who you are + You're in! 🛹 Pick a display name so skaters know who you are

- This is optional — you can skip it and fill it in later. + You can change it anytime later. Bio and avatar are optional.

@@ -390,16 +402,22 @@ const SignupDialog: React.FC = ({ isOpen, onClose, onComplete
setProfileData(prev => ({ ...prev, name: e.target.value }))} - placeholder='Your name' + placeholder='e.g. Tony, gnarlyGrind, or your crew name' className='rounded-lg' + maxLength={64} + required + aria-required='true' disabled={isPublishing} /> +

+ Required — how you'll show up across SkateSpots. Change it anytime. +

@@ -456,12 +474,12 @@ const SignupDialog: React.FC = ({ isOpen, onClose, onComplete
- {/* Action buttons */} + {/* Action button — a display name is required to continue. */}
- + {!profileData.name.trim() && !isPublishing && ( +

+ Add a display name to continue. +

+ )}
)}