Skip to content

Gutenberg: Restore visibility of Preview button for GB 8.9+ - #45325

Merged
fullofcaffeine merged 1 commit into
masterfrom
fix/gutenberg-legacy-preview-button-visibility
Sep 1, 2020
Merged

fullofcaffeine merged 1 commit into
masterfrom
fix/gutenberg-legacy-preview-button-visibility

Conversation

@ockham

@ockham ockham commented Sep 1, 2020 •

Copy link
Copy Markdown
Contributor

Changes proposed in this Pull Request

On a WP.com site running Gutenberg 8.9.0-rc.1 (by setting the Gutenberge Edge sticker), the Preview button was no longer showing:

image

This was flagged by e2e tests:

Timed out waiting for element with css selector of '.components-button.editor-post-preview' to be clickable

The reason for this is WordPress/gutenberg#24537, where specificity of the selector that hides that button was changed: https://github.com/WordPress/gutenberg/pull/24537/files#diff-ce54206cc6b38665b9e02a3e7dbb6c7fR37-R44

Our override has lesser specificity:

@media ( min-width: 600px ) {
// Normally visible on mobile only, make it always visible
.editor-post-preview {
display: inline-flex;
}

This PR updates our override to match Gutenberg's updated specificity, thus bringing back the "Preview" button:

image

Testing instructions

  • Sandbox widgets.wp.com.
  • Sandbox a WP.com Simple site, and add the gutenberg-edge sticker to it.
  • Apply D48898-code to your sandbox.
  • Verify that the Preview button is back.
  • For completeness' sake, remove the gutenberg-edge sticker and verify that the Preview button is still present.

@ockham ockham added Bug When a feature is broken and / or not performing as intended [Goal] Gutenberg Working towards full integration with Gutenberg labels Sep 1, 2020
@ockham
ockham requested a review from a team September 1, 2020 13:51
@ockham ockham self-assigned this Sep 1, 2020
@matticbot

Copy link
Copy Markdown
Contributor

@matticbot matticbot added the [Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically. label Sep 1, 2020
@matticbot

Copy link
Copy Markdown
Contributor

This PR does not affect the size of JS and CSS bundles shipped to the user's browser.

Generated by performance advisor bot at iscalypsofastyet.com.

@sirreal sirreal added the [Status] Needs e2e Testing Gutenberg Edge Run e2e tests with a special site that is running the latest Gutenberg plugin snapshot label Sep 1, 2020

@sirreal sirreal left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Verified issue and fix from Calypso.

Before:
before
After:
after

@sirreal

sirreal commented Sep 1, 2020

Copy link
Copy Markdown
Member

The e2e tests are irrelevant as they aren't testing the changes here which must be deployed on a different system.

@sirreal sirreal 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. [Status] Needs e2e Testing Gutenberg Edge Run e2e tests with a special site that is running the latest Gutenberg plugin snapshot labels Sep 1, 2020
@fullofcaffeine
fullofcaffeine merged commit 528eedc into master Sep 1, 2020
@fullofcaffeine
fullofcaffeine deleted the fix/gutenberg-legacy-preview-button-visibility branch September 1, 2020 17:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Bug When a feature is broken and / or not performing as intended [Goal] Gutenberg Working towards full integration with Gutenberg

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants