-
Notifications
You must be signed in to change notification settings - Fork 2
fix: Improve UI and fix username validation issues #242
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
- Replace 'CU' logo with proper CodeUnia logo component - Fix username validation to use direct database queries instead of RPC - Remove problematic regex pattern attribute causing console errors - Implement client-side random username generation - Add comprehensive username validation with visual feedback - Improve form styling with modern glassmorphism design - Add username preview and real-time validation indicators - Fix TypeScript errors and improve error handling Resolves console errors and improves user experience
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Caution Review failedThe pull request is closed. WalkthroughRefactors the complete profile page to use profileService, adds client-side username validation and availability checks, introduces a local random username generator, pre-fills data from existing profiles or OAuth metadata, updates submit flow to separately persist profile and completion flags, and overhauls the UI with new status indicators, toasts, and layout. Changes
Sequence Diagram(s)sequenceDiagram
autonumber
actor U as User
participant P as CompleteProfile Page
participant S as profileService
participant DB as Database
%% Initial load
U->>P: Open /complete-profile
P->>S: getProfile(user.id)
alt Profile exists and complete
S-->>P: Profile (complete)
P-->>U: Redirect to dashboard
else Profile exists but incomplete
S-->>P: Profile (incomplete data)
P-->>U: Prefill firstName/lastName/username
else Error / no profile
S-->>P: Error or null
P-->>U: Show empty form
end
%% Username input flow
U->>P: Type username
P->>P: Validate with InputValidator
alt Invalid
P-->>U: Show validation error & X icon
else Valid
P->>DB: Check availability (query)
alt Available
DB-->>P: None found
P-->>U: Show available & ✓ icon
else Taken
DB-->>P: Match found
P-->>U: Show taken & X icon
end
end
%% Random username
U->>P: Click Sparkles (generate)
P->>P: Generate candidate locally
P->>DB: Availability check
DB-->>P: Result
P-->>U: Autofill if available or retry prompt
%% Submit flow
U->>P: Submit form
P->>S: updateProfile(user.id, data)
alt Update ok
S-->>P: Success
P->>DB: Update flags (profile_complete, username_set, username_editable)
alt Flags ok
DB-->>P: Success
P-->>U: Success toast + Redirect to dashboard
else Flags failed
DB-->>P: Error
P-->>U: Partial failure toast (profile saved)
end
else Update failed
S-->>P: Error
P-->>U: Error toast (stay on page)
end
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
Poem
✨ Finishing touches
🧪 Generate unit tests
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (1)
Comment |
- Replace direct database queries with profileService.getProfile() and profileService.updateProfile() - Use same approach as protected area for consistent error handling - Automatically create profile if it doesn't exist (same as protected area) - Fix TypeScript errors by using proper ProfileUpdateData interface - Separate completion status update from basic profile update - Improve error handling and user feedback This ensures the complete-profile page works exactly like the protected area
Resolves console errors and improves user experience
Summary by CodeRabbit
New Features
UI/UX