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

Relocate AMP Preview Button #7914

Merged

Conversation

Takshil-Kunadia
Copy link
Contributor

@Takshil-Kunadia Takshil-Kunadia commented Nov 11, 2024

Summary

Checklist

  • My code is tested and passes existing tests.
  • My code follows the Engineering Guidelines (updates are often made to the guidelines, check it out periodically).

@CLAassistant
Copy link

CLAassistant commented Nov 11, 2024

CLA assistant check
All committers have signed the CLA.

@westonruter westonruter added this to the v2.5.5 milestone Nov 11, 2024
@@ -221,37 +220,36 @@ class AmpPreviewButton extends Component {
isEnabled &&
!errorMessages.length &&
!isStandardMode && (
<Button
<PluginPreviewMenuItem
Copy link
Member

Choose a reason for hiding this comment

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

We'll need to make sure that if PluginPreviewMenuItem doesn't exist due to not being on the latest version of WordPress that we short-circuit this function so we don't get an error.

@thelovekesh thelovekesh force-pushed the feature/7896-refactor-amp-preview-button branch from b3f30f6 to 67bf045 Compare November 11, 2024 18:20
@thelovekesh thelovekesh marked this pull request as ready for review November 11, 2024 19:26
@@ -1,4 +1,5 @@
FROM wordpress
# @todo: switch to wordpress:latest once it's available
FROM wordpress:beta-6.7-php8.3-apache
Copy link
Collaborator

Choose a reason for hiding this comment

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

Required to test AMP preview button changes.

@thelovekesh
Copy link
Collaborator

JS Unit tests are (not) failing because codecov is unable to upload reports of the PR from fork.

@westonruter
Copy link
Member

I noticed that the button of the AMP icon is ever so slightly cut off:

image

export const name = 'amp-preview-menu-item';

export const icon = (
<AMPFilledIcon viewBox="0 0 62 62" height={18} width={18} />
Copy link
Member

Choose a reason for hiding this comment

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

The styling of the menu items is a bit different:

image

image

Maybe this is contributing to the icon being cropped at the bottom.

Copy link
Member

Choose a reason for hiding this comment

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

If I make the icon have the 24x24 pixel dimensions then it isn't cropped. But then it's probably too big.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Interesting, With the latest build on this PR, it looks like

image

Copy link
Contributor Author

@Takshil-Kunadia Takshil-Kunadia Nov 12, 2024

Choose a reason for hiding this comment

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

Likewise @thelovekesh, The latest build doesn't have the cropping issue on any breakpoints.

Screenshot 2024-11-12 at 3 11 22 PM

Copy link
Member

Choose a reason for hiding this comment

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

Hummm. I still see it cropped with after doing a fresh npm run build:prod:

image

If I increase my browser's zoom level from 100% to 110% then the issue goes away:

image

Maybe it's a ChromeOS-specific rendering issue? In any case, not critical. Would still be good to debug further.

@westonruter
Copy link
Member

As expected, in 6.6.x I'm not seeing any preview button:

image

And when updating to 6.7-RC5 I see the button as expected:

image

@westonruter
Copy link
Member

This seems to work well. The only outstanding item is the slight cropping on the icon.

@westonruter westonruter merged commit 2d6d2f6 into ampproject:develop Nov 12, 2024
26 of 28 checks passed
@westonruter westonruter deleted the feature/7896-refactor-amp-preview-button branch November 12, 2024 17:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add AMP under "Preview" dropdown in WordPress
4 participants