fix(01): revise plans based on checker feedback
- Split Plan 05 (5 tasks → 2 tasks): password reset request interface - Split Plan 06 (5 tasks → 2 tasks): created Plans 06-09 for focused scope - Fixed Plan 06 wave assignment: Wave 4 → Wave 3 (depends only on Wave 2) - Created Plan 07: password reset navigation and deep linking - Created Plan 08: authentication pages error handling - Created Plan 09: auth components error display and loading feedback - Updated Plan 07 → Plan 10: logout and verification - Updated ROADMAP.md with 10 plans in 4 waves - All plans now have 2-3 tasks as recommended
This commit is contained in:
@@ -2,48 +2,35 @@
|
||||
phase: 01-authentication
|
||||
plan: 06
|
||||
type: execute
|
||||
wave: 4
|
||||
depends_on: ["01-03", "01-04"]
|
||||
files_modified: ["lib/features/authentication/presentation/pages/login_page.dart", "lib/features/authentication/presentation/pages/signup_page.dart", "lib/features/authentication/presentation/pages/reset_password_page.dart", "lib/features/authentication/presentation/widgets/auth_form.dart"]
|
||||
wave: 3
|
||||
depends_on: ["01-05"]
|
||||
files_modified: ["lib/features/authentication/presentation/pages/update_password_page.dart", "lib/features/authentication/data/repositories/auth_repository_impl.dart"]
|
||||
autonomous: true
|
||||
user_setup: []
|
||||
|
||||
must_haves:
|
||||
truths:
|
||||
- "Login errors distinguish invalid password vs account not found"
|
||||
- "Signup errors show specific failure reasons"
|
||||
- "Password reset errors provide helpful guidance"
|
||||
- "Loading states show during all auth operations"
|
||||
- "Success messages provide clear confirmation"
|
||||
- "Reset link redirects to password update page"
|
||||
- "User can set new password successfully"
|
||||
artifacts:
|
||||
- path: "lib/features/authentication/presentation/pages/login_page.dart"
|
||||
provides: "Login with error handling"
|
||||
min_lines: 50
|
||||
- path: "lib/features/authentication/presentation/pages/signup_page.dart"
|
||||
provides: "Signup with error handling"
|
||||
min_lines: 50
|
||||
- path: "lib/features/authentication/presentation/pages/reset_password_page.dart"
|
||||
provides: "Password reset with error handling"
|
||||
min_lines: 45
|
||||
- path: "lib/features/authentication/presentation/widgets/auth_form.dart"
|
||||
provides: "Enhanced form with error display"
|
||||
- path: "lib/features/authentication/presentation/pages/update_password_page.dart"
|
||||
provides: "New password entry page"
|
||||
min_lines: 40
|
||||
- path: "lib/features/authentication/data/repositories/auth_repository_impl.dart"
|
||||
provides: "Enhanced auth repository with password reset"
|
||||
min_lines: 60
|
||||
key_links:
|
||||
- from: "lib/features/authentication/presentation/pages/login_page.dart"
|
||||
to: "lib/core/errors/auth_exceptions.dart"
|
||||
via: "error type checking"
|
||||
pattern: "InvalidCredentialsException|UserNotFoundException"
|
||||
- from: "lib/features/authentication/presentation/widgets/auth_form.dart"
|
||||
to: "lib/features/authentication/presentation/pages/login_page.dart"
|
||||
via: "error state communication"
|
||||
pattern: "error.*text|displayError"
|
||||
- from: "lib/features/authentication/presentation/pages/update_password_page.dart"
|
||||
to: "supabase.auth"
|
||||
via: "password update flow"
|
||||
pattern: "supabase\\.auth\\.updateUser|supabase\\.auth\\.resetPasswordForEmail"
|
||||
---
|
||||
|
||||
<objective>
|
||||
Integrate comprehensive error handling and user feedback in authentication flows.
|
||||
Implement password update page and enhance repository for complete reset flow.
|
||||
|
||||
Purpose: Provide clear, actionable error messages for all authentication scenarios to meet success criteria.
|
||||
Output: Authentication system with proper error handling, loading states, and user-friendly feedback.
|
||||
Purpose: Enable users to set new passwords from reset email links with proper validation.
|
||||
Output: Password update interface with deep link handling and repository enhancements.
|
||||
</objective>
|
||||
|
||||
<execution_context>
|
||||
@@ -61,131 +48,62 @@ Output: Authentication system with proper error handling, loading states, and us
|
||||
<tasks>
|
||||
|
||||
<task type="auto">
|
||||
<name>Enhance login page with error handling</name>
|
||||
<files>lib/features/authentication/presentation/pages/login_page.dart</files>
|
||||
<name>Create password update page</name>
|
||||
<files>lib/features/authentication/presentation/pages/update_password_page.dart</files>
|
||||
<action>
|
||||
Update LoginPage to:
|
||||
1. Connect to AuthProvider for authentication
|
||||
2. Handle loading states during login attempts
|
||||
3. Display specific error messages based on exception type:
|
||||
- "Invalid password" for InvalidCredentialsException
|
||||
- "Account not found" for UserNotFoundException
|
||||
- "Network error" for NetworkException
|
||||
- "Session expired" for SessionExpiredException
|
||||
- Generic error message for unknown errors
|
||||
4. Show success message and navigate on successful login
|
||||
5. Disable form inputs during submission
|
||||
6. Include accessibility error announcements
|
||||
7. Add proper error disposal when user starts typing again
|
||||
8. Handle edge cases like empty form submission
|
||||
9. Include proper error styling and positioning
|
||||
Create UpdatePasswordPage that:
|
||||
1. Handles deep linking from password reset emails
|
||||
2. Has new password input field with strength validation
|
||||
3. Has confirm password field for validation
|
||||
4. Uses AuthButton for "Update Password" action
|
||||
5. Shows error messages for password mismatches
|
||||
6. Shows loading state during password update
|
||||
7. Navigates to login after successful password update
|
||||
8. Handles expired/invalid reset tokens gracefully
|
||||
9. Uses Supabase updateUser() method
|
||||
10. Has proper error handling for various failure modes
|
||||
11. Includes accessibility features
|
||||
12. Has clear success messaging
|
||||
13. Includes "Cancel" option to return to login
|
||||
</action>
|
||||
<verify>Login page shows specific error messages for different failure scenarios and handles loading states properly</verify>
|
||||
<done>Login page with comprehensive error handling and user feedback</done>
|
||||
<verify>Password update page validates inputs, updates password successfully, and handles error cases</verify>
|
||||
<done>Complete password update interface with deep link handling</done>
|
||||
</task>
|
||||
|
||||
<task type="auto">
|
||||
<name>Enhance signup page with error handling</name>
|
||||
<files>lib/features/authentication/presentation/pages/signup_page.dart</files>
|
||||
<name>Update auth repository for password reset</name>
|
||||
<files>lib/features/authentication/data/repositories/auth_repository_impl.dart</files>
|
||||
<action>
|
||||
Update SignupPage to:
|
||||
1. Connect to AuthProvider for registration
|
||||
2. Handle loading states during signup attempts
|
||||
3. Display specific error messages:
|
||||
- "Email already in use" for EmailAlreadyInUseException
|
||||
- "Password too weak" for WeakPasswordException
|
||||
- "Invalid email format" for validation errors
|
||||
- "Network error" for NetworkException
|
||||
- Generic error message for unknown errors
|
||||
4. Show password mismatch error before submission
|
||||
5. Show success message on successful registration
|
||||
6. Navigate to login after successful signup
|
||||
7. Disable form inputs during submission
|
||||
8. Include accessibility error announcements
|
||||
9. Add proper error disposal when user starts typing again
|
||||
10. Handle terms acceptance (placeholder)
|
||||
Extend AuthRepositoryImpl to:
|
||||
1. Add updatePassword() method for new password setting
|
||||
2. Handle password reset token verification
|
||||
3. Improve resetPassword() method with proper redirect URL configuration
|
||||
4. Add proper error handling for:
|
||||
- Expired reset tokens
|
||||
- Invalid reset tokens
|
||||
- Weak passwords
|
||||
- Network failures
|
||||
5. Use supabase.auth.updateUser() for password updates
|
||||
6. Ensure proper session handling after password update
|
||||
7. Add comprehensive error mapping to custom exceptions
|
||||
8. Include proper logging for debugging
|
||||
</action>
|
||||
<verify>Signup page provides specific feedback for all registration scenarios and validates password matching</verify>
|
||||
<done>Signup page with comprehensive error handling and validation feedback</done>
|
||||
</task>
|
||||
|
||||
<task type="auto">
|
||||
<name>Enhance password reset pages with error handling</name>
|
||||
<files>lib/features/authentication/presentation/pages/reset_password_page.dart</files>
|
||||
<action>
|
||||
Update ResetPasswordPage to:
|
||||
1. Handle loading states during email sending
|
||||
2. Display specific error messages:
|
||||
- "Email not found" for UserNotFoundException
|
||||
- "Too many requests" for rate limiting
|
||||
- "Network error" for NetworkException
|
||||
- Generic error message for unknown errors
|
||||
3. Show success message with clear instructions
|
||||
4. Display countdown before resend is allowed (if needed)
|
||||
5. Include accessibility error announcements
|
||||
6. Add proper error disposal when user changes email
|
||||
7. Handle edge cases like empty email submission
|
||||
8. Provide helpful error recovery instructions
|
||||
9. Show proper loading indicators
|
||||
</action>
|
||||
<verify>Password reset page handles all error scenarios and provides clear user guidance</verify>
|
||||
<done>Password reset page with comprehensive error handling and user guidance</done>
|
||||
</task>
|
||||
|
||||
<task type="auto">
|
||||
<name>Enhance auth components with error display</name>
|
||||
<files>lib/features/authentication/presentation/widgets/auth_form.dart</files>
|
||||
<action>
|
||||
Update AuthForm to:
|
||||
1. Accept optional error message prop
|
||||
2. Display error messages below relevant fields
|
||||
3. Style errors appropriately (red text, icons if needed)
|
||||
4. Include accessibility announcements for errors
|
||||
5. Auto-clear errors when user starts typing
|
||||
6. Handle field-specific vs form-wide errors
|
||||
7. Provide clear error positioning and styling
|
||||
8. Include proper error boundaries
|
||||
9. Support error recovery guidance
|
||||
10. Maintain consistency across all auth forms
|
||||
</action>
|
||||
<verify>Auth form components display errors clearly and handle error state transitions properly</verify>
|
||||
<done>Enhanced auth form components with integrated error display functionality</done>
|
||||
</task>
|
||||
|
||||
<task type="auto">
|
||||
<name>Add success feedback and loading indicators</name>
|
||||
<files>lib/features/authentication/presentation/widgets/auth_button.dart</files>
|
||||
<action>
|
||||
Update AuthButton to:
|
||||
1. Show loading spinner when in loading state
|
||||
2. Disable button during loading
|
||||
3. Change button text during loading (e.g., "Signing In...")
|
||||
4. Add success state feedback (brief color change or checkmark)
|
||||
5. Include haptic feedback on mobile (if available)
|
||||
6. Add accessibility labels for loading state
|
||||
7. Prevent double-tap during submission
|
||||
8. Add proper visual transitions between states
|
||||
9. Maintain consistent loading behavior across all auth buttons
|
||||
10. Include error state styling if needed
|
||||
</action>
|
||||
<verify>Auth button provides clear loading feedback and prevents user confusion during submission</verify>
|
||||
<done>Enhanced auth button with comprehensive state feedback</done>
|
||||
<verify>Repository methods handle password reset flow from email to completion</verify>
|
||||
<done>Enhanced auth repository with complete password reset functionality</done>
|
||||
</task>
|
||||
|
||||
</tasks>
|
||||
|
||||
<verification>
|
||||
1. Login attempts show specific error messages for invalid password vs account not found
|
||||
2. Registration attempts show specific error messages for email conflicts, weak passwords, etc.
|
||||
3. Password reset requests handle all error scenarios with helpful guidance
|
||||
4. Loading states appear consistently during all authentication operations
|
||||
5. Error messages disappear when user takes corrective action
|
||||
6. Success feedback is clear and appropriate
|
||||
7. Accessibility features announce errors and state changes properly
|
||||
1. Password update page validates inputs and updates password successfully
|
||||
2. Reset email contains working deep link to password update page
|
||||
3. Error handling covers all failure scenarios (expired tokens, weak passwords, etc.)
|
||||
4. Deep linking works on both mobile and web platforms
|
||||
5. Navigation flows correctly from password update to login
|
||||
</verification>
|
||||
|
||||
<success_criteria>
|
||||
Authentication system with comprehensive error handling that meets all 5 success criteria for clear, actionable user feedback.
|
||||
Password update system working with deep link handling, validation, and repository integration.
|
||||
</success_criteria>
|
||||
|
||||
<output>
|
||||
|
||||
Reference in New Issue
Block a user