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

Site Migration: Update migration instructions screen #88813

Merged
merged 16 commits into from
Mar 27, 2024

Conversation

gabrielcaires
Copy link
Contributor

@gabrielcaires gabrielcaires commented Mar 22, 2024

Related to #88588

Proposed Changes

  • Update the site migration instructions page to reflect the figma layout 5yhaC6umexdQLlLpCrCyEe-fi-2095_9011
  • Update the instructions
  • Automatically load the migration key without any user interaction
  • Show a different message when we can’t get the migration link
  • Add links directly to the related pages

More context: p1711029899474269-slack-C0Q664T29

Testing Instructions

SHORT VERSION:

  1. Enable the feature toggle
  2. Access /setup/site-migration/site-migration-instructions?from=[JN site]&siteSlug=[YOUR_WORDPRESS.COM site created by previous migrations]
  3. Jump to the steps 10, 11 and 12.

LONG VERSION:

  1. Go to the /start URL using the calypso.live instructions
  2. Follow the flow until see the "Goals" page
  3. Open the browser Web developer tools and copy and paste the following code sessionStorage.setItem('flags', "onboarding/new-migration-flow")
  4. Type Enter
  5. Reload the goals page
  6. Select "Import or migrate content"
  7. "Where will you import from?" set https://test-vanilla-wp.godaddy.test-wpcom-migrations.net/
  8. Select "Everything (requires a Creator Plan)" on "What do you want to migrate?"
  9. When you arrive at the "Ready to migrate your site?" follow the instructions using the page links and copying the migration key. Screenshot 1(a,b)
  10. After following the instructions, refresh the page to see a screen variation. Screenshot 2(a,b)
  11. Check again the instructions for the new version, using the links.

NOTE: The screen variation with the migration key is only shown the first time the user sees the screen, after a reload only the second variation is shown.

NOTE 2: If you want to reset the site state to see screen 1 again, you just need to open the URL([TARGET_SITE]/_cli) and run the command wp option delete wpcom_site_migration_migrate_guru_key_read to delete the site option we are using to not show again the migration key.

Screenshots

1a. Desktop - Migration key available
image

1.b Mobile - Migration key available
image

2a. Desktop - Migration key not available
image

2b. Mobile - Migration key not available
image

Interactions:

7itXHm.mp4

@matticbot
Copy link
Contributor

matticbot commented Mar 22, 2024

This PR does not affect the size of JS and CSS bundles shipped to the user's browser.

Generated by performance advisor bot at iscalypsofastyet.com.

@gabrielcaires gabrielcaires requested a review from a team March 22, 2024 19:54
@matticbot matticbot added the [Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically. label Mar 22, 2024
@gabrielcaires gabrielcaires added the [Feature] Site Migration Features related to site migrations to WPcom label Mar 22, 2024
@gabrielcaires gabrielcaires marked this pull request as ready for review March 22, 2024 19:56
@gabrielcaires gabrielcaires changed the title Update/improve site migration instructions page Site Migration: Update migration instructions screen Mar 22, 2024
@gabrielcaires gabrielcaires self-assigned this Mar 22, 2024
@gabrielcaires
Copy link
Contributor Author

@javierarce I added a video showing the animations and interactions but feel free to see the real screen.

@gabrielcaires
Copy link
Contributor Author

@javierarce The show/hide eyes icon is different from the layout because there is a recommendation to use the wordpress/icons library

https://wordpress.github.io/gutenberg/?path=/story/icons-icon--library

image

@javierarce
Copy link

@javierarce The show/hide eyes icon is different from the layout because there is a recommendation to use the wordpress/icons library

You are totally right, sorry about that, I'll update the icon in Figma.

Regarding the implementation of the design, it looks great, but if we made two little adjustments to the heights of the button and the input field, they'd look better. Could we make the height of the input field 44px and the height of the button 28px?

image

@michaelpick could you and Francisco review the copy of the instructions step (5yhaC6umexdQLlLpCrCyEe-fi-2095_9011)? I think I never showed them to you.

Here's the text:

Ready to migrate your site?
Follow these steps to get started.

  1. Install and activate the Migrate Guru plugin on your existing site.
  2. In the Migrate Guru plugin settings page, enter your email address and click Migrate.
  3. When asked to select a destination host, pick “Automattic.”
  4. Copy and paste the migration key below in the “Migrate Guru Migration Key” field and click Migrate.

And you are done! When the migration finishes, Migrate Guru will send you an email.

@gabrielcaires
Copy link
Contributor Author

Regarding the implementation of the design, it looks great, but if we made two little adjustments to the heights of the button and the input field, they'd look better. Could we make the height of the input field 44px and the height of the button 28px?

image
image

@javierarce size updated!

I also prevented the component from automatically selecting the key when it is hidden.

@javierarce
Copy link

@javierarce size updated!
I also prevented the component from automatically selecting the key when it is hidden.

Fantastic, much better, thanks!

@javierarce
Copy link

One last thing that I noted (but we can update this after we get the content review) is the use of italics. Since we are using quotes the italics are redundant.

Copy link
Contributor

@daledupreez daledupreez left a comment

Choose a reason for hiding this comment

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

I have some quick feedback from inspection.

{ isSuccess && migrationKey && (
<li>
{ translate(
'Copy and paste the migration key below in the {{em}}“Migrate Guru Migration Key”{{/em}} field and click {{strong}}Migrate{{/strong}}.',
Copy link
Contributor

Choose a reason for hiding this comment

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

Question: are the label and button CTA translated in the Blog Vault/Migrate Guru UI?
We run the risk of translating these terms when they are not translated in the underlying screen.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good question!
I checked and saw they were not translating the CTAs, so I applied this change d22bc4d to protect then to be translated.

@gabrielcaires gabrielcaires requested review from a team as code owners March 26, 2024 10:13
@gabrielcaires gabrielcaires force-pushed the update/improve-site-migration-instructions-page branch from b860201 to 658ae3d Compare March 26, 2024 10:16
@gabrielcaires
Copy link
Contributor Author

gabrielcaires commented Mar 26, 2024

One last thing that I noted (but we can update this after we get the content review) is the use of italics. Since we are using quotes the italics are redundant.\

@javierarce Sure! I removed the quotes here 9f9478c

Currently, the main Migrate Guru CTA are not translatable, so we want to protect the button and fields names to be translated from our translation team.
@gabrielcaires gabrielcaires removed request for a team and chriskmnds March 26, 2024 11:26
@matticbot
Copy link
Contributor

matticbot commented Mar 26, 2024

This PR modifies the release build for the following Calypso Apps:

For info about this notification, see here: PCYsg-OT6-p2

  • wpcom-block-editor

To test WordPress.com changes, run install-plugin.sh $pluginSlug update/improve-site-migration-instructions-page on your sandbox.

{
components: {
migrationKeyField: (
<DoNotTranslateIt value="Migrate Guru Migration key" as="em" />
Copy link
Contributor

@andres-blanco andres-blanco Mar 26, 2024

Choose a reason for hiding this comment

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

What's the reasoning behind adding a DoNotTranslateIt component?

maybe adding the markup in the input string directly and passing the Migrate Guru Migration key | Migrate strings as an arg is enough?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@andres-blanco
The idea is to express the intent the value should not be translated, especially considering we don't have any kind of automated test testing translations.

My concern is we can easily remove the args value just because the intent is not clear and we don't have a test suite testing translations.

Copy link
Contributor

Choose a reason for hiding this comment

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

ok, then my only comment is that it would be good to remove the markup from the DoNotTranslateIt element and keep it in the input string. That way is more readable, and also extendable (imagine if you want to do something like <strong><em>STRING</em></strong>).
But it's just a nitpick, not a blocker. Go with your gut :)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good point; I tested, and we can still do it via {{strong}} {{migrationKeyField /}} {{/ strong }}. but I still agree with you because it blocks the translators to freely move the formatting position.
So, I update here 17eefe3

Copy link
Contributor

@daledupreez daledupreez left a comment

Choose a reason for hiding this comment

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

Overall, this is LGTM, though I do have some non-blocking feedback.

@@ -0,0 +1,22 @@
import { useQuery } from '@tanstack/react-query';
Copy link
Contributor

Choose a reason for hiding this comment

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

Nit: the filename has a typo. -migraiton- => -migration-

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed 694f4fc

Comment on lines +14 to +21
return useQuery( {
queryKey: [ 'site-migration-key', siteId ],
queryFn: () => getMigrationKey( siteId! ),
retry: false,
enabled: !! siteId,
select: ( data ) => ( { migrationKey: data?.migration_key } ),
refetchOnWindowFocus: false,
} );
Copy link
Contributor

Choose a reason for hiding this comment

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

Should we specify staleTime on the useQuery() call to allow the data to be kept in memory for a little while before we try to refetch? (reference)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I set 60 seconds as staleTime as we discussed on slack.
a8022e4

export const useSiteMigrationKey = ( siteId?: number ) => {
return useQuery( {
queryKey: [ 'site-migration-key', siteId ],
queryFn: () => getMigrationKey( siteId! ),
Copy link
Contributor

Choose a reason for hiding this comment

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

Is the ! intentional? If so, what does it do?!?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, It is saying that typescript can assume the siteId will be available when the function is executed.
The enabled flag is already ensuring it.

The line above ensures that react-query only triggers the queryFn when the siteId is available.

enabled: !! siteId,
`` ` 

.once()
.reply( 200, { migration_key: 'some-migration-key' } );

const { result } = renderHook( () => useSiteMigrationKey( 'some-site-id' ), { wrapper } );
Copy link
Contributor

Choose a reason for hiding this comment

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

Nit: the argument expects the siteId argument to be numeric, so we should likely test it with a number (or allow a site slug to be specified in the types).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed here 67c80a1

We are with the typescript checking disabled on the test files on our pipeline😢 .

max-width: 456px;
transition: all 0.2s;

&--hidden {
Copy link
Contributor

Choose a reason for hiding this comment

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

Nit: I have a strong personal preference for avoiding & as selector/text duplicator in CSS selectors because it makes it much harder to find the selector when debugging in an IDE.

While that may not seem like a common use case, every now and then we hit issues with CSS selectivity in Calypso as a result of duplicate selector names that are defined in different CSS bundles, and knowing where and how the rules were defined is relatively important.

Also, I find I need to think extra-hard to make sure I know what & actually represents, especially within patch diffs where the wrapping selector may not be visible.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks for the context:
I removed b24b270 the usage of &

Comment on lines 78 to 87
{ translate(
'You will see a screen showing multiple hosting providers. Select {{em}}Automattic{{/em}} as the destination host.',
'Go to the {{a}}Migrate Guru page on your source site{{/a}}, enter your email address, and click {{strong}}{{migrateButton /}}{{/strong}}.',
{
components: {
em: <em />,
a: <a href={ getMigrateGuruPageURL( fromUrl ) } target="_blank" rel="noreferrer" />,
migrateButton: <DoNotTranslateIt value="Migrate" />,
strong: <strong />,
},
}
) }
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't have a super-strong opinion on this, but I do think it would still be relatively easy and clear if we handle this with args and a comment. (We may need the comment anyway.) e.g.

Suggested change
{ translate(
'You will see a screen showing multiple hosting providers. Select {{em}}Automattic{{/em}} as the destination host.',
'Go to the {{a}}Migrate Guru page on your source site{{/a}}, enter your email address, and click {{strong}}{{migrateButton /}}{{/strong}}.',
{
components: {
em: <em />,
a: <a href={ getMigrateGuruPageURL( fromUrl ) } target="_blank" rel="noreferrer" />,
migrateButton: <DoNotTranslateIt value="Migrate" />,
strong: <strong />,
},
}
) }
{ translate(
'Go to the {{a}}Migrate Guru page on your source site{{/a}}, enter your email address, and click {{strong}}%(migrate)s{{/strong}}.',
{
comment: 'Note that the migrate arg will always be "Migrate", as the Blog Vault UI is not translated',
args: {
migrate: 'Migrate',
},
components: {
a: <a href={ getMigrateGuruPageURL( fromUrl ) } target="_blank" rel="noreferrer" />,
strong: <strong />,
},
}
) }

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The feedback I received was that the translators sometimes don't read the comments.

Regarding the args, I explained my concern here.
#88813 (comment)

@javierarce
Copy link

@javierarce Sure! I removed the quotes here 9f9478c

Oh, I meant to remove the italics and leave the quotes. We don't italicize that type of text.

I've pinged Francisco to do a content review of the text. If possible, let's wait for it before we merge this PR.

@javierarce
Copy link

javierarce commented Mar 27, 2024

Ok, here are the corrections (1e1T4v-g_4Lu6Kv2uCRIRYGr7KAlqlv0hxcpTm34FWbA-gdoc):

image

Title: Ready to migrate your site?
Subtitle: Follow these steps

1. Install and activate the [Migrate Guru plugin] on your existing site.
2. Go to the [Migrate Guru page on your source site], enter your email address, and click **Migrate**.
3. When asked to select a destination host, pick ‘WordPress.com‘
4. Copy and paste the migration key below in the ‘Migrate Guru Migration Key‘ field and click **Migrate** once more.

And you are done! When the migration is ready, Migrate Guru will send you an email.

image

Title: Ready to migrate your site?
Subtitle: Follow these steps

1. Install and activate the [Migrate Guru plugin] on your existing site.
2. Go to the [Migrate Guru page on your source site], enter your email address, and click Migrate.
3. When asked to select a destination host, pick ‘WordPress.com‘
4. Head to the [Migrate Guru page on the new WordPress.com site] and copy the migration key. 
5. Paste the migration key on the ‘Migrate Guru Migration Key’ field of your existing site and click **Migrate** once more.

And you are done! When the migration is ready, Migrate Guru will send you an email.

@gabrielcaires gabrielcaires merged commit b73f08f into trunk Mar 27, 2024
11 checks passed
@gabrielcaires gabrielcaires deleted the update/improve-site-migration-instructions-page branch March 27, 2024 10:38
@github-actions github-actions bot removed the [Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically. label Mar 27, 2024
@gabrielcaires
Copy link
Contributor Author

@javierarce @daledupreez Due to some github bug I only could see your suggestions after I merged.
I am going to open a new PR to fix your comment.

jeyip pushed a commit that referenced this pull request Mar 30, 2024
* Add hook to get the site-migration-key

* Add component to show/hide the migration key

* Update layout

* Add animation

* Adjust migration key input size

* Replace Automattic to WordPress.com

* Remove quotes

* Add log when we are showing the migration key fallback instructions

Improve copy

* Improve copy

* Fix test

* Protect the CTA to be translated

Currently, the main Migrate Guru CTA are not translatable, so we want to protect the button and fields names to be translated from our translation team.

* Fix typescript checking

* Fix typescript checking

* Remove tag from DoNotTranslateIt

* Add missing strong tag

* Fix unexpected scroll
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] Site Migration Features related to site migrations to WPcom
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants