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

Improve AMP preview button in WP 5.4 and with Gutenberg #4397

Merged
merged 7 commits into from
Mar 17, 2020

Conversation

kienstra
Copy link
Contributor

@kienstra kienstra commented Mar 16, 2020

Summary

  • Addresses the poor display of the AMP preview button that Weston found in AMP preview button looks off in WP 5.4-RC1 #4368 (comment)
  • Use <Button> instead of the now deprecated <IconButton>
  • Someone better at CSS might have better ideas. It's the best compromise of all of the scenarios
    that I could come up with.
  • Please also do npm run build:css for the changed styling here
  • With this PR:

1) WP 5.3.2, Gutenberg plugin inactive (looks the same as WP 5.2)

button-5 3 2-no-gutenberg

2) WP 5.3.2, Gutenberg plugin active

button-5 3 2-with-gutenberg

3) WP 5.4-RC2, Gutenberg plugin inactive

button-5 4-no-gutenberg

4) WP 5.4-RC2, Gutenberg plugin active

button-5 4-with-gutenberg

Fixes #4368

Checklist

  • My pull request is addressing an open issue (please create one otherwise).
  • My code is tested and passes existing tests. (Not tested, but there aren't component tests in the repo)
  • My code follows the Engineering Guidelines (updates are often made to the guidelines, check it out periodically).

Use <Button> instead of the now deprecated <IconButton>:
WordPress/gutenberg#19299
The styling here isn't ideal,
but it's the best compromise of all of the scenarios
that I could come up with.
@googlebot googlebot added the cla: yes Signed the Google CLA label Mar 16, 2020
@kienstra
Copy link
Contributor Author

Hi @pierlon,
Could you please review this? Hope you had a great weekend 😄

@kienstra kienstra requested a review from pierlon March 16, 2020 23:22
This has a button, and the warning was
from it being a child of a button.
@kienstra
Copy link
Contributor Author

kienstra commented Mar 16, 2020

Sorry, forgot to remove the DotTip. But not planning on making more commits before a review.

Update: Sorry, going to remove the @wordpress/nux package, now that it looks to be unused.

@kienstra
Copy link
Contributor Author

That should be all for commits, if/when Travis passes.

@westonruter westonruter added this to the v1.5 milestone Mar 17, 2020
Copy link
Contributor

@pierlon pierlon left a comment

Choose a reason for hiding this comment

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

Changes look good 👍, and they work as described in WP 5.2, 5.3 and 5.4. One thing I did notice is that when hovering over the AMP icon it's showing "AMP-Icon":

image

It can be found in the SVG file being used:

<title>AMP-Icon</title>

Can a tooltip be applied to the button here to override that?

@kienstra
Copy link
Contributor Author

Hi @pierlon,
Thanks a lot for reviewing this, great catch on the <title> showing AMP-Icon

Before, the title of the SVG
displayed instead.
@kienstra
Copy link
Contributor Author

Here's the tooltip, good suggestion:

tooltip-here

@googlebot
Copy link

All (the pull request submitter and all commit authors) CLAs are signed, but one or more commits were authored or co-authored by someone other than the pull request submitter.

We need to confirm that all authors are ok with their commits being contributed to this project. Please have them confirm that by leaving a comment that contains only @googlebot I consent. in this pull request.

Note to project maintainer: There may be cases where the author cannot leave a comment, or the comment is not properly detected as consent. In those cases, you can manually confirm consent of the commit author(s), and set the cla label to yes (if enabled on your project).

ℹ️ Googlers: Go here for more info.

@googlebot googlebot added cla: no Has not signed the Google CLA and removed cla: yes Signed the Google CLA labels Mar 17, 2020
@pierlon pierlon force-pushed the fix/amp-button-placement branch from 94ffeae to e3b8ea2 Compare March 17, 2020 20:23
@pierlon
Copy link
Contributor

pierlon commented Mar 17, 2020

@googlebot I consent.

@googlebot
Copy link

CLAs look good, thanks!

ℹ️ Googlers: Go here for more info.

@googlebot googlebot added cla: yes Signed the Google CLA and removed cla: no Has not signed the Google CLA labels Mar 17, 2020
Copy link
Contributor

@pierlon pierlon left a comment

Choose a reason for hiding this comment

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

Awesome, great work here @kienstra!

I've went ahead and removed the title tag from the amp-icons.svg as it conflicts with the tooltip, and done the same for amp-white-icon.svg as well.

@westonruter westonruter merged commit ab65349 into develop Mar 17, 2020
@westonruter westonruter deleted the fix/amp-button-placement branch March 17, 2020 21:41
@kienstra
Copy link
Contributor Author

OK, sounds good!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla: yes Signed the Google CLA
Projects
None yet
Development

Successfully merging this pull request may close these issues.

AMP preview button looks off in WP 5.4-RC1
4 participants