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

Signup: Fix Themes step horizontal scroll #11299

Merged
merged 4 commits into from
Feb 10, 2017

Conversation

bisko
Copy link
Contributor

@bisko bisko commented Feb 9, 2017

This PR is a fix for #8745.

The Pressable "substeps" in Signup break the design a bit by being shifted to the side. Even though they are hidden, they still expand the bounding box and cause the scroll.

I'm trying to make the substeps play nice with the main steps and not cause such problems.

To test:

  • Start Signup
  • Reach Themes step
  • Check if there is horizontal scroll - there shouldn't be
  • Check if the Upload theme option is working correctly
  • Check the Themes step submits properly
  • Finish Signup and verify that the resulting site has the chosen theme
  • Verify no JS errors appear in the console

Note:
After starting signup, you need to get yourself in the Theme Upload AB test, as @lsinger mentioned below:

FWIW, to activate the Upload Theme option:

localStorage.setItem('ABTests', '{"signupThemeUpload_20160928": "showThemeUpload"}')

@bisko bisko added [Feature] Signup & Account Creation All screens and flows for making a new WordPress.com account. [Type] Bug labels Feb 9, 2017
@bisko bisko self-assigned this Feb 9, 2017
@matticbot
Copy link
Contributor

@bisko bisko added the [Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically. label Feb 9, 2017
@lsinger
Copy link
Contributor

lsinger commented Feb 9, 2017

FWIW, to activate the Upload Theme option:

localStorage.setItem('ABTests', '{"signupThemeUpload_20160928": "showThemeUpload"}')

'theme-selection__themes-wrapper': true,
'is-hidden': this.state.showPressable,
} );
let headerText = translate( 'Choose a theme.' );
Copy link
Contributor

Choose a reason for hiding this comment

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

I think we'd prefer to avoid the use of let in favor of const if possible.

In this case:

const headerText = this.state.showPressable ? "...?" : "...!";
// etc.

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 did it with the shorthand if syntax and const, but didn't look very nice and wasn't very obvious what was happening there:

const headerText = this.state.showPressable
	? translate( 'Upload your WordPress Theme' )
	: translate( 'Choose a theme.' );

const subHeaderText = this.state.showPressable
	? translate( 'Our partner Pressable is here to help you' )
	: translate( 'No need to overthink it. You can always switch to a different theme later.' );

versus:

let headerText = translate( 'Choose a theme.' );
let subHeaderText = translate( 'No need to overthink it. You can always switch to a different theme later.' );

if ( this.state.showPressable ) {
	headerText = translate( 'Upload your WordPress Theme' );
	subHeaderText = translate( 'Our partner Pressable is here to help you' );
}

I think the second one is better for readability if you're quickly skimming through the code and I don't think let/const would make a huge difference in terms of performance here :)

Copy link
Contributor

@lsinger lsinger left a comment

Choose a reason for hiding this comment

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

I did get an error in the console on the page where I had to enter the user details:

vendor.development.js?v=9278c344b7:3350 Warning: `value` prop on `input` should not be null. Consider using the empty string to clear the component or `undefined` for uncontrolled components.
    in input (created by FormTextInput)
    in FormTextInput (created by SignupForm)
    in fieldset (created by FormFieldset)
    in FormFieldset (created by ValidationFieldset)
    in ValidationFieldset (created by SignupForm)
    in div (created by SignupForm)
    in form (created by LoggedOutForm)
    in div (created by Card)
    in Card (created by LoggedOutForm)
    in LoggedOutForm (created by SignupForm)
    in div (created by SignupForm)
    in SignupForm (created by UserStep)
    in div (created by StepWrapper)
    in div (created by StepWrapper)
    in StepWrapper (created by UserStep)
    in UserStep (created by LocalizedUserStep)
    in LocalizedUserStep (created by Connect(LocalizedUserStep))
    in Connect(LocalizedUserStep) (created by Signup)
    in div (created by Signup)
    in ReactCSSTransitionGroupChild (created by ReactTransitionGroup)
    in span (created by ReactTransitionGroup)
    in ReactTransitionGroup (created by ReactCSSTransitionGroup)
    in ReactCSSTransitionGroup (created by Signup)
    in span (created by Signup)
    in Signup (created by Connect(Signup))
    in Connect(Signup)
    in Provider

And then, when submitting the form:

vendor.development.js?v=9278c344b7:3350 Warning: FormTextInput is changing an uncontrolled input of type email to be controlled. Input elements should not switch from uncontrolled to controlled (or vice versa). Decide between using a controlled or uncontrolled input element for the lifetime of the component. More info: https://fb.me/react-controlled-components
vendor.development.js?v=9278c344b7:3350 Warning: Failed prop type: Invalid prop `user` of type `boolean` supplied to `SignupProcessingScreen`, expected `object`.
    in SignupProcessingScreen (created by Signup)
    in Signup (created by Connect(Signup))
    in Connect(Signup)
    in Provider
vendor.development.js?v=9278c344b7:3350 Warning: setState(...): Can only update a mounted or mounting component. This usually means you called setState() on an unmounted component. This is a no-op. Please check the code for the SignupForm component.

And then, on the front-end after seeing Trampoline:

bootstrap 43c1d8f…:9 Uncaught TypeError: Cannot read property 'type' of undefinedh @ bootstrap 43c1d8f…:9(anonymous function) @ bootstrap 43c1d8f…:9(anonymous function) @ bootstrap 43c1d8f…:9n @ bootstrap 43c1d8f…:16h @ bootstrap 43c1d8f…:16d @ bootstrap 43c1d8f…:16

Then again I also get all of these on master. This PR doesn't seem to add any problems.

I confirm there's no horizontal scroll bar in the themes step. Clicking "Upload Theme" works, and going back as well.

Apart from the one comment I left regarding let vs. const: LGTM! 🚢

@lsinger lsinger added [Status] Ready to Merge and removed [Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically. labels Feb 10, 2017
@lsinger
Copy link
Contributor

lsinger commented Feb 10, 2017

Thanks for the update! 👍 :shipit:

@@ -14,7 +14,14 @@ import config from 'config';
export default React.createClass( {
displayName: 'StepWrapper',

propTypes: {
hideNavButtons: React.PropTypes.bool
Copy link
Member

Choose a reason for hiding this comment

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

Drive-by comment: shouldHideNav[Buttons]

@@ -66,13 +66,34 @@ class ThemeSelectionStep extends Component {
};

renderThemesList() {
const pressableWrapperClassName = classNames( {
'theme-selection__pressable-wrapper': true,
Copy link
Member

Choose a reason for hiding this comment

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

If this key is always true I think classnames allows single strings as arguments. Also, check which is more common in calypso: classnames or classNames

Copy link
Contributor Author

@bisko bisko Feb 10, 2017

Choose a reason for hiding this comment

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

 344 classNames(
 106 classnames(

} );

const themesWrapperClassName = classNames( {
'theme-selection__themes-wrapper': true,
Copy link
Member

Choose a reason for hiding this comment

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

Same applies here

<div className="theme-selection__pressable-substep-wrapper">
<div className={ pressableWrapperClassName }>
<PressableThemeStep
{ ... this.props }
Copy link
Member

Choose a reason for hiding this comment

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

Remove space after ellipsis

const { translate } = this.props;
const subHeaderText = this.state.showPressable
? translate( 'Our partner Pressable is here to help you' )
: translate( 'No need to overthink it. You can always switch to a different theme later.' );
Copy link
Member

Choose a reason for hiding this comment

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

Maybe add context for translators. The other strings may not need it, but this one probably does.

? translate( 'Our partner Pressable is here to help you', {
context: 'Subheader text in Signup, when a user chooses the Upload theme in the Themes step'
} )
: translate( 'No need to overthink it. You can always switch to a different theme later.', {
Copy link

Choose a reason for hiding this comment

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

Hi! I've found a possible matching string that has already been translated 22 times:
translate( 'No need to overthink it. You can always switch to a different theme later.' ) ES Score: 14.48
See 2 additional suggestions in the PR translation status page

Help me improve these suggestions: react with 👎 if the suggestion doesn't make any sense, or with 👍 if it's a particularly good one (even if not implemented).


const { translate } = this.props;
const subHeaderText = this.state.showPressable
? translate( 'Our partner Pressable is here to help you', {
Copy link

Choose a reason for hiding this comment

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

Hi! I've found a possible matching string that has already been translated 18 times:
translate( 'Our partner Pressable is here to help you' ) ES Score: 13.91
See 1 additional suggestion in the PR translation status page

Help me improve these suggestions: react with 👎 if the suggestion doesn't make any sense, or with 👍 if it's a particularly good one (even if not implemented).

@bisko bisko merged commit e078ace into master Feb 10, 2017
@bisko bisko deleted the fix/signup-themes-step-pressable-overlay-no-scroll branch February 10, 2017 15:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] Signup & Account Creation All screens and flows for making a new WordPress.com account. [Type] Bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants