-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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
feat: add modal on get started page for onboarding experiment v2 #5401
Conversation
✅ Deploy Preview for dev-web-novu ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
✅ Deploy Preview for novu-design ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
apps/web/src/pages/quick-start/components/OnboardingExperimentModal.tsx
Outdated
Show resolved
Hide resolved
apps/web/src/pages/quick-start/components/OnboardingExperimentModal.tsx
Outdated
Show resolved
Hide resolved
apps/web/src/pages/quick-start/components/OnboardingExperimentModal.tsx
Outdated
Show resolved
Hide resolved
apps/web/src/pages/quick-start/components/OnboardingExperimentModal.tsx
Outdated
Show resolved
Hide resolved
apps/web/src/pages/quick-start/components/OnboardingExperimentModal.tsx
Outdated
Show resolved
Hide resolved
const [clickedChannel, setClickedChannel] = useState<{ | ||
open: boolean; | ||
channelType?: ChannelTypeEnum; | ||
}>({ open: false }); | ||
|
||
const isNovuProd = !IS_DOCKER_HOSTED && ENV === 'production'; | ||
// open modal only for prod users | ||
const isOnboardingModalEnabled = isNovuProd && localStorage.getItem('onboarding_modal') === 'true'; |
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.
why do we only show this for prod users? how we test it locally?
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.
onboarding workflow to work requires Novu provider enabled. In local machine, novu email provider is not possible to enable. I added this check to avoid that case. Only way to test in local machine is to remove this condition
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.
novu email provider is not possible to enable
that's not true ;) I do have it enabled ;)
@coderabbitai review |
WalkthroughThis update enhances the web application's performance and user experience. Memory allocation for Node.js processes has been increased to improve efficiency during start and build operations. New features include storing data in local storage post-organization creation and introducing an Changes
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (invoked as PR comments)
Additionally, you can add CodeRabbit Configration File (
|
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.
Actionable comments posted: 2
const isNovuProd = !IS_DOCKER_HOSTED && ENV === 'production'; | ||
// open modal only for prod users | ||
const isOnboardingModalEnabled = isNovuProd && localStorage.getItem('onboarding_modal') === 'true'; | ||
|
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.
The logic to enable the onboarding modal only for production users might limit the ability to test this feature in non-production environments. Consider adding a configuration or feature flag to enable testing in other environments.
export function OnboardingExperimentModal() { | ||
const [opened, setOpened] = useState(true); | ||
const theme = useMantineTheme(); | ||
const segment = useSegment(); | ||
const { currentOrganization } = useAuthContext(); | ||
const { | ||
createOnboardingExperimentWorkflow, | ||
isLoading: IsCreateOnboardingExpWorkflowLoading, | ||
isDisabled: isIsCreateOnboardingExpWorkflowDisabled, | ||
} = useCreateOnboardingExperimentWorkflow(); | ||
const handleOnClose = () => { | ||
setOpened(true); | ||
}; |
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.
The modal component is initialized with the opened
state set to true
and never set to false
in handleOnClose
. This might prevent the modal from closing as expected. Consider setting opened
to false
in the handleOnClose
function.
- setOpened(true);
+ setOpened(false);
Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation.
export function OnboardingExperimentModal() { | |
const [opened, setOpened] = useState(true); | |
const theme = useMantineTheme(); | |
const segment = useSegment(); | |
const { currentOrganization } = useAuthContext(); | |
const { | |
createOnboardingExperimentWorkflow, | |
isLoading: IsCreateOnboardingExpWorkflowLoading, | |
isDisabled: isIsCreateOnboardingExpWorkflowDisabled, | |
} = useCreateOnboardingExperimentWorkflow(); | |
const handleOnClose = () => { | |
setOpened(true); | |
}; | |
export function OnboardingExperimentModal() { | |
const [opened, setOpened] = useState(true); | |
const theme = useMantineTheme(); | |
const segment = useSegment(); | |
const { currentOrganization } = useAuthContext(); | |
const { | |
createOnboardingExperimentWorkflow, | |
isLoading: IsCreateOnboardingExpWorkflowLoading, | |
isDisabled: isIsCreateOnboardingExpWorkflowDisabled, | |
} = useCreateOnboardingExperimentWorkflow(); | |
const handleOnClose = () => { | |
setOpened(false); | |
}; |
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.
setOpened(false)
in handleOnClose
will allow the user to close modal by clicking outside the modal. As per experiment requirement, modal should be closed only when anyof the buttons are clicked
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.
@jainpawan21, thank you for clarifying the intended behavior of the modal. It makes sense to restrict the modal closure to button clicks only, in line with the experiment's requirements. If there's anything else that needs to be adjusted or if you have further instructions, please let me know!
New Learnings Added
User: jainpawan21"
URL: https://github.com/novuhq/novu/pull/5401
Timestamp: 2024-04-12T10:38:28.678Z
Learning: The `OnboardingExperimentModal` should only be closed through button clicks as per the experiment requirements, not by clicking outside the modal.
Note: Learnings are effective only in the context of specific code segments. To apply general coding guidelines, please configure review instructions.
null, | ||
2 | ||
).replaceAll('\n', '\n ')}' | ||
--header 'Authorization: ApiKey <REPLACE_WITH_API_KEY>' \\ |
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.
Fixed code indentation for both nodejs and curl
Before 👇🏻
Screen.Recording.2024-04-12.at.5.10.02.PM.mov
After 👇🏻
Screen.Recording.2024-04-12.at.5.09.42.PM.mov
feat: add modal on get started page for onboarding experiment v2
What change does this PR introduce?
https://www.loom.com/share/175725f4dd354202a5295ca1b80fa46a
Why was this change needed?
Onboarding Experiment V2
Other information (Screenshots)
Slack Conversation
Summary by CodeRabbit
New Features
OnboardingExperimentModal
for enhanced user onboarding experience.Improvements
WorkflowEditor
to 'Trigger Notification' for clarity under specific conditions.Performance Enhancements