Skip to content

Conversation

@antonis
Copy link
Contributor

@antonis antonis commented May 10, 2022

Fixes #16503

Description

This PR determines recommended designs based on chosen vertical according to the following logic:

  • when no vertical is selected the blog category is recommended
  • when a vertical is selected and there are no recommendations, the blog category is recommended
  • when a vertical is selected and there are recommendations, a recommended category is created
  • when no vertical is selected and there is no blog category skip the recommendation
  • when a vertical is selected and there are no recommendations or blog category skip the recommendation

Note:
The randomisation of the recommended blog category order will be handled separately

To test:

To fully test this PR the group field (ref D80005) and recommended designs (ref D80579) should be available on the backend or sandbox.

Vertical with recommendations selected

  1. Start the site creation flow
  2. Select on of the six initial/default verticals that have associated recommended designs
  3. Verify that the recommended designs are suggested at the top

Vertical selection skipped

  1. Start the site creation flow
  2. Skip the vertical selection
  3. Verify that the blog category is recommended at the top

Vertical has no recommendations

  1. Start the site creation flow
  2. Select a vertical that is not one of the initial/default verticals or enter a custom vertical
  3. Verify that the blog category is recommended at the top

Regression Notes

  1. Potential unintended areas of impact
    N/A

  2. What I did to test those areas of impact (or what existing automated tests I relied on)
    Relied on existing test

  3. What automated tests I added (or what prevented me from doing so)
    Added tests for the recommendation logic in SiteDesignRecommendationProviderTest

PR submission checklist:

  • I have completed the Regression Notes.
  • I have considered adding accessibility improvements for my changes.
  • I have considered if this change warrants user-facing release notes and have added them to RELEASE-NOTES.txt if necessary.

@peril-wordpress-mobile
Copy link

peril-wordpress-mobile bot commented May 10, 2022

You can trigger optional UI/connected tests for these changes by visiting CircleCI here.

@antonis antonis changed the base branch from trunk to feature/site-design-revamp May 10, 2022 09:55
@antonis antonis added [Type] Task Site Creation Part of a WIP Feature This label is used to disable milestone checks for PRs that are not against `develop` or `release`. labels May 10, 2022
@peril-wordpress-mobile
Copy link

peril-wordpress-mobile bot commented May 10, 2022

You can test the changes on this Pull Request by downloading the APKs:

@antonis
Copy link
Contributor Author

antonis commented May 10, 2022

Leaving this in draft state till it can be tested with the backend

@ovitrif
Copy link
Contributor

ovitrif commented May 12, 2022

Leaving this in draft state till it can be tested with the backend

I've tested it by merging locally the pending changes to the backend and it works as expected: p1652300714807109-slack-C03CVCCN3J5

I guess we need the changes to be merged on the backend before actually merging this

@antonis
Copy link
Contributor Author

antonis commented May 12, 2022

Thank you for testing @ovitrif 🙇

I guess we need the changes to be merged on the backend before actually merging this

To fully test this PR the group field (ref D80005) and recommended designs (ref D80579) should be available on the backend or sandbox. On the other hand since this won't reach trunk yet, we can merge it. I updated the description to reflect that and made changed it to Ready for Review.

@antonis antonis marked this pull request as ready for review May 12, 2022 10:58
@antonis antonis requested a review from a team May 12, 2022 10:59
fun onChooseTapped() {
// TODO: adapt this to the new flow
selectedLayout?.let { layout ->
super.onPreviewChooseTapped()
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@mkevins Delaying the super call that dismisses the preview screen and unselects the layout seems to fix the flow.
I removed the TODO but I'll be happy to put it back if there is more to it 🙏

Copy link
Contributor

Choose a reason for hiding this comment

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

Fwiw, I added this comment before removing the bottom action buttons, and I left it in case anything else would need to be wired up when adding the new behavior. Delaying it sounds good to me (an alternative might be to pass it as a parameter, but I think this is simpler 🤷‍♂️ ).

One other consideration I had at the time was with regard to the tracks events, and whether we are differentiating between the user choosing from the main screen and the preview screen (in the old flow). In the new flow there is only one path to choose a theme, so maybe we just need to update the tracks description to reflect this?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thank you for the feedback @mkevins 🙇

One other consideration I had at the time was with regard to the tracks events, and whether we are differentiating between the user choosing from the main screen and the preview screen (in the old flow). In the new flow there is only one path to choose a theme, so maybe we just need to update the tracks description to reflect this?

That's a good point. I think with the old flow we do not differentiate between choosing directly or choosing in the preview screen and emit the same event enhanced_site_creation_site_design_selected. Despite that I think it's a good idea to make clear in the description of what we track when we update it to add the new recommended property.

ps. I added a draft issue [Site Design Revamp] Update Tracks event (non-blocking) on the board (cc @twstokes)

Copy link
Contributor

@ovitrif ovitrif left a comment

Choose a reason for hiding this comment

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

Great work @antonis, thank you for tackling this 🙇

✅ The code LGTM
✅ Following the test steps results works as described
🔴 I might have found a bug while doing exploratory testing:

  • Tap back, pick another vertical → the recommended section doesn't update:

It's the same when using the skip button. It might be something related to how it works when the ViewModel already exists in memory.

Not sure if we want to fix it before merging to the feature branch or afterwards 🤷‍♂️

…designs-order

[Site Design Revamp] Randomize order of designs for categories
@antonis
Copy link
Contributor Author

antonis commented May 13, 2022

Thank you for testing @ovitrif 🙇

I might have found a bug while doing exploratory testing:
Good catch 👍
Not sure if we want to fix it before merging to the feature branch or afterwards 🤷‍♂️
I'll have a look later today 🤞 In any case we can merge and open a bug on the project to be handled separately.

@ovitrif
Copy link
Contributor

ovitrif commented May 13, 2022

Thank you for testing @ovitrif 🙇

I might have found a bug while doing exploratory testing:

Good catch 👍
Not sure if we want to fix it before merging to the feature branch or afterwards 🤷‍♂️
I'll have a look later today 🤞 In any case we can merge and open a bug on the project to be handled separately.

Let's merge this since the issue can be tackled separately.

Going to review the other PR that depends on this: #16538

…mmended-property

[Site Design Revamp] Send recommended property with Tracks event on design selection
Copy link
Contributor

@ovitrif ovitrif left a comment

Choose a reason for hiding this comment

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

I created this issue for the bug we identified: #16540.

Planning to merge this one @antonis

@ovitrif ovitrif merged commit 7f12781 into feature/site-design-revamp May 13, 2022
@ovitrif ovitrif deleted the task/16503-recommend-vertical-designs branch May 13, 2022 10:46
@antonis
Copy link
Contributor Author

antonis commented May 13, 2022

I created this issue for the bug we identified: #16540.

Thank you for merging and opening the issue @ovitrif 🙇

@antonis antonis mentioned this pull request May 24, 2022
3 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Part of a WIP Feature This label is used to disable milestone checks for PRs that are not against `develop` or `release`. Site Creation [Type] Task

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Site Design Revamp] Determine recommended designs based on chosen vertical

4 participants