-
Notifications
You must be signed in to change notification settings - Fork 258
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
vibe: add context provider for email state in onboarding #4306
base: main
Are you sure you want to change the base?
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
1 Skipped Deployment
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This pull request refactors the handling of email state in the authentication flows by introducing an AuthDataContext and updating related components to use the new context provider. Key changes include:
- Creation of AuthDataContext and AuthDataProvider to manage email state.
- Removal of the email prop from several authentication components and replacing it with useAuthData().
- Minor formatting and syntax fixes in UI components (e.g., HTML entity corrections).
Reviewed Changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated no comments.
Show a summary per file
File | Description |
---|---|
packages/shared/src/contexts/AuthDataContext.tsx | New context provider for centralized email state management. |
packages/shared/src/components/auth/AuthOptions.tsx | Updated to wrap content with AuthDataProvider and use email state from context. |
packages/shared/src/components/auth/RegistrationForm.tsx | Removed email prop and switched to context usage. |
packages/shared/src/components/auth/ForgotPasswordForm.tsx | Updated to use context for email state and set email on send. |
packages/shared/src/components/auth/CodeVerificationForm.tsx | Replaced initialEmail prop with context state for email. |
packages/shared/src/components/auth/EmailCodeVerification.tsx | Removed email prop and now accesses email state via context. |
Comments suppressed due to low confidence (1)
packages/shared/src/components/auth/AuthOptions.tsx:190
- [nitpick] Consider renaming 'AuthOptionsWithContext' to a more descriptive name (e.g., 'AuthOptionsProviderWrapper') to clearly convey its role in wrapping the auth options with the AuthDataContext.
function AuthOptionsWithContext() {
Co-authored-by: Ole-Martin Bratteng <[email protected]>
|
||
logEvent({ | ||
event_name: AuthEventNames.SignupSuccessfully, | ||
function AuthOptionsWithContext() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not even a useCallback or useMemo on this 🙈
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR introduces a new context provider (AuthDataProvider) to manage email state consistently during onboarding and related authentication flows. Key changes include:
- Adding the AuthDataContext to encapsulate email state and its updater.
- Refactoring authentication and onboarding components (ForgotPasswordForm, RegistrationForm, CodeVerificationForm, EmailCodeVerification) to use the context instead of receiving the email value directly.
- Updating tests and page components (e.g. verification.tsx, onboarding.tsx) to wrap the affected components with AuthDataProvider.
Reviewed Changes
Copilot reviewed 13 out of 13 changed files in this pull request and generated no comments.
Show a summary per file
File | Description |
---|---|
packages/shared/src/contexts/AuthDataContext.tsx | New provider for managing email state across authentication flows. |
packages/shared/src/components/auth/common.tsx | Added AuthDisplay enum and updated type imports for consistency. |
packages/shared/src/components/auth/ForgotPasswordForm.spec.tsx | Updated tests to wrap ForgotPasswordForm with AuthDataProvider. |
packages/shared/src/components/auth/RegistrationForm.tsx | Removed redundant email prop and now sourcing from AuthDataContext. |
packages/webapp/pages/verification.tsx | Updated page to wrap EmailCodeVerification with AuthDataProvider. |
packages/shared/src/components/auth/ForgotPasswordForm.tsx | Refactored to use context-provided email and update it via setEmail(). |
packages/shared/src/components/auth/CodeVerificationForm.tsx | Updated to source email from AuthDataContext. |
packages/shared/src/components/auth/EmailCodeVerification.tsx | Simplified by removing email prop, now using useAuthData(). |
packages/shared/src/components/onboarding/OnboardingHeader.tsx | Updated import for AuthDisplay to the new common module. |
packages/webapp/pages/onboarding.tsx | Updated imports to use auth/common and remove deprecated props. |
packages/shared/src/components/auth/AuthenticationBanner.tsx | Updated AuthOptions and AuthDisplay imports for consistency. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks amazing! I'm assuming the AuthOptionsInner is basically just the AuthOptions without any change, except maybe the email management.
@sshanzel correct :) just needed to wrap to get the hook in there. |
Changes
Vibe coding made some changes to keep email in onboarding context
Events
Did you introduce any new tracking events?
Experiment
Did you introduce any new experiments?
Manual Testing
Caution
Please make sure existing components are not breaking/affected by this PR
Preview domain
https://vibe-auth-context.preview.app.daily.dev