Skip to content
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

fix: fix progressive onboarding is not showing up #11404

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

dariakoko
Copy link
Contributor

@dariakoko dariakoko commented Jan 16, 2025

This PR resolves []

Description

This PR fixes progressive onboarding. Some of the steps of the onboarding were not showing up blocking the onboarding flow and preventing future work with it.
Slack thread: https://artsy.slack.com/archives/C02BAQ5K7/p1736527757095689

PR Checklist

  • I have tested my changes on iOS and Android.
  • I hid my changes behind a feature flag, or they don't need one.
  • I have included screenshots or videos, or I have not changed the UI.
  • I have added tests, or my changes don't require any.
  • I added an app state migration, or my changes do not require one.
  • I have documented any follow-up work that this PR will require, or it does not require any.
  • I have added a changelog entry below, or my changes do not require one.

To the reviewers 👀

  • I would like at least one of the reviewers to run this PR on the simulator or device.
Changelog updates

Changelog updates

Cross-platform user-facing changes

  • fix progressive onboarding is not showing up

iOS user-facing changes

Android user-facing changes

Dev changes

Need help with something? Have a look at our docs, or get in touch with us.

@@ -339,7 +336,6 @@ const InfiniteScrollArtworksGrid: React.FC<Props & PrivateProps> = ({
const displayToolTip =
enableMyCollectionSellOnboarding &&
isMyCollection &&
!isDismissed(PROGRESSIVE_ONBOARDING_MY_COLLECTION_SELL_THIS_WORK).status &&
Copy link
Contributor Author

Choose a reason for hiding this comment

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

moving this into the MyCollectionArtworkGridItem.tsx to have all logic in one place

Comment on lines +29 to +32
/**
* using ToolTip instead of Popover here because we cannot display a Popover inside
* of a modal (which is where this component is used)
* */
Copy link
Contributor Author

Choose a reason for hiding this comment

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

adding comments for clarity

// we only enable the alerts flow if the save artwork is completed
isDismissed("save-highlight").status &&
isDismissed(PROGRESSIVE_ONBOARDING_SAVE_ARTWORK) &&
Copy link
Contributor Author

Choose a reason for hiding this comment

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

replacing the strings here because save-highlight is no longer in use and is removed in this PR

Comment on lines -137 to -146
export const ArtworkListsQR = () => {
useDismissSavedHighlight()

return (
<Suspense fallback={<ArtworkListsPlaceHolder />}>
<ArtworkLists />
</Suspense>
)
}

Copy link
Contributor Author

Choose a reason for hiding this comment

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

not used anywhere - removing

@dariakoko
Copy link
Contributor Author

I am removing the isActive variable because for me it was always false because isActivePopover is always undefined. If you prefer to keep it, would love to hear your thoughts on how to make it work better 🙏

Copy link
Contributor

@olerichter00 olerichter00 left a comment

Choose a reason for hiding this comment

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

Thanks for all the code cleaning! 🧹

Do you know the purpose of isActive? Understanding would be great to avoid issues when we remove it.

@@ -54,7 +54,7 @@ describe("ProgressiveOnboardingSaveAlert", () => {
__globalStoreTestUtils__?.injectState({
progressiveOnboarding: {
sessionState: { isReady: true },
dismissed: [{ key: "save-highlight", timestamp: Date.now() }],
dismissed: [{ key: "offer-settings", timestamp: Date.now() }],
Copy link
Contributor

Choose a reason for hiding this comment

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

👀

Copy link
Contributor Author

Choose a reason for hiding this comment

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

save-highlight is no longer used, the previously dismissed popover has to be offer-settings

Copy link
Contributor Author

Choose a reason for hiding this comment

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

or are you referring to the string used instead of the const?


const handleDismiss = () => {
setIsReady(false)
dismiss("alert-create")
dismiss(PROGRESSIVE_ONBOARDING_ALERT_CREATE)
Copy link
Contributor

Choose a reason for hiding this comment

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

🙏

@dariakoko
Copy link
Contributor Author

Sure @olerichter00, isActive is coming from useSetActivePopover.ts and is used to tell whether there is an active popover on the app. It was done to make sure we don't show 1+ popovers on the screen at the same time. Somehow for me isActive is always false because activePopover variable from useSetActivePopover is always undefined. I couldn't figure out why and I suspect that it could be a bug that might have been introduced due to the laters additions to the progressive onboarding. I am not completely sure whether it's fine to remove it of if there is another way, would be open to hear feedbacks

@dariakoko dariakoko self-assigned this Jan 16, 2025
@dariakoko dariakoko marked this pull request as ready for review January 16, 2025 11:59
@ArtsyOpenSource
Copy link
Contributor

ArtsyOpenSource commented Jan 16, 2025

This PR contains the following changes:

  • Cross-platform user-facing changes (fix progressive onboarding is not showing up - dariakoko)

Generated by 🚫 dangerJS against ea6cbac

@olerichter00
Copy link
Contributor

I am not completely sure whether it's fine to remove it of if there is another way, would be open to hear feedbacks

Thanks for the explanation 🙏

If isActive prevents the display of two tooltips at the same time, we may need to fix it, find an alternative solution, or ensure that this cannot happen without an additional mechanism to prevent it.

I would be okay with removing the check for the upcoming release to display tooltips again. But then we should definitely look into it more.

araujobarret
araujobarret previously approved these changes Jan 16, 2025
Copy link
Contributor

@araujobarret araujobarret left a comment

Choose a reason for hiding this comment

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

looks legit 👍

@@ -19,16 +23,16 @@ export const ProgressiveOnboardingOfferSettings: React.FC = ({ children }) => {
const isDisplayable =
isArtworkListOfferabilityEnabled &&
isReady &&
!isDismissed("offer-settings").status &&
!!isDismissed("signal-interest").status &&
!isDismissed(PROGRESSIVE_ONBOARDING_OFFER_SETTINGS).status &&
Copy link
Contributor

Choose a reason for hiding this comment

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

not sure about these changes since the template literal value is also auto-completed by IDEs, but I assume maybe the constants are clearer in some way?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hm, yeah, you're right, I guess it doesn't matter then. Will revert this change, a string is way more readable

@dariakoko
Copy link
Contributor Author

@olerichter00 agree. I think for now the alternative solution would be making sure that popovers that can be displayed on the same screen are dismissed. We can do it manually. We have only one popover that can conflict with other - save-artwork. I added a check to two screens that can display this popover to make sure we do not proceed with the onboarding before it is dismissed.

@olerichter00
Copy link
Contributor

@dariakoko Ok, for now let's test manually to make sure that the case of more than one tooltip at the same time cannot happen. But I think we need to have a general mechanism in the onboarding to prevent it from happening in the future when we add more onboarding tooltips.

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.

4 participants