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

[Empty blocks] Tiny refinement to "add new block" placement/flow #1177

Closed
iamthomasbishop opened this issue Jun 25, 2019 · 5 comments · Fixed by #1262
Closed

[Empty blocks] Tiny refinement to "add new block" placement/flow #1177

iamthomasbishop opened this issue Jun 25, 2019 · 5 comments · Fixed by #1262
Assignees
Labels
[Type] Enhancement Improves a current area of the editor

Comments

@iamthomasbishop
Copy link
Contributor

Related to my original proposal on #1165, which has been merged (thanks @marecar3 for the quick fix!).

While reviewing, I caught one thing that I should have mentioned in my original proposal – we should probably also hide the empty block when the inserter/library bottom sheet is open.

Screen Shot 2019-06-25 at 12 26 42 PM

@iamthomasbishop iamthomasbishop added the [Type] Enhancement Improves a current area of the editor label Jun 25, 2019
@mchowning mchowning self-assigned this Aug 1, 2019
@mchowning
Copy link
Contributor

👋 @iamthomasbishop ! I have this mostly done, but I have a question about how to handle this when the title is selected.

First, let me give some context. Currently, on the web, when you open a new post and add a series of empty paragraph blocks with the title selected, you get the following behavior:

  1. Single empty paragraph block in the post content is replaced
  2. New empty paragraph block is added (2 empty paragraph blocks now)
  3. New empty paragraph block is added (3 empty paragraph blocks now)
  4. etc.

Kapture 2019-08-06 at 6 43 10

The behavior is similar on mobile except that we recently made a change to add new blocks inserted from the post title at the beginning of the post instead of the end.

Kapture 2019-08-06 at 6 53 07

I had earlier merged a PR to change the behavior on mobile so that inserting a block from the title would replace an empty paragraph block, instead of adding a new one. We reverted that PR just before release though when @Tug noted that this was inconsistent with the web. So I basically have two questions:

  1. Do we want to maintain the current behavior with respect to inserting blocks from the title not replacing empty paragraph blocks and stay consistent with the web?
  2. If we do want to maintain the current behavior, what do we want to do with respect to the "Add Block Here" indicator? Since the first block that is added does appear to replace the initial empty paragraph block, hiding that block makes sense. But on the subsequent insertions, since the empty paragraph block does not actually replace the empty paragraph block and instead adds a new one, hiding the top empty paragraph block doesn't make sense because it is not actually getting replaced. This is a screenshot of the behavior if we hide the empty block when inserting from the title (note how the empty block goes away and then comes back):

Kapture 2019-08-06 at 7 07 24

@iamthomasbishop
Copy link
Contributor Author

Great questions. I have some thoughts :)

My over-arching (+ strong) opinion on the topic is that insertion behavior should be consistent agnostic to which block type you've got selected or are adding. To the user, the title is just another block (and it will eventually BE a separate block), so adding a block from anywhere should add it immediately and consistently after the selected block.

The way I see it, we have a few potential routes. Once we assess how much this will cost us to maintain, we should do one of the following:

  1. If limited cost, apply this behavior on mobile
  2. If high cost, try to get this into Core by proposing as a solution
  3. If high cost and Core doesn't want to implement, let's fall back to their behavior – not ideal but not the end of the world

Note: we might also want to propose this in the first scenario above, but I am not sure how much discussion has been done on the web side for this type of thing.

@iamthomasbishop
Copy link
Contributor Author

Oops, I hit enter too soon :)

If we do want to maintain the current behavior, what do we want to do with respect to the "Add Block Here" indicator?

I think we might want to leave that empty block alone in cases where it's not the only block on the canvas. So in the example you showed above there are 2 blocks – an empty paragraph, and a heading. When you added an image, I saw what I would've expected to see – the block added and the 2 original blocks pushed downward. So maybe the distinction is what happens on a post w/ no content below vs. with content.

@mchowning
Copy link
Contributor

mchowning commented Aug 6, 2019

To the user, the title is just another block (and it will eventually BE a separate block), so adding a block from anywhere should add it immediately and consistently after the selected block.

That's such a good way to frame the issue!

@hypest
Copy link
Contributor

hypest commented Aug 8, 2019

Not sure if you're actively working on this one @mchowning , if so, better to move the ticket to the "In Progress" column in the project board, otherwise let's un-assign the ticket. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Type] Enhancement Improves a current area of the editor
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants