Skip to content

Conversation

@hlbmtc
Copy link
Contributor

@hlbmtc hlbmtc commented Nov 21, 2024

  • Implemented persistent onboarding tracking stored in the User.is_onboarding_complete property, ensuring it remains until the user fully completes onboarding. Skipping temporarily hides it until the page is revisited.
  • Added an onboarding screen for both the homepage and the questions feed.
    Introduced a UX improvement to prevent the onboarding screen from appearing if the user skips it on the previous page. - - This resolves cases where a user skips onboarding on the homepage, navigates to the questions feed, and sees the onboarding screen again.
  • Deprecated old ?start_onboarding=true trigger
  • Enabled onboarding flow reactivation for all routes

closes #1454

@hlbmtc hlbmtc marked this pull request as ready for review November 22, 2024 10:42
// Checks if the hook has already been refreshed.
// Sometimes, it takes a moment for useNavigation to update from the previous route's values,
// so we need to perform this check to ensure we have updated values of previousPath
const hookUpdated = currentPath === pathname;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ncarazon This one is kinda workaround, could you please tell me if it's ok?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The workaround looks legit. However, I see another potential issue with the logic to skip the onboarding flow: the onboarding flow will still be triggered after skipping it if navigated from a route different from home or questions feed. For example: home -> tournaments -> questions. Is it expected? Ideally, we would utilize React Context, that would store a flag for skipping the onboarding. This could also simplify the code of OnboardingCheck, as we wouldn't need to update previousPathHasTutorial each time we want to add an onboarding trigger on a new page.

Copy link
Contributor Author

@hlbmtc hlbmtc Nov 22, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, this is what @SylvainChevalier wanted: we should encourage users to complete onboarding if they have not, so I assume we do like to show onboarding again.

This specific fix is just about not showing onboarding on the next consequent page with onboarding component

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In that case, could we slightly refactor OnboardingCheck so this component would be the only place where onboarding triggers would be defined? Right now, if we want to add a new route to onboarding triggers, we would need to render the OnboardingCheck component on the page and additionally update the path array in previousPathHasTutorial. This may not be obvious for other engineers, so ideally, we would move OnboardingCheck into the root layout and trigger the onboarding modal based on the current path.

I don't think this is a blocker for merging though, so I'm approving. You can create a technical issue to do the refactor and assign it to me if you want. I'll handle it when there is time.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ncarazon It turned out skip button should permanently hide this tutorial, so no need to have this advanced previous page check. Thus, we don't need to hardcode list of pathes where this is used, so I assume we can keep this component as is without root layout

// Checks if the hook has already been refreshed.
// Sometimes, it takes a moment for useNavigation to update from the previous route's values,
// so we need to perform this check to ensure we have updated values of previousPath
const hookUpdated = currentPath === pathname;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In that case, could we slightly refactor OnboardingCheck so this component would be the only place where onboarding triggers would be defined? Right now, if we want to add a new route to onboarding triggers, we would need to render the OnboardingCheck component on the page and additionally update the path array in previousPathHasTutorial. This may not be obvious for other engineers, so ideally, we would move OnboardingCheck into the root layout and trigger the onboarding modal based on the current path.

I don't think this is a blocker for merging though, so I'm approving. You can create a technical issue to do the refactor and assign it to me if you want. I'll handle it when there is time.

- Onboarding "Remind Me Later" button suppresses modal for 1 day
Copy link
Contributor

@ncarazon ncarazon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

# Conflicts:
#	front_end/src/app/(main)/components/mobile_menu.tsx
@hlbmtc hlbmtc merged commit 6080c89 into main Nov 25, 2024
2 checks passed
@hlbmtc hlbmtc deleted the feat/1454-onboarding-persistence branch November 25, 2024 19:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Make onboarding trigger when first visiting feed or homepage

4 participants