xwp / wp-customize-snapshots

Customize Snapshots WordPress Plugin
https://wordpress.org/plugins/customize-snapshots/
52 stars 11 forks source link

Feature: Improve frontend preview link #116

Closed miina closed 7 years ago

miina commented 7 years ago

Resolves #101

coveralls commented 7 years ago

Coverage Status

Coverage remained the same at 76.941% when pulling 8c742e44109be8cb9d817a6eea1beba5f6100277 on feature/improve_view_frontend_link into cd5a18f9de3ea61bbf5e40854851c249f84a847a on develop.

PatelUtkarsh commented 7 years ago

@miina In a case of auto-draft should we add that button to preview on front-end? Currently, It is not adding it.

I was trying to copy link but seems like you're generating it on click.

One more thing - Maybe it is not related to this PR, Currently edit post link is carrying customize_changeset_uuid param. http://vvv.dev/wp-admin/post.php?post=1946&action=edit&customize_changeset_uuid=b526cc78-d93d-431a-b027-167452915f35

coveralls commented 7 years ago

Coverage Status

Coverage remained the same at 76.941% when pulling aeb65bb0a3b371023e60ccdfa1de18c210368387 on feature/improve_view_frontend_link into cd5a18f9de3ea61bbf5e40854851c249f84a847a on develop.

miina commented 7 years ago

@PatelUtkarsh Thank you for testing. If you have time, could you test if you can still see these issues?

PatelUtkarsh commented 7 years ago

@miina After publish the button stays and on click it carries customize_changeset_uuid however customize.php doesn't have any active/loaded changeset.

Edit: same behavior on initial load. button stays and carries customize_changeset_uuid param on click of frontend preview link without any change.

miina commented 7 years ago

@PatelUtkarsh Actually it's intended to have the button static, it's like a general static preview button as the others there. The changeset uuid that it has with it is the one that's going to be added to the URL when the first change happens, basically the active but not yet visible changeset uuid. Maybe that's confusing and should be removed.

coveralls commented 7 years ago

Coverage Status

Coverage remained the same at 76.941% when pulling a44359e574bd2ee1e864c1b3df6be68399c60a1e on feature/improve_view_frontend_link into cd5a18f9de3ea61bbf5e40854851c249f84a847a on develop.

miina commented 7 years ago

@PatelUtkarsh Should be fixed, so if you have time again ... :)

PatelUtkarsh commented 7 years ago

@miina This looks fine except sometimes it takes time after clicking a preview button to open new tab.

miina commented 7 years ago

It's probably taking time because it's waiting until the Customizer has finished it's changes before opening the link.

miina commented 7 years ago

@westonruter If you have a moment could you take a quick look at this PR? To detect possible issues in code that I might have missed.

westonruter commented 7 years ago

@miina here's a problem. I see that the preview link is getting inserted again with each time someone saves a draft and duplicates are getting inserted:

image

miina commented 7 years ago

Thanks for bringing that out, should be fixed now.

coveralls commented 7 years ago

Coverage Status

Changes Unknown when pulling 1ba3d8317b6fb09a2f6495b9c456e7d60bfe1cbd on feature/improve_view_frontend_link into on develop.

coveralls commented 7 years ago

Coverage Status

Changes Unknown when pulling 1ba3d8317b6fb09a2f6495b9c456e7d60bfe1cbd on feature/improve_view_frontend_link into on develop.

westonruter commented 7 years ago

There's a change of plans for where this link will appear. As can be seen in #39896 the link will now appear in a new panel that expands for extended publish settings:

image

So I'll be looking to incorporate your code into the core patch, specifically the JS logic. But the styling will probably not be included. And since it will be going into core directly, that will probably mean this PR will end up not getting merged.

miina commented 7 years ago

Okay, thank you for the update.

jeffpaul commented 7 years ago

@westonruter should we delete this PR/branch then and await the changes coming in #258 instead?

westonruter commented 7 years ago

Yeah, we'll close the PR and will continue to refer to the code in it for the core patch in https://github.com/xwp/wordpress-develop/pull/258