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

Home: Move notices to separate components #40299

Merged
merged 3 commits into from
Mar 20, 2020
Merged

Home: Move notices to separate components #40299

merged 3 commits into from
Mar 20, 2020

Conversation

mmtr
Copy link
Member

@mmtr mmtr commented Mar 19, 2020

Changes proposed in this Pull Request

  • Moves all Home notices into their own components.
  • It also consolidates all of them into the same celebrate format we started to use as a pattern for this kind of notices.
  • The introductory welcome banner added for users that have never been redirected there (Customer Home: Add a welcome banner. #39557) has been removed here in order to clean up a bit further the codebase. Likely, most of active users have already seen that banner so it should be safe to remove it
Before After
Screen Shot 2020-03-19 at 15 14 25 image
image image
image Screen Shot 2020-03-20 at 11 45 40
Screen Shot 2020-03-20 at 13 41 58 Screen Shot 2020-03-20 at 13 42 30

Testing instructions

  • Create a site.
  • Make sure Home displays a congratulatory message for the new site created.
  • Launch the site.
  • Make sure Home displays a congratulatory message for the launched site.
  • Complete the checklist.
  • Make sure Home displays a congratulatory message for the site setup being complete.
  • Reload the page and make sure the checklist complete notice is gone.
  • Migrate a site to WP.com (switch to a Simple site, go to Tools > Import, select WordPress, enter the URL of a Jetpack site and select Everything).
  • Make sure Home displays a congratulatory message for the new imported site.

@mmtr mmtr added [Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically. [Type] Janitorial [Feature] My Home The main dashboard for managing a WordPress.com site. labels Mar 19, 2020
@mmtr mmtr requested a review from a team March 19, 2020 17:06
@mmtr mmtr self-assigned this Mar 19, 2020
@matticbot
Copy link
Contributor

@gwwar
Copy link
Contributor

gwwar commented Mar 19, 2020

Reserving this comment for testing

Pretty minor, but after creating a new user + site, there appears to be a lack of whitespace between the page title and banner. Refreshing seems to clear this up.

Initial load:
Screen Shot 2020-03-19 at 1 47 37 PM

After Refresh:
Screen Shot 2020-03-19 at 1 58 22 PM

✅Verified that we now see this ^^ banner over this vv in stage
Screen Shot 2020-03-19 at 1 49 46 PM

✅Launch Site Banner looks good, though I am getting that same whitespace issue. I wonder if this is a difference between page.js navigation vs a full page refresh.

Screen Shot 2020-03-19 at 1 58 22 PM

:D fun testing note, we don't see the checklist complete message if we complete the edit your homepage task last, or launch your site. (Behavior doesn't need to be modified in this PR.) So I think this banner will only show up if we complete the mobile app step last.

Screen Shot 2020-03-19 at 2 19 19 PM

We can leave this for an enhancement PR but it appears we have a pattern in these banners to have secondary text to guide folks on what to do next. (Eg maybe a sentence explaining the quick-links?)

The notice shown for recently migrated sited has been also moved, but couldn't test it since I didn't find the needed steps for having site that is considered migrated.

We might need to ask @Automattic/start-samus if this worked before. Forcing the value makes the banner render okay, but I don't see site meta being updated after creating a new site, then importing content. We can investigate further in another PR. I don't think this is blocking.

Screen Shot 2020-03-19 at 2 35 00 PM

Current prod behavior after migration:
Screen Shot 2020-03-19 at 2 40 06 PM

*/
import CelebrateNotice from '../celebrate-notice';

const SiteSetupCompleteCard = ( { displayChecklist } ) => {
Copy link
Contributor

Choose a reason for hiding this comment

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

Minor naming note for these. I think we'd probably call these banners or notices vs cards.

Copy link
Member Author

Choose a reason for hiding this comment

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

Agree names are confusing, but decided to stick with a cards terminology for consistency reasons since we're aiming for an API that returns a layout of cards. Happy to rename them if rest of folks agree on a better name 🙂

Copy link
Contributor

@gwwar gwwar left a comment

Choose a reason for hiding this comment

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

Excellent refactor @mmtr! I left a few minor notes but nothing blocking!

@mattsherman
Copy link
Contributor

The notice shown for recently migrated sited has been also moved, but couldn't test it since I didn't find the needed steps for having site that is considered migrated.

We might need to ask @Automattic/start-samus if this worked before. Forcing the value makes the banner render okay, but I don't see site meta being updated after creating a new site, then importing content. We can investigate further in another PR. I don't think this is blocking.

@gwwar Your screenshot shows a WordPress import ("content only"), not a WordPress migration ("import everything"). So, no banner should be shown on the Home page afterwards.

@andfinally
Copy link
Contributor

Tested with a WordPress migration, and the migration banner is appearing OK.

image

@mmtr
Copy link
Member Author

mmtr commented Mar 20, 2020

Pretty minor, but after creating a new user + site, there appears to be a lack of whitespace between the page title and banner. Refreshing seems to clear this up.

Yeah, I noted this too while testing locally but wasn't sure if it was a caching issue. Will investigate before landing.

@mmtr
Copy link
Member Author

mmtr commented Mar 20, 2020

We can leave this for an enhancement PR but it appears we have a pattern in these banners to have secondary text to guide folks on what to do next. (Eg maybe a sentence explaining the quick-links?)

Pushed a commit adding a secondary text explaining the quick links if the checklist is completed:

Before After
Screen Shot 2020-03-20 at 11 49 32 Screen Shot 2020-03-20 at 11 45 40

Is the copy clear? cc @obi2020 for feedback.

@matticbot
Copy link
Contributor

matticbot commented Mar 20, 2020

Here is how your PR affects size of JS and CSS bundles shipped to the user's browser:

Sections (~3524 bytes removed 📉 [gzipped])

name  parsed_size           gzip_size
home     -13805 B  (-5.2%)    -3524 B  (-4.9%)

Sections contain code specific for a given set of routes. Is downloaded and parsed only when a particular route is navigated to.

Legend

What is parsed and gzip size?

Parsed Size: Uncompressed size of the JS and CSS files. This much code needs to be parsed and stored in memory.
Gzip Size: Compressed size of the JS and CSS files. This much data needs to be downloaded over network.

Generated by performance advisor bot at iscalypsofastyet.com.

@mmtr
Copy link
Member Author

mmtr commented Mar 20, 2020

Pretty minor, but after creating a new user + site, there appears to be a lack of whitespace between the page title and banner. Refreshing seems to clear this up.

Yeah, I noted this too while testing locally but wasn't sure if it was a caching issue. Will investigate before landing.

Turns out that CSS chunks are loaded in different order on page load. Without reloading, there was a CSS file overriding the desired margin (0 0 16px):

Screen Shot 2020-03-20 at 11 57 57

But on page load, that CSS file was loaded with lower priority, leaving the header with the right margin:

Screen Shot 2020-03-20 at 12 06 01

I handled this on 087518a by removing the sometimes overriding margin given it is actually not needed.

@mmtr mmtr added [Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically. and removed [Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically. labels Mar 20, 2020
@mmtr
Copy link
Member Author

mmtr commented Mar 20, 2020

Going to land this. We can open a follow-up PR if we want to change the "quick-links explanation" copy.

@danhauk
Copy link
Contributor

danhauk commented Mar 20, 2020

Looks good @mmtr. I like that the styles are all consolidated to create a standardized pattern here. I'd like to follow up with maybe some custom illustrations so we don't overuse the fireworks.

One question (also not blocking for this PR): thoughts on making these dismissible with the x on the right side? Since these are not essential it would be nice if people could get it out of the way if they want.

@mmtr
Copy link
Member Author

mmtr commented Mar 20, 2020

thoughts on making these dismissible with the x on the right side? Since these are not essential it would be nice if people could get it out of the way if they want.

Yup, agree. Not sure how trivial would be that work (have a feeling we cannot reuse the existing dismissible card component straight away) but it definitely worths to take a look at it.

@mmtr mmtr merged commit 1b0d9b8 into master Mar 20, 2020
@mmtr mmtr deleted the update/home-notices branch March 20, 2020 14:15
@matticbot matticbot removed the [Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically. label Mar 20, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] My Home The main dashboard for managing a WordPress.com site. [Type] Janitorial
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants