-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Importers: Move action buttons to the bottom of each screen #31364
Importers: Move action buttons to the bottom of each screen #31364
Conversation
97dc9ab
to
b6e86b8
Compare
e38a2ef
to
a6beaba
Compare
f6f98c6
to
fa3e55c
Compare
The code looks good to me - I did run into a weird state issue locally with my Wix import though, so I'd like to give this some more testing tomorrow. I'm not sure if the issue was related to these changes or if it was a pre-existing glitch. WP import
Wix Import
Wix weirdness
|
{ translate( 'Close', { context: 'verb, to Close a dialog' } ) } | ||
</Button> | ||
<ActionButton disabled={ disabled } onClick={ this.handleClick }> | ||
{ translate( 'Cancel', { context: 'verb, to Close a dialog' } ) } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe the context
here should be like to Cancel an operation
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1
const { importerStatus, icon, isEnabled, title, description } = this.props; | ||
const ButtonComponent = this.getButtonComponent(); | ||
const { importerStatus, icon, title, description, site } = this.props; | ||
const { importerState } = this.props.importerStatus; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would this be simpler?
const { importerState } = importerStatus;
@@ -121,6 +118,8 @@ class UploadingPane extends React.PureComponent { | |||
}; | |||
|
|||
render() { | |||
const { importerStatus, site, isEnabled } = this.props; | |||
const { importerState, importerId } = this.props.importerStatus; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This could be simplified too.
const { importerState, importerId } = importerStatus;
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good spotting on these! Copy pasta I swear!
Those should be handled in 7617ce8 :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
First, very nice work making these changes within this tangled part of our code base and not making it any worse... thank you!
I tested Wix and WordPress imports and everything worked as expected in terms of cancel buttons and stepping through the import. I left a comment about component naming to consider--your call if you think that's worth doing and whether it's worth doing now.
import ActionButtonContainer from 'my-sites/importer/importer-action-buttons/container'; | ||
import ActionButton from 'my-sites/importer/importer-action-buttons/action-button'; | ||
import CloseButton from 'my-sites/importer/importer-action-buttons/close-button'; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These components seem odd to me, in that they have generic names but are importing specific. Could we have more descriptive names, like ImportActionContainer
, ImportActionButton
, ImportCancelButton
, etc?
(I know this issue isn't new to this PR)
{ translate( 'Close', { context: 'verb, to Close a dialog' } ) } | ||
</Button> | ||
<ActionButton disabled={ disabled } onClick={ this.handleClick }> | ||
{ translate( 'Cancel', { context: 'verb, to Close a dialog' } ) } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1
Pinging @dezzie for a design review. |
I don't know if it's just me, but it seems like one effect of the change in the upload pane is to make it less apparent when a file has successfully uploaded - previously, a magenta button popped into view in the middle of the pane, making it very clear the upload had completed. I think the upload success is less obvious now. |
I've done a bunch of imports - several Wix, an Importer 6, a Medium - and all went well, so I reckon we're good to go. I'll hold off approving for now in case Spen wants to push any changes. |
Sadly, this is all existing weirdness, the only remedy would be to properly address the weird state set up we have there :/
I see what you're saying. I wonder if a nice ✅ icon or similar would be a good indicator here? |
@spen, @andfinally, @creativecoder, yay! I took a look, and ran some imports, and I think we are good to merge. I hear you on:
If we can follow-up on those things and put them in a separate PR for efficiency that'd be great. That also gives me time to run this stuff by the Muriel team without holding stuff up. |
All planned changes are up - the component naming and destructuring fixes, so ready for another 👀! |
Designer research indicates that Cancel is a better word to use in the context of “cancel this Import”. See #30564
7617ce8
to
b7e4705
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for having a look @dezzie and thanks for the changes Spen! This looks good to me - I've done a couple more successful imports with the latest version and experienced no hiccups. I get what you mean about the tangled state being the cause of occasional weirdness!
- I've created Importers: Make file upload success more obvious #31481 for the file upload success UI.
- The outsize progress bar was fixed in Importers: restore correct width of importer progress bar #31428.
Awesome, thanks @andfinally :) And thanks for testing again! 🙏 |
@spen It looks like this change broke an e2e test. Can you take a shot at updating the |
Thanks for the heads up @bsessions85 - I'll get on this right away :) |
This PR addresses issues with buttons in both the importers that expect the user to upload a file and the ones that expect them to input a URL, namely:
At the moment, buttons appear in different places in the importer pane, depending on the type of importer and stage of the import. @dezzie's Issues #31092 and #30564 propose a more consistent placement of all buttons in the bottom left corner of the importer pane. They also recommend some small changes to button text, and suggest removing the "scary" style from some buttons whose colour seems to clash with the magenta of the new Muriel primary style buttons.
Testing
Run through the whole importing flow with both a Wix import and a file-based import (WordPress).
Try cancelling at various points in the flow - does the button do what you expected in each place? Does the copy best represent the action?
Take the the flows through to completion - did the loading states look right? Did you get stuck at any point?
Note
The approach used here isn't perfect - because of limitations around state and certain actions being baked in to components (rather than abstracted in to the state layer) I've had to place the
ActionButton
s wherever they have access to to the actions they need to trigger: In theAuthorMappingPane
,SiteImporterInputPane
,SiteImporterSitePreview
,ImportingPane
andUploadingPane
components.The alternative would be to properly move out various pieces of state and state-changing actions from the components and in to redux but that has proven tricky in the past and wouldn't be worthwhile at this point.
Suggestion for extra work:
Between entering a URL & hitting enter, and the site-preview being generated there are essentially 2 loading states: The continue button shows it's 'busy' state (while we check the URL's validity), then there's just a spinner (while we generate the mShot preview).
It would be a smoother experience if we could have the busy state of the button represent both the validation and the mShot call.
These screenshots show how the UI of the file upload importers would look with this PR applied.
Import start
Import file uploading
(Ignore the excessive width of the progress bar in these screenshots - we'll fix that in a separate PR.)
Import file uploaded
Author mapping
Import started
Importing resources progress
Import done