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

Sequential classic blocks merge into one block on save #7916

Closed
maddisondesigns opened this issue Jul 12, 2018 · 7 comments
Closed

Sequential classic blocks merge into one block on save #7916

maddisondesigns opened this issue Jul 12, 2018 · 7 comments
Labels
[Feature] Blocks Overall functionality of blocks [Status] Not Implemented Issue/PR we will (likely) not implement.

Comments

@maddisondesigns
Copy link

Describe the bug
I just created a new page to re-test another issue and I added two Classic blocks.

screenshot_729

When I exited the page and re-edited it, my two blocks had been merged into one.

screenshot_730

To Reproduce
Steps to reproduce the behavior:

  1. Create New Page
  2. Add new Classic Block and add some content to it
  3. Add another Classic Block (under the previous) and add some content to it
  4. Publish and exit page
  5. Re-edit page and view the two blocks have merged into one

Expected behavior
Gutenberg should never merge any of my blocks. If I choose to have two of the same blocks, one after the other, then I've obviously done it for a reason. Perhaps I was planning on editing the page later on and wanted to add further blocks in-between what I'd already added.

macOS Sierra 10.12.1
Firefox Quantum 61.0.1 (64-bit)
Gutenberg 3.2.0

@designsimply designsimply changed the title Multiple blocks merge into one block when I re-edit page Sequential classic blocks merge into one block on save Jul 16, 2018
@designsimply designsimply added [Feature] Blocks Overall functionality of blocks [Status] Not Implemented Issue/PR we will (likely) not implement. labels Jul 16, 2018
@designsimply
Copy link
Member

The classic block was specifically designed to gather up all content that cannot be parsed into other known blocks and put them into one classic block, so the behavior you've described is expected in that context. There is a more information about the technical reasons surrounding this behavior in #2513 for reference.

(Note: thank you for including the plugin version number you tested and screenshots!)

@maddisondesigns
Copy link
Author

So the only way to keep them separate, if you know you want to add extra content later, is to add a dummy block in between them. That's really annoying!

@designsimply
Copy link
Member

Currently, yes. Sorry for the trouble! Classic block is a bit of a catch-all in its current state. Perhaps someone will look at making a change to it in the future based on usage or number of requests, but right now there is heavy emphasis on convergent thinking which moves us toward a solid baseline for trying out Gutenberg in core.

@mcsf
Copy link
Contributor

mcsf commented Jul 18, 2018

@maddisondesigns, may I ask if the main pain point here is just how unexpected / jarring the experience is, or if this introduces concrete obstacles for you? Since there are no block-wise options for the Classic block (nor markup differences between two Classic blocks and a joint one, HTML comments excluded), I'd like to understand the issue better.

If the question is more the unexpectedness or buggy feeling, we could probably address that elsewhere by tackling the save vs. refresh discrepancy (e.g. when moving a Classic block next to another, merge them on the spot).

@maddisondesigns
Copy link
Author

maddisondesigns commented Jul 19, 2018

@mcsf There's a couple of issues I have with this. The first is that you're changing my content. If I add two blocks to my page, regardless of whether it's two Classic Blocks or two Paragraph Blocks, when I re-edit my page I expect to see the exact same two blocks. WordPress shouldn't be altering my content, end of story!

Secondly, as I mentioned above, what if I wanted to add two Classic Blocks, knowing that I intend to re-edit the page later in the day after I find the image that I want to insert between them? You've just made more work for me. I either have to (A) remember to add a dummy block so you don't alter my content, or (B) Once I re-edit, I then have to copy content out of single block that you've made, and re-add it back into a separate Classic Block. No matter which option I choose, you're making more work for me.

If someone wants to use the Classic Block rather than having dozens of separate Paragraph blocks, they should be able to, and they should be able to use it in exactly the same way that they can use every other block. If they want to use one block, they should be able to, if they want to use 2, 3 or even 10 blocks, they should still be able to.

Personally, I think the Classic Block should be the default block (or at the very minimum, the Paragraph Block should allow you to enter multiple paragraphs). I find it extremely annoying that you split every single Paragraph into a separate block. It's not up to WordPress to decide how I add my content, it's up to me, the end user. Likewise, it should be up to the user to decide when they want to insert another block. WordPress shouldn't be doing this automatically! If I want to add multiple paragraphs into the one block, I should be able to. I've said this from day one, having every single paragraph in its own block isn't going to make it easier to manage your content, it's going to make it a pain in the ass, especially for people who write posts that are primarily text content. When people edit their content, they don't just move one whole paragraph from one location to another, they'll copy a sentence from here, a sentence from there. It's going to be so damn frustrating copying content from one block to another and then also having to move that block to some other location.

@aviv-or
Copy link

aviv-or commented Aug 23, 2019

Why is this closed? This seems like a classic example of "its not a bug its a feature". Whats the point of blocks if they are merged into a classic editor. Seems pointless. Any news on this?

@mcsf
Copy link
Contributor

mcsf commented Aug 26, 2019

This wasn't a case of feature vs. bug, but rather that the way in which the Classic block was defined (or, more specifically, the generic "freeform" block type) couldn't encompass this use case. This is because the freeform block type is, by nature, any area of content that isn't an actual block. Changing this would've required making enough concessions in the block parser and serialiser that it was fair to ask about use cases.

It turns out, in the meantime, that other use cases in nesting scenarios were compelling enough to add some support for block-boundary-wrapped Classic blocks in #16477. This means that there is some sort of precedent that could help the present issue, but a solid PR will still be needed that builds on top of #16477 and doesn't compromise the serialiser. If someone is up for working on that, I could provide review.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] Blocks Overall functionality of blocks [Status] Not Implemented Issue/PR we will (likely) not implement.
Projects
None yet
Development

No branches or pull requests

4 participants