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

Leverage revisions in convert to blocks action #12162

Closed
oandregal opened this issue Nov 21, 2018 · 7 comments
Closed

Leverage revisions in convert to blocks action #12162

oandregal opened this issue Nov 21, 2018 · 7 comments
Labels
[Feature] Block Transforms Block transforms from one block to another [Feature] History History, undo, redo, revisions, autosave.
Milestone

Comments

@oandregal
Copy link
Member

oandregal commented Nov 21, 2018

Is your feature request related to a problem? Please describe.

We consider "Convert to blocks" a destructive action that can be reverted: we can't guarantee perfect conversion, content may be lost although the user always has the choice to undo.

This expectation is not always clear to users, and I want to propose an approach that makes that clear while leveraging the WordPress tools we already have.

Describe the solution you'd like

After a user converts something to blocks we could show a notice saying something like:

Hey, the original block had 10.601 words and the new one has 8.021 words. Do you want to check the differences?

It will include a link to the revisions page where the user can visually spot them and take action (revert). We'll use the same notice to communicate that the process was not loosey as well.

Describe alternatives you've considered

A solution floated in some conversations was to show a message before the convert to blocks action along the lines of:

You might lose content with this action. Please, confirm.

I find this not very helpful and unnecessarily scary most of the times. The "Convert to blocks" logic does an impressive job at preserving content and transforming bad formatted HTML into a good one.

@oandregal oandregal added [Feature] Paste [Feature] Block Transforms Block transforms from one block to another labels Nov 21, 2018
@oandregal
Copy link
Member Author

oandregal commented Nov 21, 2018

For reference, we already do something like this if a block is invalid, see #7995 Showing a pre-action view of what "Convert to blocks" would do is even better than a post-action notice!

@ellatrix
Copy link
Member

I like showing the difference more and just showing a warning. Even better would be a block-by-block confirmation when we can't perfectly match the HTML. In cases we can, we don't want to show anything.

@ellatrix
Copy link
Member

So, to elaborate on that, we when you click "convert to blocks", we run the block conversion, which first corrects HTML if needed, then transforms each top level element to a block. If the block matches the HTML that needed to be converted, we continue. If it doesn't match, we show the diff with actions to be taken by the user. And so it goes on until all is converted. One conversion may need user action multiple times. I prefer this above full conversion diff because the diff will be huge and overwhelming, and it will list false positives (blocks that mapped perfectly).

@ellatrix ellatrix added the [Feature] History History, undo, redo, revisions, autosave. label Nov 27, 2018
@talldan
Copy link
Contributor

talldan commented Dec 17, 2018

Just thought I'd mentioned that a user on the forums mentioned the loss of content problem with 'Convert to Blocks' along with the idea of showing a comparison:
https://wordpress.org/support/topic/need-warning-message-convert-to-blocks-removes-content/

The use case seems somewhat similar to when there's an invalid block, where we already support a visual diff:
screen shot 2018-12-17 at 5 15 24 pm

@tomdevisser
Copy link
Member

@paaljoachim @designsimply @oandregal Seeing multiple closed issues mentioning this issue, can this one be closed as well, or is there still some action needed?

@paaljoachim
Copy link
Contributor

Hey Tom. Thanks for asking. I really do not know...

@tomdevisser
Copy link
Member

@paaljoachim Thanks, in that case I'll close it for now. I tagged a few others as well, so if anyone feels the need to re-open, by all means go ahead and let me know what needs to be done!

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] Block Transforms Block transforms from one block to another [Feature] History History, undo, redo, revisions, autosave.
Projects
None yet
Development

No branches or pull requests

6 participants