Skip to content
This repository has been archived by the owner on Jul 12, 2024. It is now read-only.

Pills and tooltips in product step of OBW #4707

Merged
merged 13 commits into from
Jul 21, 2020
Merged

Conversation

becdetat
Copy link
Contributor

@becdetat becdetat commented Jun 26, 2020

Partially addresses #4577

This replaces the existing price text with a new pill component, using per-month amounts. It also adds a tooltip to each pill.

Accessibility

Screenshots

image

Smaller viewport:
image

Detailed test instructions:

  • Start the OBW
  • Step through to the product selection task
  • Check that the layout matches the design mockup

@becdetat becdetat requested a review from a team June 26, 2020 06:37
@probot-autolabeler probot-autolabeler bot added focus: components Issues for woocommerce components Packages labels Jun 26, 2020
@@ -263,7 +263,7 @@
}

label.components-checkbox-control__label {
margin-left: $gap-large - $gap-smallest;
margin-left: $gap;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is just a small tweak to get the label to line up with the description per the design mockup

Copy link
Contributor

@timmyc timmyc left a comment

Choose a reason for hiding this comment

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

Looking really great Bec. Couple of minor comments in the code, otherwise all looking good there.

I did have a few questions on the design side of this so cc @jameskoster :

  • I verified with the design that the pills should be purple. Given that we have been moving away from purple everywhere else, just wanted to see why we are keeping it in this new component?
  • On narrow view ports, we can end up with the pill wrapping onto a second line. How should we handle this?

image


const monthlyPrice = ( yearlyPrice / 12.0 ).toFixed( 2 );
const priceDescription = sprintf(
'$%f per month, billed annually',
Copy link
Contributor

Choose a reason for hiding this comment

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

Looks like we missed a translation wrapper on this text.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Whoops, I thought that since sprintf came from the i18n library it included translation. Fixed in 6156c3f.

@@ -0,0 +1,7 @@
export function Pill( { children } ) {
Copy link
Contributor

Choose a reason for hiding this comment

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

A new component is born 🎉 - can we also get a line added to the changelog about this new component?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done in 0fe3e6d

@mattsherman mattsherman added needs: author feedback The issue/PR needs a response from any of the parties involved in the issue. and removed [Status] Needs Review labels Jun 26, 2020
@jameskoster
Copy link
Member

I verified with the design that the pills should be purple. Given that we have been moving away from purple everywhere else, just wanted to see why we are keeping it in this new component?

I'm going to confirm this with the design team in our call on Tuesday.

@jameskoster
Copy link
Member

@becdetat we decided that in this use case we'll make the pills gray :D If you could use $medium-gray-text for the stroke and the text, that would be splendid. Sorry for the mix up! :)

@becdetat
Copy link
Contributor Author

becdetat commented Jul 2, 2020

Thanks @jameskoster, I've updated the screenshot above with the new colours.

Do you have any guidance around how to handle narrow viewports and the pill pushing to the next line?

@jameskoster
Copy link
Member

Ah, sorry! Yes, I think the wrapping is ok, so long as we can fix the justification. When wrapped, if the title, pill, and description all line up nicely I think we're good :)

@becdetat
Copy link
Contributor Author

becdetat commented Jul 4, 2020

@jameskoster can you check the small viewport screenshot in the description above? Everything looks nicely aligned now.

@becdetat becdetat added [Status] Needs Review and removed needs: author feedback The issue/PR needs a response from any of the parties involved in the issue. labels Jul 4, 2020
@becdetat
Copy link
Contributor Author

becdetat commented Jul 8, 2020

@jameskoster just a follow-up to see if you can check on the layout? Cheers :-)

Copy link
Collaborator

@psealock psealock left a comment

Choose a reason for hiding this comment

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

Code is looking great.

Check that the layout matches the design mockup

The continue button has drifted left somehow.

Screen Shot 2020-07-09 at 2 05 43 PM

If I remember correctly we support all the way to 320px wide displays. The pills could use just a touch of smallerness.

Screen Shot 2020-07-09 at 2 01 20 PM

I also noticed the designs have grey lines and slightly more padding between options:

Screen Shot 2020-07-09 at 2 07 04 PM

@@ -0,0 +1,8 @@
.woocommerce-pill {
border: 1px solid $medium-gray-text;
Copy link
Collaborator

Choose a reason for hiding this comment

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

FYI medium-gray-text is getting removed in the next update of base-styles in #4759.

Copy link
Member

Choose a reason for hiding this comment

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

Good catch, let's make that gray-700 if we can :)

return description;
}

const monthlyPrice = ( yearlyPrice / 12.0 ).toFixed( 2 );
Copy link
Collaborator

Choose a reason for hiding this comment

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

TIL toFixed 😄

@psealock psealock added needs: author feedback The issue/PR needs a response from any of the parties involved in the issue. [Status] Needs Design Review and removed [Status] Needs Review labels Jul 9, 2020
@jameskoster
Copy link
Member

The pills could use just a touch of smallerness.

Dang, that is annoying! I'm gonna say I'm ok with it though as it feels like an edge case to me.

If we can just make sure the pills use the Caption text style (including the line-height) that will at least help a little bit.

@becdetat
Copy link
Contributor Author

Ok, this is much closer to the design now:

image
image

I did adjust the font size of the pills down from 12px to 11px, which fixes the overflow issue at 320px wide viewports.

@becdetat becdetat added [Status] Needs Review and removed needs: author feedback The issue/PR needs a response from any of the parties involved in the issue. labels Jul 14, 2020
Copy link
Member

@jameskoster jameskoster left a comment

Choose a reason for hiding this comment

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

Could we only adjust the font-size down to 11px on small screens? That way it will maintain consistency with the caption text style on all other viewport sizes :)

@jeffstieler jeffstieler added needs: author feedback The issue/PR needs a response from any of the parties involved in the issue. and removed [Status] Needs Review labels Jul 14, 2020
@becdetat
Copy link
Contributor Author

@jameskoster done in 38ccaa0 with a breakpoint on screens 320px and smaller.

@timmyc
Copy link
Contributor

timmyc commented Jul 16, 2020

@jameskoster could you give this one final 👀 from the design side of things please?

Copy link
Contributor

@timmyc timmyc left a comment

Choose a reason for hiding this comment

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

Took for one last spin, all is looking great 🚢

@timmyc timmyc added [Status] Ready to Merge and removed needs: author feedback The issue/PR needs a response from any of the parties involved in the issue. labels Jul 20, 2020
… into pills-and-tooltips-in-obw

# Conflicts:
#	client/profile-wizard/steps/product-types.js
@becdetat becdetat merged commit da243ac into main Jul 21, 2020
@becdetat becdetat deleted the pills-and-tooltips-in-obw branch July 21, 2020 04:27
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
focus: components Issues for woocommerce components
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants